• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query about Composite keys - Hibernate

 
V Patil
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please TellTheDetails. We can't help you if you don't.
 
V Patil
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does findByProperty do?
 
V Patil
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic