-->
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: QBE compisition classes ignored.
PostPosted: Wed Mar 01, 2006 7:44 am 
Newbie

Joined: Sat Oct 29, 2005 1:23 pm
Posts: 15
Location: England
Hibernate version:
Hibernate 3.1.2

Code between sessionFactory.openSession() and session.close():
Criteria crit = getSession().createCriteria(getPersistentClass());
Example example = Example.create(exampleInstance);
if(excludeProperty != null)
{
for (String exclude : excludeProperty)
{
example.excludeProperty(exclude);
}
}

crit.add(example);
return crit.list();


Name and version of the database you are using:
MS SQL Server 2000

When using Hibernates Query By Example functionality, composition classes are ignored in the example.

i.e. Given the 2 domain instances:
1st Instace
User user (int id(pk)=1, String name="test", Realm realm1(fk to Realm))
Realm realm1 (String id(pk)="testRealm1", String description="Test Realm 1")

2nd Instance
User user (int id(pk)=2, String name="test", Realm realm2(fk to Realm))
Realm realm2 (String id(pk)="testRealm2", String description="Test Realm 2")

The following example returns both, even though the realms are different:

User user(String name="test" Realm realm1) user
Realm realm1(String id="testRealm1")

It appears that the composed class Realm is ignored in the QBE process. This happens even if the realm specifies the description as well as the id, so the problem is not due to primary keys being ignored in the QBE process.

Should I raise this as a JIRA issue?

_________________
Jamie Cash
eCommerce Consultancy Limited
The eSecurity Experts


Top
 Profile  
 
 Post subject: QBE compisition classes ignored.
PostPosted: Sat Apr 15, 2006 1:23 am 
Newbie

Joined: Fri Apr 14, 2006 1:04 am
Posts: 6
I have the same query. It seems QBE only works with examples being based on properties that are not involved in any associations. Is this the case?

Thanks.

Josh.


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.