-->
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: Converting old hbm files to annotations - Could not determin
PostPosted: Thu Aug 09, 2007 12:31 pm 
Newbie

Joined: Wed Aug 01, 2007 6:08 pm
Posts: 13
I am using Hibernate 3.2 with annotations and JPA. I am converting some old hibernate mapping files to use annotations.
Here is how the mapping looks like:

<list name="scenarios" table="saved_view_scenario">
<key column="saved_view_id" />
<index column="element_order" />
<composite-element class="amazon.otb.common.view.SavedViewScenario">
<parent name="savedView" />
<many-to-one name="scenario" column="scenario_id" class="amazon.otb.common.Scenario" />
<property name="modifications" not-null="true"/>
</composite-element>
</list>

<list name="dataElements" table="saved_view_data_element">
<key column="saved_view_id" />
<index column="element_order" />
<many-to-many column="data_element_id" class="amazon.otb.common.DataElement" />
</list>


I converted first relationship as:

@Embedded
@JoinTable(
name="saved_view_scenario",
joinColumns={@JoinColumn(name="saved_view_id")}
)
@OrderBy("element_order")
public List<SavedViewScenario> getScenarios() {
return this.scenarios;
}



and second as
/**
* @return dataelements
*/
@JoinTable(
name="saved_view_data_element", joinColumns={@JoinColumn(name="saved_view_id")}
)
@OrderBy("element_order")
public List<DataElement> getDataElements() {
return this.dataElements;
}


But I am getting
[java] Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(dataElements)]
[java] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
[java] at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
[java] at org.hibernate.mapping.Property.isValid(Property.java:185)
[java] at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
[java] at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
[java] at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
[java] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
[java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
[java] ... 34 more




I would appreciate if someone can suggest corresponding syntax with JPA compliant annotations.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 3:26 pm 
Newbie

Joined: Tue Aug 15, 2006 3:43 pm
Posts: 5
Is the amazon.otb.common.DataElement annotated as a persistant entity?


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.