• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Hibernate Criteria when using many to one relation

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
am new to Hibernate Criteria, please help me

am creating a Member pojo class, in this class this Member class is having two foreign ke ys businessunitid(Many to one relation), role_id(one to one relation) of classes BusinessUnit, Role respectively.(role,businessunit are references of Role,BusinessUnit respectively)



crit = hibsession.createCriteria(Member.class)
.createCriteria("role")
.add(Restrictions.eq("role_id",role_id));
this statement working fine but

Below statement giving Hibernate Exception:
crit = hibsession.createCriteria(Member.class)
.createCriteria("businessunit ")
.add(Restrictions.eq("businessunitid",businessunitid));
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic