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: How to supress duplicate records?
PostPosted: Thu Oct 05, 2006 3:19 am 
Beginner
Beginner

Joined: Fri Aug 12, 2005 7:05 am
Posts: 25
Location: TamilNadu
I want to create one mapping document(hbm) for subselect(or view) which doesn't have unique identifier.How do i do this?

What is been done for above question?
--------------------------------------------
Map one non unique column (from view) to <id>

Result:
--------
When the duplicate value comes for that column(which is mapped to id) then the hibernate used first level cache(session) to fetch the record.

Note : When duplicate values comes for <id> column hibernate automatically treat it as same record, so fetch from first level cache(session)

What is Required?
--------------------
1. I want to supress the duplicate record which is fetched from session(cache).
(or)
2. Fecth the two(same value for id column) record as different.

Thanks in Advance,
Shanmugam


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 05, 2006 10:03 am 
Regular
Regular

Joined: Tue Sep 26, 2006 11:37 am
Posts: 115
Location: Sacramento, CA
Shanmugam,

So you have a class C { Integer id; String somedata } that is mapped to a table in the database. The table contains multiple records for the same ID and you want to be able to read them all in memory.

Is this correct?

If so then you can either add a synthetic ID to the table or use a composite ID if id+somedata uniquely identify a row.

Please add more details if the above does not help :)

Marius


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.