• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Marshal
Posts: 5639
329
IntelliJ IDE Python TypeScript 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
Marshal
Posts: 5639
329
IntelliJ IDE Python TypeScript 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.
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic