File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Query about Composite keys - Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Query about Composite keys - Hibernate" Watch "Query about Composite keys - Hibernate" New topic
Author

Query about Composite keys - Hibernate

V Patil
Ranch Hand

Joined: Oct 04, 2008
Posts: 36
I am using composite key in my mapping file.
But after querying to DAO its returning me null records. the count of records retrieved is correct.
please help asap.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Please TellTheDetails. We can't help you if you don't.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
V Patil
Ranch Hand

Joined: Oct 04, 2008
Posts: 36
we are generating POJO classes using My Eclipse.
Table which is not having primary key is autogenerated by eclipse as a composite key while generating POJO files. i.e. a id class is generated
say for eg
DVLMASTER.java
DVLMASTERID.java
AbstractDVLMASTERID.java
AbstractDVLMASTER.java
and the mapping file .

i m using dao file also , in which findbyproperty is present .after using that
i m gettn result count correct, but the value is null.

l_objDoccode = dao1.findByProperty("id.division","MS");

System.out.println("doc code object size is"+l_objDoccode.size());

List DoccdeLst = new ArrayList();

for(int i =0; i<l_objDoccode.size();i++)
{


AccDvlDivMaster l_objAccDvlDivMaster =(AccDvlDivMaster)l_objDoccode.get(i);

l_objDoccode size is 52 .
but null .
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What does findByProperty do?
V Patil
Ranch Hand

Joined: Oct 04, 2008
Posts: 36
find by property
is this method

which is in DAO class parameters are
propertyName which is column name in pojo class and Object. n e more inform ation req?
please help its urgent!!!

[ Edited to use code tags - Paul Sturrock ]
[ October 16, 2008: Message edited by: Paul Sturrock ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query about Composite keys - Hibernate