-->
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: incomplete ejb3 tags generated by hbm2java
PostPosted: Thu Oct 27, 2005 3:26 pm 
Newbie

Joined: Wed Nov 24, 2004 1:08 pm
Posts: 5
hbm2java generates this output in MyObject.java:

@OneToMany(cascade={}, fetch=FetchType.LAZY, mappedBy="xxx")^M
^M
public Set getMyCollection() {^M
return this.myCollection;^M
}^M


It should generate:

@OneToMany(cascade={}, fetch=FetchType.LAZY, mappedBy="xxx", targetEntity="com.xxx.yyy.ejb.entity.MyOtherObject")

Because `targetEntity' is missing, I get this exception when loading the par:


20:04:29,683 INFO [Ejb3Configuration] found EJB3 Entity bean: com.xxx.yyy.ejb.entity.Property
20:04:29,714 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=xxx.par
org.hibernate.AnnotationException: Collection has neither generic type or OneToMany.targetEntity() defined: com.xxx.yyy.ejb.entity.MyObject.myCollection
at org.hibernate.cfg.annotations.CollectionBinder.getCollectionType(CollectionBinder.java:347)
at org.hibernate.cfg.annotations.CollectionBinder.bind(CollectionBinder.java:304)


Top
 Profile  
 
 Post subject: incomplete tags
PostPosted: Thu Oct 27, 2005 3:46 pm 
Newbie

Joined: Wed Nov 24, 2004 1:08 pm
Posts: 5
I should have written that the correct form would be:

@OneToMany(cascade={}, fetch=FetchType.LAZY, mappedBy="xxx", targetEntity=com.xxx.yyy.ejb.entity.MyOtherObject.class)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 27, 2005 6:24 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
The mappedBy part has been fixed already

http://opensource2.atlassian.com/projec ... se/HBX-418

you may want to get the latest version of the tools from http://download.jboss.org/jbosside/builds/nightly/


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.