This problem happened with me I had forgotten to a field as primary-key [ ]´s ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 07, 2003 4:19 PM Subject: Query returns only identical instances
Hi everyone, I'm absolutely puzzled by the following problem: if I execute a query with field vorgangsnummer as criteria, like this: Criteria lCriteria = new Criteria(); lCriteria.addEqualTo("vorgangsnummer", new Long(pVorgangsnummer)); Query lQuery = new QueryByCriteria(Data.class, lCriteria); Collection lResult = getBroker().getCollectionByQuery(lQuery); , I get a collection filled with identical objects that's count is as high as the count of records for this query. In repository.xml the mapping is defined as follows: <class-descriptor class="org.my.company.Data" table="daten" isolation="read-uncomitted"> <field-descriptor name="vorgangsnummer" column="vorgangsnummer" jdbc-type="BIGINT"/> <field-descriptor name="nutzer" column="nutzer" jdbc-type="INTEGER" nullable="false"/> <field-descriptor name="meldungsTyp" column="meldungstyp" jdbc-type="VARCHAR" nullable="false" primarykey="true"/> <field-descriptor name="auftragsNr" column="auftrags_nr" jdbc-type="BIGINT" nullable="false" primarykey="true"/> </class-descriptor> I'm leaving out some fields. The really interesting thing is that if I define 'jdbc-type' as INTEGER for field 'auftragsNr' the returned objects are absolutely okay. So for example instead of getting ten times the same instance of 'Data' I get ten different instances representing the ten different records from the table 'daten'. The Java type in class 'Data' is declared as long. The records only differ in the values of the field 'auftragsNr'. I am using an Oracle-DBMS. From searching the archives I have seen similar problems occuring when using JBoss. This is not the case here. I'm running a standalone application. Any ideas? Regards, Martin. -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]