Re: Using getReportQueryIteratorByQuery
"Ali HACHAMI" <[email protected]>
| Newsgroups | gmane.comp.jakarta.ojb.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Armin, I did the test using 1.0.4. Best regards, Ali On 5/11/07, Armin Waibel <[email protected]> wrote: > > Hi Ali, > > Ali HACHAMI wrote: > > Hi Armin, > > > > > > I tried to fix the problem by renaming the class's attributes, but the > > problem is still there. In conclusion the problem happen when the > columns > > have the same name in the tables (not in the classes). > > > > In my test the java field name ("name") + column name ("NAME_") are the > same in both classes/tables. > Did you tried to fix the issue using 1.0.4 or did you tried the latest > version from SVN (OJB_1_0_RELEASE branch!)? > > regards, > Armin > > > > > > > Best regards, > > > > Ali > > > > > > On 5/5/07, Armin Waibel <[email protected]> wrote: > >> > >> Hi Ali, > >> > >> sorry for the late reply. Last week I had a DSL malfunction caused by > my > >> Internet provider. It seems to be fixed (works again for 20 hours), but > >> it could happen that I'm out of business again. > >> > >> > >> Ali HACHAMI wrote: > >> > Hi, > >> > I'm using getReportQueryIteratorByQuery and I want to select columns > >> that > >> > have the same name but are not present in my criteria : > >> > > >> > > >> > Criteria crit1 = new Criteria(); > >> > crit1.addEqualTo("id", new Integer(1)); > >> > > >> > q = QueryFactory.newReportQuery(Container.class, crit1); > >> > > >> > String[] cols = { id, "name", "refOtherClass.name "}; > >> > q.setAttributes(cls); > >> > > >> > The pb is that I'm getting the same value for the columns "name" and > " > >> > refOtherClass.name". > >> > > >> > Any help? > >> > >> I try to reproduce your problem and setup a similar test with class > >> Author and Publisher (1:1 relation Author-Publisher): > >> > >> Query q = QueryFactory.newReportQuery( > >> Author.class, new String[]{"id", "name", "publisher.name"}, null, > true); > >> Iterator result = broker.getReportQueryIteratorByQuery(q); > >> while(result.hasNext()) > >> { > >> System.out.println(ArrayUtils.toString(result.next())); > >> } > >> > >> Result: > >> {200001,author_1_testA_1178367631953_,publisher_testA_1178367631953_} > >> {200002,author_2_testA_1178367631953_,publisher_testA_1178367631953_} > >> {200003,author_3_testA_1178367631953_,publisher_testA_1178367631953_} > >> {200004,author_4_testA_1178367631953_,publisher_testA_1178367631953_} > >> > >> As you can see this works with latest version from SVN (OJB_1_0_RELEASE > >> branch!). I don't try this test with OJB 1.0.4. So if it's a bug in > >> 1.0.4, it seems to be fixed in the next upcoming version of OJB. > >> > >> If your problem still happens with latest from SVN, please post the > >> mapping for class Container and the referenced class. > >> > >> regards, > >> Armin > >> > >> > >> > Thanks in advance, > >> > > >> > Ali > >> > > >> > >> --------------------------------------------------------------------- > >> 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] > >