[ http://jira.andromda.org/browse/HIB-154?page=comments#action_12610 ]
Luiz Eduardo Guida Valmont commented on HIB-154: ------------------------------------------------ Here's my account on this subject. First of all, it is imperative that the versioning attribute (say, "hibernateVersion") be created, otherwise Hibernate will not find neither the getter or the setter. Moreover, when you match the versioning tagged value and the attribute name, the ddl becomes inconsistent with the model. I mean, I'm trying to configure "hibernateVersion" as the versioning attribute and having both the attribute declared and the tagged value seems ok to me. In any case, here's the specific ddl snippet I'm referring to: create table PESSOA ( ID BIGINT generated by default as identity (start with 1), hibernateVersion integer not null, NOME VARCHAR(256) not null, CPF BIGINT not null, HIBERNATE_VERSION INTEGER not null, primary key (ID), unique (CPF) ); Now we have two attributes: "hibernateVersion" and "HIBERNATE_VERSION". It is clear to me that somehow, a specific AndroMDA cartridge, namely the one that generates this schema, has a bug. Besides, the application is deployable this way. The only problem is that Hibernate throws an exception: 12:07:32,042 ERROR [AbstractDAO] Initial SessionFactory creation failed. org.hibernate.MappingException: duplicate property mapping: hibernateVersion at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:344) at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:334) at org.hibernate.mapping.RootClass.validate(RootClass.java:188) at org.hibernate.cfg.Configuration.validate(Configuration.java:839) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1000) ... > Optimistic Locking - problem with version tag > --------------------------------------------- > > Key: HIB-154 > URL: http://jira.andromda.org/browse/HIB-154 > Project: Hibernate Cartridge > Type: Bug > Versions: 3.2-RC1 > Reporter: Simon Gilligan > Assignee: Carlos Cuenca > > Setting the entity tag andromda.hibernate.version=test, generates this in the > hbm.xml: > <version name="version" type="int" column="version"/> > 1.Both the property name and database column name are set the same. The > database column name should be uppercase: > <version name="version" type="int" column="VERSION"/> so that on schema > generation, it matches the uppercase used elsewhere. > 2. > The column name should be separatly settable. This will allow (for example): > <version name="version" type="int" column="OPT_LOCK_CONTROL"/> > That is, the property name is different to the database column, which allows > mapping to an existing column. > This was raised in this forum thread: > http://galaxy.andromda.org/forum/viewtopic.php?t=1417 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.andromda.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642