[jboss-user] [JBoss Tools] - How to avoid should be mapped with insert="false" update="false"

Christian Filippi do-not-reply at jboss.com
Fri Feb 22 02:19:44 EST 2013


Christian Filippi [https://community.jboss.org/people/christian1976] created the discussion

"How to avoid should be mapped with insert="false" update="false""

To view the discussion, visit: https://community.jboss.org/message/799016#799016

--------------------------------------------------------------
Hi
I'm facing a problem when i try to use the hql query editor in eclipse.
[Repeated column in mapping for entity (should be mapped with insert="false" update="false")]

I have my Mysql db filled with tables with relations and data
I need to generate all the reversed-eng classes and xml, so in the hibernate config i select Hibernate Version 3.6 (but seems that there are no differences if i choose other, like in the options, i can choose mysql innodb dialect or mysql... seems the same)

Then i open the "Hibernate Code generation configurations..." 
I check in the Main:
Generate basic typed composite ids
Detect optimistic lock colums
Detect many-to-many tables
Detect one-to-one associations


In the Exporters:
Domain code (.java)
Hibernate XML Mappings
Hibernate XML configuration


The generation runs fine, but when i try to operate a simple hql query (from tablename) i got this error:
(generated by hbm2java)
Unhandled event loop exception
org.hibernate.MappingException: Repeated column in mapping for entity: my.test.hibernate.SicComDdtOut column: SCDO-comm (should be mapped with insert="false" update="false")


I understand where the problem is and how i can avoid it is explained(should be mapped with insert="false" update="false")
But, i have many tables with many relations, and i'm still developing the database, so that means that i'll make some changes for sure.
If i follow the suggestion i must edit each problem everytime that i re-generate the code.


So i'm asking for help, is that the right way to solve this problem?
Am i missing something?


Thankyou in advance.


I'm using:
Eclipse: Version: 4.2.1.v20120814-120134...
Hibernate Tools for Eclipse Version: 3.6.0.Final-v20121205-1936-B77

Please, forgive me if i posted in a wrong section.  :)
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/799016#799016]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130222/e363efb1/attachment.html 


More information about the jboss-user mailing list