foreign key relationships buggy in inheritance strategy "class"
---------------------------------------------------------------

         Key: HIB-139
         URL: http://jira.andromda.org/browse/HIB-139
     Project: Hibernate Cartridge
        Type: Bug
    Versions: 3.1-RC1    
    Reporter: tequila
 Assigned to: Carlos Cuenca 


when using the inheritance strategy "class", the not-null attribute of foreign 
key columns is not being set correctly. the problem is located in 
HibernateAssociationEndLogicImpl.isRequired(). the following logic tests if the 
foreign key column should be nullable:

Object type = this.getType();
HibernateEntity entity = (HibernateEntity)type;
entity.isHibernateInheritanceClass() && (entity.getGeneralization() != null)

the bottom expression tests the wrong end of the association for the presence 
of a superclass. in order to fix this, the first line should be replaced with:

Object type = this.getOtherEnd().getType();

jira is down at the moment, so i wasn't able to post this bug there. 




-------------------------------------------------------
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