-->
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.  [ 3 posts ] 
Author Message
 Post subject: Extra column in subclass
PostPosted: Fri May 07, 2004 6:21 am 
Newbie

Joined: Tue Feb 03, 2004 1:49 pm
Posts: 16
Code:
class A
{
String id;
...
}

class B extends A
{
String extra;
...
}

class C
{
private A a;
}


...

C c = new C();
c.setA(new B());
...
session.save(C);

..


Problem: How to write a hql query that include the B's extra data??

"select from C as c join c.a as b where b.extra='sth'" is not working.

any idea??

[/code]

_________________
mzoom@homealone


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 07, 2004 10:11 am 
Regular
Regular

Joined: Tue Jan 13, 2004 4:57 am
Posts: 83
What happens if you add "where b.class = B "?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 07, 2004 1:14 pm 
Newbie

Joined: Tue Feb 03, 2004 1:49 pm
Posts: 16
still not working.

could it be my mapping problem?

I use the joined-subclass.

_________________
mzoom@homealone


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.