• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate - Query Exception

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • 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

 
Sebastian Hennebrueder
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic