-->
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.  [ 1 post ] 
Author Message
 Post subject: How to select base class?
PostPosted: Wed Jun 15, 2011 4:39 pm 
Newbie

Joined: Wed Mar 30, 2011 10:22 pm
Posts: 10
Hello, everybody!
I have simple class hierarchy.

@MappedSuperclass
class Base {
@Id
int id;
@OneToMany
Set<OtherClass> other;
}

@Entity
class MyClass extends Base {

String prop1;
String prop2;
String prop3;
}

When I select MyClass everything is ok. But in some cases I don't need properties prop1,prop2 prop3, so I want to select Base class only.
Something like

session.createQuery("from Base where ...");

It works. But it gives me list of MyClass, not Base.
Any idea how to implement such select?


Thank you,
Andrey


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

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.