The <id> attribute does not honor mapping file
----------------------------------------------

         Key: HIB-147
         URL: http://jira.andromda.org/browse/HIB-147
     Project: Hibernate Cartridge
        Type: Bug
    Versions: 3.1-RC1    
 Environment: Any
    Reporter: Naresh Bhatia
 Assigned to: Carlos Cuenca 


When generating a hibernate mapping file, the mappings specified in 
HibernateTypeMappings.xml are not honored for the <id> attribute. For all other 
situations the correct type is picked up from Hibernate mappings.

To reproduce this problem, specify the following mapping for a Long in 
HibernateTypeMappings.xml:

    <mapping>
        <from>datatype::Long</from>
        <to>org.andromda.types.MyLongType</to>
    </mapping>

Now generate a mapping file for any entity. You will find that the type in the 
<id> element is still generated as java.lang.Long as shown below:

    <id name="id" type="java.lang.Long" unsaved-value="null">
        <column name="ID" sql-type="NUMBER(19)"/>
        <generator class="native">
        </generator>
    </id>

In other words, AndroMDA is always picking up the mapping from Java mappings 
instead of Hibernate mappings.




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

Reply via email to