Re: Query returns only identical instances
Hi martin what i wrote is that in mine case that i had a field that it was primary-key in the table and i forgot to write it in xml file. [ ]´s From: <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Thursday, October 09, 2003 3:52 PM Subject: Re: Query returns only identical instances Hi Cesar, could elaborate on your answer, please? It is absolutely unclear for me what you mean by your answer. I figured that you meant that there was no primary key definded for the table. This was really the case. But changing this fact unfortunately did not help. Did you mean something else? Best regards, Martin. > 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: > isolation="read-uncomitted"> >jdbc-type="BIGINT"/> >nullable="false"/> >jdbc-type="VARCHAR" nullable="false" primarykey="true"/> >jdbc-type="BIGINT" nullable="false" primarykey="true"/> > > > 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]
Re: Query returns only identical instances
Hi Cesar, could elaborate on your answer, please? It is absolutely unclear for me what you mean by your answer. I figured that you meant that there was no primary key definded for the table. This was really the case. But changing this fact unfortunately did not help. Did you mean something else? Best regards, Martin. > 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: > isolation="read-uncomitted"> >jdbc-type="BIGINT"/> >nullable="false"/> >jdbc-type="VARCHAR" nullable="false" primarykey="true"/> >jdbc-type="BIGINT" nullable="false" primarykey="true"/> > > > 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]
Re: Query returns only identical instances
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: 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]
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: 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]