-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate annotation mapping with inherited object
PostPosted: Wed May 07, 2008 11:53 am 
Newbie

Joined: Wed May 07, 2008 11:06 am
Posts: 2
Hi,

Got a question to ask, suppose I have an object A extending Object B. Supposing Object A has attributes maps to columns of Table A.

Object A(with attributes attrA, attrB) extends Object B(with attributes attrC). Object A is mapped to Table A as such, Table A(column A, column B, column C), through annotations.

When I query Table A using hibernate template. eg

String params[]=new String[2]
params[0]="a";
params[1]="c";
List list=getHibernateTemplate().find("from A where attrA = ? and attrC = ? ",params);

I got the following error that the application is unable to find column attrC. Any idea where I have gone wrong or I should not be doing this.

regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 08, 2008 4:20 am 
Newbie

Joined: Wed May 07, 2008 11:06 am
Posts: 2
Thanks to those who have taken a look, I have found my answer.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.