aspose file tools*
The moose likes Object Relational Mapping and the fly likes Repeated column in mapping for entity: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Repeated column in mapping for entity:" Watch "Repeated column in mapping for entity:" New topic
Author

Repeated column in mapping for entity:

Helen Ross
Greenhorn

Joined: Feb 23, 2012
Posts: 13
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
Bartender

Joined: Mar 28, 2008
Posts: 1132
    
  59

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?


Tim Driven Development
Helen Ross
Greenhorn

Joined: Feb 23, 2012
Posts: 13
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
Bartender

Joined: Mar 28, 2008
Posts: 1132
    
  59

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Repeated column in mapping for entity: