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
 Assigned to: 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

Reply via email to