[ http://jira.andromda.org/browse/HIB-159?page=all ]

Bob Fields updated HIB-159:
---------------------------

    Fix Version: 3.4-SNAPSHOT
                     (was: 3.2)

> not-null for 'class' inheritance set to false wrongly
> -----------------------------------------------------
>
>          Key: HIB-159
>          URL: http://jira.andromda.org/browse/HIB-159
>      Project: Hibernate Cartridge
>         Type: Bug

>     Reporter: Tomasz Bech
>     Assignee: Carlos Cuenca
>      Fix For: 3.4-SNAPSHOT

>
> Scenario: Entity A - inheritance type'interface', Entity B : extends A - 
> inheritance type 'class'.
> In B there is an attribute which is required. In generated hibernate xml file 
> 'not-null' is set to false (should be true). The buggy part of code:
>     public boolean isRequired()
>     {
>         boolean required = super.isRequired();
>         if (this.getOwner() instanceof HibernateEntity)
>         {
>             HibernateEntity entity = (HibernateEntity)this.getOwner();
>             //BUG: here should be "if any of Generalization.type != 
> 'interface')"
>             if (entity.isHibernateInheritanceClass() && 
> entity.getGeneralization() != null)
>             {
>                 required = false;
>             }
>         }
>         return required;
>     }
> Additionaly, imho it is not good to handle it in java code, the better place 
> is the velocity template. If the same bean is used for mapping both Hibernate 
> and Struts/WEB presentation layer, the information about not-null is lost (it 
> is overriden to 'false' by AndroMDA for sublcasses). So there is a need to 
> add additional tagged value to mark not-null field for presentation layer - 
> it is kinda awkward.

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


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

Reply via email to