[ http://jira.andromda.org/browse/HIB-139?page=history ]
tequila updated HIB-139: ------------------------ Attachment: patch.txt here's the diff. this bug makes the strategy almost totally unpredictable, so do take a look at it. > 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 > Assignee: Carlos Cuenca > Attachments: HibernateAssociationEndLogicImpl.java, patch.txt > > 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. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php