-->
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: Annotations - Map - rename mapkey_id
PostPosted: Sat Apr 17, 2010 6:10 am 
Beginner
Beginner

Joined: Sat Sep 12, 2009 10:20 am
Posts: 44
I'm trying to figure out how to use a different collumn name for my key id than mapkey_id.

Is this possible?


This is my current annotation:

@CollectionOfElements(fetch=FetchType.LAZY)
@JoinTable(name="Contact_CustomField", joinColumns={@JoinColumn(name="Contact_id")})
@org.hibernate.annotations.MapKey(columns={@Column(name="CustomField_id")})
@Column(name="CustomFieldOption_ID", nullable=false, columnDefinition="BIGINT(10)")
private Map<CustomField, CustomFieldOption> customFields = new HashMap<CustomField, CustomFieldOption>();

This is the db it wants:

+------------+-----------------+-----------+
| Contact_id | customFields_id | mapkey_id |
+------------+-----------------+-----------+


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.