[ http://jira.andromda.org/browse/HIB-176?page=comments#action_12539 ]
Carlos Cuenca commented on HIB-176: ----------------------------------- Changes needed for this fix: -on HibernateEntityLogicImpl: change the isRequiresMapping method to return true in case of union-subclass (subclasses) -on HibernateEntityLogicImpl: change IsRequiresSpecializationMapping to return false in case of union-subclass (subclasses) -on Hibernate.hbm.xml.vsm: change the renderSubClass macro to use the extends tags -on Hibernate.hbm.xml.vsl: change the template to be able to create union-subclass mappings (right now it only creates class). This can be done mergging the renderSubClass method from hibernate.hbm.xml.vsm -test everything Matthias I think that,due to all the changes needed to solve this bug, and because we will publish 3.2 soon, it will be better to wait and make the changes after the release. What do you think? Carlos > union-subclass mapping introduces unnecessary dependency > -------------------------------------------------------- > > Key: HIB-176 > URL: http://jira.andromda.org/browse/HIB-176 > Project: Hibernate Cartridge > Type: Bug > Versions: 3.1 > Environment: Tested using 3.2-RC1 > Reporter: Matthias Bohlen > Assignee: Carlos Cuenca > > This error occurs only when you develop entities in different packages and > not all packages are enabled by the package filter in andromda.xml, a typical > scenario for component based development. > Scenario: > * Package a.b.c contains entity class A > * Package a.b.d contains entity class B > * B extends A > * package filter is set to that a.b.c is generated but a.b.d is not. > After code generation, the mapping looks as follows: > A.hbm.xml: > <class name="a.b.c..A" ...> > <union-subclass name="a.b.d.B"> > </union-subclass> > </class> > There is no B.hbm.xml. > This causes A.hbm.xml to depend on class B which belongs to another software > component --> bdirectional dependency between software components. > A much better way would be to remove B's mapping from A's mapping file and > instead create a separate B.hbm.xml with the following top level mapping > declaration: > > <union-subclass name="a.b.d.B" extends="a.b.c.A" > > </union-subclass> > This causes B.hbm.xml to depend on A.hbm.xml which is perfectly OK. > Maybe, this applies to other inheritance mapping strategies as well. -- 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. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642