Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repeated column in mapping for entity:

 
Helen Ross
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can someone please be able to help me. I have been looking at this for a long time I am not able to see the issue. I am getting "Repeated column in mapping for entity: com.struts2.model.Customer column: CUSTOMER_ID (should be mapped with insert="false" update="false")" but when i add insert="false" and update="false" to my customer.hbm.xml i then get an error message "Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]". Everything appears to be set up correctly but I have limited experience using hibernate and struts2. Please let me know if i need to provide more information

Customer.hbm.xml

Customer.java
 
Tim Cooke
Sheriff
Pie
Posts: 2918
121
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really an expert on Hibernate. But are you sure you need to define the CUSTOMER_ID column as an id and a property? Perhaps that's what it means when it says "Repeated column in mapping".

Worth a try?
 
Helen Ross
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim, Thank you for you help but I now encountered another issue and I am not sure if they are related or something completely different when W am trying to execute the code.
When I remove the second reference to Customer_Id i am now getting "Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]".

Is there some rule that all the xml files needs to be stored in the same folder? Please let me know if there is more information needed.

Thanks
Shortsmiler
 
Tim Cooke
Sheriff
Pie
Posts: 2918
121
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'd get that error when Hibernate can't find a getter and/or setter for the property name. For example:


Will be looking for

Check the syntax of your getters and setters. Also, check the full stack trace of the error as it may tell you which getter/setter it can't find.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic