-->
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: lightweight pattern and queries
PostPosted: Thu Nov 04, 2004 6:04 am 
Regular
Regular

Joined: Tue Oct 12, 2004 9:02 am
Posts: 66
Location: Italy
I have used lightweight pattern because my table have a large BLOB field.
Now i have Normative class with only non BLOB fields and NormativeBody that extends Normative and add a property for the BLOB (String body).

Now i want to perform a query to retrieve normatives so

NormativaBody normative = ....;
...

String bodyToMatch = normative.getBody();
normative.setBody(null);

Criteria criteria = session.createCriteria(NormativaBody.class);
criteria.add(Example(normative));
criteria.add(Expression.like("body", bodyToMatch, MatchMode.ANYWHERE);
..

It would return a collection of NormativeBody with all the fileds (also body) initialized, and i don't want this because it would be too memory consuming if items retrieved will be enough!
How can i obtain Normative objects with this approach?


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.