-->
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: Criteria query with table-per-concrete-class
PostPosted: Tue Jul 10, 2007 12:49 pm 
Newbie

Joined: Thu Oct 26, 2006 4:02 pm
Posts: 12
Hi all,

I'm having an issue with the "table-per-concrete-class" inheritance mapping strategy used with a criteria query. The problem is that when I set the order and paging limitations on the criteria, I get back a separate set of results for each concrete class "glued" together.

For example, I have two classes Customer and Employee that both inherit from Person, mapped using the "table-per-concrete-class" strategy. I use a criteria query as follows:

Code:
public IList<Person> Foo()
{
    ICriteria criteria = Session.CreateCriteria(typeof(Person));
    criteria.SetFirstResult(0);
    criteria.SetMaxResults(50);
    criteria.AddOrder(new Order("LastName", true));
    return criteria.List<Person>();
}


What Foo() actually returns is a list of 100 Person objects where the first 50 are Customer objects and the last 50 are Employee objects, each set of 50 ordered by the LastName property. Is this a limitation of the "table-per-concrete-class" strategy?

Thanks,
Matt

p.s. I'm using NHibernate 1.2.0 GA


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 12:37 pm 
Newbie

Joined: Sun Aug 12, 2007 12:32 pm
Posts: 1
Hi,

I am also having the same problem with using Hibernate 3.2.4. Do you have a solution to this problem already?
Thanks.

Regards,
Gilbert


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.