• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate - Query Exception

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i got the QueryException in while trying to run the following query.



here , TWARSRC is the parent class which has the reference to its child class twarsrcAdrs and this child class has the property stcd.

or Am i wrong in referring to the child object from parent.

the exception stack trace is shown below

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
select rsc.twarsrcAdrs.stCd from Twarsrc rsc where rsc.rsrcId = 24932
i think the problems come because you are (implicit) joining a 1:n relation.

when the relation is bi-directional
try
select a.stcD from twarsrcAdrs a where twars.rcs.id = ?


select rsc.twarsrcAdrs.stCd from Twarsrc rsc where rsc.rsrcId = 24932

regards Sebastian
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic