-->
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: Specifying the "key" column name for a Map?
PostPosted: Wed May 24, 2006 6:29 am 
Newbie

Joined: Tue May 23, 2006 12:46 pm
Posts: 17
Can anyone tell me how to specify the name of the key column produced by a @CollectionOfElements annotation for a Map list this one?

@CollectionOfElements
public Map<String, Integer> getNameLookUp()
{
return nameLookUp;
}

The SQL produced causes a syntax error because "key" is a reserved word for Derby SQL

create table Universe_nameLookUp (
Universe_id bigint not null,
element integer,
key varchar(255),
primary key (Universe_id, key)
);

I've tried @Columns but I think this relates to @Type not @CollectionOfElements


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 11:23 am 
Newbie

Joined: Tue May 23, 2006 12:46 pm
Posts: 17
Just a quick note for anyone else who runs into this problem...

See this bug report:

http://opensource.atlassian.com/project ... se/ANN-369


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 9:17 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use @org.hibernate.annotations.MapKey

_________________
Emmanuel


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.