Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3
Mapping documents:
<hibernate-mapping>
<class name="billing.model.Account" table="Account">
<id name="id" type="int" column="id">
<generator class="assigned" />
</id>
<property name="firstName">
<column name="firstName" />
</property>
<property name="lastName">
<column name="lastName" />
</property>
<property name="email">
<column name="email" />
</property>
<property name="address">
<column name="address" />
</property>
<property name="phone">
<column name="phone" />
</property>
<property name="fax">
<column name="fax" />
</property>
<map name="invoices">
<key column="customerID" not-null="true" update="false" />
<map-key column="customerID" type="integer" />
<one-to-many class="billing.model.Invoice" />
</map>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
org.hibernate.MappingException: Repeated column in mapping for entity: billing.model.Invoice column: customerID (should be mapped with insert="false" update="false")
org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:652)
org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:674)
org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:696)
org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:450)
org.hibernate.mapping.RootClass.validate(RootClass.java:192)
Problems with Session and transaction handling? No
Read this:
http://hibernate.org/42.html
How do I map one account to many invoices ?
What's the best to use in this case ? List, Map, Array .. ?
Thank you for help.
[/code]