-->
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: using collection filter with joined-subclass mapping
PostPosted: Sat Jul 31, 2004 3:29 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 11:32 am
Posts: 32
I am posting again as my previous query did not get any response. Hopefully I am clearer this time:

I am using hibernate-2.1 with joined-subclass mapping

I have 3 classes BaseAttributes, DerivedAttributes1 and DerivedAttributes2

BaseAttributes{
int baseAttribute;
}

DerivedAttributes1 extends BaseAttributes{
int attribute1;
}


DerivedAttributes2extends BaseAttributes{
int attribute2;
}


I have a Employee Class as shown

Employee{
Set attributes
}

mapping in Employee.hbm.xml

<set
name="attributes"
lazy="true"
inverse="true"
cascade="none"
>
<key>
<column name="EMPLOYEE_ID" />
</key>
<one-to-many
class="persistence.BaseAttributes"
/>
</set>

The set can contain objects of derived type 1 or 2.


I am not able to use a collection filter by using derived class attributes in the query :

session.createFilter(employee.getAttributes(), "where this.attribute1 = xxx");

I get the following error
net.sf.hibernate.QueryException: could not resolve property: attribute1 of: persistence.BaseAttributes [where this.attribute1 = xxx]


Is there a way to handle this in hibernate.

TIA

splash


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 31, 2004 3:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
this is not supported in Hibernate2


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.