Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble in using joins in hibernate

 
Betsy Camel
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have two tables with the following columns :

Table name : employee
empid | int(11) | YES | | NULL
ename | varchar(20) | YES | | NULL
mgrid | varchar(20) | YES | | NULL

Table name : link
empid | int(11) | YES | | NULL
mgrid | varchar(20) | YES | | NULL

I would like to use the a criteria and mapping for the following condition in sql :

the mapping i have created looks like the below:

and

NewFile.hbm


I am however getting errors like
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of Honey.setLast

Please help me asap.
[ November 03, 2008: Message edited by: Paul Sturrock ]
 
ntumba lobo
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is that possible to see your persistent class and your mapping file ?
[ November 03, 2008: Message edited by: ntumba lobo ]
 
Betsy Camel
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
//package addressbook.HQL;


I have already posted the mapping files. Please help!
[ November 04, 2008: Message edited by: Paul Sturrock ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't specify a foreign key name in your one-to-one mapping for Honey, which I think means you are trying to associate a row with itself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic