-->
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: How to get rows with composite-id field null using criteria
PostPosted: Thu Dec 20, 2007 4:54 am 
Newbie

Joined: Thu Dec 20, 2007 3:51 am
Posts: 2
Hello Hibernate guru's,

I have a set of view in DB as data source. I define some composite id's for these views in corresponding hibernate mappings.

The data quality is poor so there exist rows in views which have null values in composite id member fields. But nevertheless such rows have to be processed.

Basically I would like hibernate to simply convert JDBC result sets directly to detached object lists without any persistance stuff.
Is this persiter option the thing I need?
And how should I define ClassPersister if yes?

I've found a workaround with HQL using following construct:
Code:
select new MyDomainObject(field1, field2) from MyDomainObject mdo where mdo.field1=value1


But I really love (and basically use) hibernate for it's criteria queries.

So I've found out that there is persiter option in mapping and I could define a custom ClassPersister. But unfortunately I've failed to understand code and documentation :)


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.