-->
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 annotate a Map<String,String> association?
PostPosted: Thu Nov 10, 2005 1:43 pm 
Newbie

Joined: Thu Nov 10, 2005 1:32 pm
Posts: 1
I'm trying to convert the following mapping from xml into annotations; it was working as xml:

<map name="properties" table="task_properties" order-by="property_name" lazy="false">
<key column="task_id" />
<index column="property_name" type="string" />
<element column="property_value" type="string" />
</map>

This is what I have in the task class:

@OneToMany
@MapKey(name="task_id")
@OrderBy("property_name")
@JoinTable(
table=@Table(name="task_properties"),
joinColumns = @JoinColumn(name="task_id")
)
@IndexColumn(name="property_name")
@Column(name="property_value",nullable=true)
public Map<String,String> getProperties() {
return properties;
}

I'm getting this error:
[junit] org.hibernate.AnnotationException: Associated class not found: java.lang.String
[junit] at org.hibernate.cfg.annotations.MapBinder.bindKeyFromAssociationTable(MapBinder.java:58)

any help greatly appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 7:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
this is not currently doable in hibernate annotations

_________________
Emmanuel


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.