java - bidirectional hibernate relationship -


to hibernate with me and use the following institutions have a web application I'm doing wrong?

  ... @Entity implements public class registration BaseEntity {... @OneToMany (cascade = {} CascadeType.PERSIST, mappedBy = "registration", bringing = FetchType. Aajiaar) Private List & the lift; Product & gt; Ordered products = new array list & lieutenant; Ordered Products & gt; (); ... public list & lt; Ordered product & gt; GetOrderedProducts () {Product ordered back; } Public Zero Set-up Products (List; Ordering Products & gt; Products ordered) {this.orderedProducts = orderedProducts; } ...  

  ... @Entity implements public square OrderedProduct BaseEntity {... @ManyToOne @JoinColumn (name = "registration_id", null = true ) Private Registration Registration; ... public registration getRegistration () {return registration; } Public Zero Set Registration (Registration Registration) {this.registration = Registration; } ...  

When I use it, I have the following Tomcat error:

  because: org.hibernate. AnnotationException: at.irian.conference.domain.Registration.orderedProducts on org.hibernate.cfg.annotations.TableBinder.bindFk (TableBinder.java:193) illegal org.hibernate.cfg.annotations.CollectionBinder: mappedBy on both sides of the relationship Use the .bindCollectionSecondPass (CollectionBinder.java:1325) org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass (CollectionBinder.java:1164) org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass (CollectionBinder.java:602) on the Organization On. hibernate.cfg.annotations.CollectionBinder $ 1.secondPass (CollectionBinder.java:543) org.hibernate.cfg.CollectionSecondPass.doSecondPass (CollectionSecondPass.java:66) on org.hibernate.cfg.Configuration.secondPassCompile (Configuration.java: 1163) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile (annotations) org.hibernate.cfg.config.java:329) org.hibernate.ejb.EventListenerConfigurator.configure at org.hibernate.ejb.Ejb3Configuration.buildMappings (Ejb3Configuration.java : 12226) org.hibernate.cfg.Configuration.buildMappings (on configuration. Java 148) org.hibernate.ejb on org.hibernate.ejb.Ejb3Configuration.configure (EventListenerConfigurator.java:173) (Ejb3Configuration.java:854). on Ejb3Configuration.configure (Ejb3Configuration.java:425) on org.hibernate.ejb.HibernatePersistence. createContainerEntityManagerFactory (HibernatePersistence.java:131) on org.springframework on org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory (LocalContainerEntityManagerFactoryBean.java:221) org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet (AbstractEntityManagerFactoryBean.java:251) Rg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java:1257) at .beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1288) o ... 86 more  

this code is right, I forgot to remove a second relationship


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -