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!
|