db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lam...@gmx.de
Subject Query returns only identical instances
Date Tue, 07 Oct 2003 19:19:27 GMT
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message