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: Criteria and using a proxy object
PostPosted: Mon Feb 11, 2008 2:09 pm 
Newbie

Joined: Mon Feb 11, 2008 2:00 pm
Posts: 1
Hi,

I'm using a ClientProxy object with a subset of the details from a full Client object.

How can I create a query that queries using criteria from the full Client object but which returns only that information in ClientProxy?

For example a Client has a marital status attribute, while a ClientProxy does not, but I want a list of ClientProxy's who are married.


If i use
Criteria crit = getSession().createCriteria(ClientProxy.class);
Hibernate complains that it cannot access the status attribute of ClientProxy (because there is none)

If i use
Criteria crit = getSession().createCriteria(Client.class);
I get a list of Clients, rather than ClientProxy's.

Thanks, hope I explained it sufficiently.


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.