-->
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: composite-id and maps -- not compatible?
PostPosted: Fri Jun 03, 2005 3:42 pm 
Beginner
Beginner

Joined: Wed Feb 09, 2005 3:27 pm
Posts: 29
I have to use maps (as opposed to POJOs) to map my business objects and am running into issues with entities that have a composite primary key (i.e. the mapping uses <composite-id>).

The problem is that Hibernate seems to be ignoring the class specified through the class attribute and silently creating a HashMap to store the individual fields. I need to be able to get to the class representing the identifier since it computes a value that depends on the composite key columns.

Another problem is that since I'm in map-mode the MapAccessor throws an exception when it encounters a composite-id element since it's expecting a Map instance.

What's the approach for dealing with composite-ids when using maps? Any help is appreciated!

Thanks,

-Kaare


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 5:07 pm 
Beginner
Beginner

Joined: Wed Feb 09, 2005 3:27 pm
Posts: 29
Well, it looks like like I'm SOL on this one. When using a POJO Hibernate instantiates the custom composite-id class, but when using a map the class is silently ignored and I get a HashMap instance instead.

Does anybody know if there's a workaround for this? I considered using a generator or a custom data type, but it seems like a bad hack.

-Kaare


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.