• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Repeated column in mapping for entity:

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic