[ http://jira.andromda.org/browse/HIB-211?page=comments#action_14730 ]
Marcio Silva commented on HIB-211: ---------------------------------- another fix would be to move the composite identifier if statement inside the for loop that iterates over the identifiers, i.e.: #foreach ($identifier in $entity.identifiers) #if (!$entity.generalization.compositeIdentifier) ${indent} <column name="$entity.subclassKeyColumn"#if ($generateDatabaseDependentCode) sql-type="$identifier.sqlType"#end/> #else ${indent} <column name="$identifier.columnName"#if ($generateDatabaseDependentCode) sql-type="$identifier.sqlType"#end/> #end instead of #if (!$entity.generalization.compositeIdentifier) ${indent} <column name="$entity.subclassKeyColumn"#if ($generateDatabaseDependentCode) sql-type="$identifier.sqlType"#end/> #else #foreach ($identifier in $entity.identifiers) ${indent} <column name="$identifier.columnName"#if ($generateDatabaseDependentCode) sql-type="$identifier.sqlType"#end/> #end > hibernateMappingStrategy=subclass missing template variable > ----------------------------------------------------------- > > Key: HIB-211 > URL: http://jira.andromda.org/browse/HIB-211 > Project: Hibernate Cartridge > Type: Bug > Versions: 3.2-RC1 > Environment: andromda 3.2 final > maven 2.0.5 > jdk 1.5.0_10 > Reporter: Peter Centgraf > Assignee: Carlos Cuenca > > There is a very obvious bug when using hibernateMappingStrategy=subclass. > This line must be added to the top of renderSubclass3 macro in > hibernate.hbm.xml.vm: > #set ($identifier = $entity.identifiers.iterator().next()) > Currently, the raw text of "$identifier.sqlType" is inserted into the mapping > files unless the subclass uses a composite identifier. > The renderSubclass3 macro is suspect because it appears to duplicate > identifier handling logic from hibernate.hbm.xml.vsl and is likely to bitrot > if the main template is updated. There are no comments to indicate which > changes from the main template are intentional and which ones are incidental. -- 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/