[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-1768) hbm2java: error generating collection of components
Carsten Hoehne (JIRA)
jira-events at lists.jboss.org
Sat Mar 1 08:28:00 EST 2008
[ http://jira.jboss.com/jira/browse/JBIDE-1768?page=comments#action_12401053 ]
Carsten Hoehne commented on JBIDE-1768:
---------------------------------------
Hello, i have rechecked. When i deploy with the Annotation from the previous comment this exception is thrown:
14:24:52,125 ERROR [[/glimpse]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
javax.persistence.PersistenceException: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: de.bafz.lims.model.Sample2Well.sampleWell[de.bafz.lims.model.SampleWellType]
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:252)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
That is correct, since SampleWell is not mapped.
I have come up with this annotation, which does deploy but i am not sure if this is the correct equivalent for the hbm.xml pcounterpart.
@CollectionOfElements(fetch=FetchType.EAGER)
@JoinTable(name="samplewell", joinColumns = {
@JoinColumn(name="SAMPLE2WELLID", nullable=false, updatable=false) }
)
@Cascade( {CascadeType.SAVE_UPDATE} )
public Collection<SampleWellType> getSampleWell() {
return this.sampleWell;
}
> hbm2java: error generating collection of components
> ---------------------------------------------------
>
> Key: JBIDE-1768
> URL: http://jira.jboss.com/jira/browse/JBIDE-1768
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: Hibernate
> Affects Versions: 2.0.0.GA
> Reporter: Carsten Hoehne
> Assigned To: Vitali Yemialyanchyk
> Attachments: demo.zip, ex - cfg.jpg, ex - cogen - cfg 1.jpg, ex - cogen - cfg 2.jpg, ex - stack 1.1.jpg, ex - stack 1.2.jpg, ex - stack 2.1.jpg, ex - stack 2.2.jpg, exception 1.jpg, result.zip, Sample.hbm.xml, Sample2Well.hbm.xml, test-case-1.jpg, test-case-1_add_2.jpg, test-case-2.jpg, ZZ_Sample.zip
>
>
> Java code with annotations should be generated from a mapping file. This file contains a collection of components. Then an exception is thrown. See forum reference.
> The files will be attached.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list