-->
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.  [ 3 posts ] 
Author Message
 Post subject: MapKeyManyToMany maps to bytearray instead of PK
PostPosted: Wed Feb 28, 2007 6:29 pm 
Newbie

Joined: Wed Feb 28, 2007 6:20 pm
Posts: 2
Hello everyone! I hope someone can help me with this.. Deadline coming closer.. :|
I have a problem when mapping a Map<Entity, String>.

@MapKeyManyToMany(joinColumns={@JoinColumn(referencedColumnName="Pk")})
@CollectionOfElements
@Cascade({CascadeType.ALL})
public Map<CarBrand, String> getDepartmentCarbrandId() {
return departmentCarbrandId;
}

The problem is that the mapkey column(for CarBrand) in the database (postgres 8.2) becomes of bytearray type instead of mapping the Pk(for CarBrand as Long). I've tried different variations of @JoinTable(name="Pk") The Map persists but with the entity serialized. The owning Entity maps to PK and the String to Varchar.

I'm using JBoss 4.0.4 GA which I think has hibernate 3.2.0.cr4.

Any clues anyone? Extremly greatful for any insights.

Best regards,

Niclas Lindberg


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 3:07 pm 
Senior
Senior

Joined: Tue Jul 25, 2006 9:05 am
Posts: 163
Location: Stuttgart/Karlsruhe, Germany
Hi,

Have you made absolutly sure that all the annotation are either at variable/field or getter/method level. If you mix and match the level at which you place the annotations you run into problems when using relationships.


Cheers,

Andy

_________________
Rules are only there to be broken


Top
 Profile  
 
 Post subject: Problem solved
PostPosted: Thu Mar 01, 2007 5:16 pm 
Newbie

Joined: Wed Feb 28, 2007 6:20 pm
Posts: 2
Upgraded to Jboss 4.0.5.GA Solved the problem. Used referenceName instead of name in the join column.

// Niclas


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.