hibernateCompositionCascade needs differentiation
-------------------------------------------------

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


It does not seem to be a change within the templates but within the code:
org.andromda.cartridges.hibernate.metafacades.HibernateAssociationEndLogicImpl
needs something like the following (pidgen java, not validated). 

    /**
     * @see 
org.andromda.cartridges.hibernate.metafacades.HibernateAssociationEnd#getHibernateCompositionCascade()
     */
    protected java.lang.String handleGetHibernateCompositionCascade()
    {
        String compositionCascade = 
StringUtils.trimToEmpty(ObjectUtils.toString(this.getConfiguredProperty(HIBERNATE_COMPOSITION_CASCADE)));
        if( !StringUtils.isBlank(compositionCascade) {
                if (compositionCascade 
.equalsIgnoreCase(HibernateGlobals.HIBERNATE_CASCADE_ALL_DELETE_ORPHAN) && 
!this.isMany()) {
                        compositionCascade = 
HibernateGlobals.HIBERNATE_CASCADE_ALL;
        }
        return compositionCascade;
    }


>> Hi there!
>> 
>> I am working with 3.1 final/spring/hibernate3.
>> 
>> In case of a composition, I'd like to use all-delete-orphan for 
>> one-to-many relations (defaultis none). It work's perfectly if 
>> I use the namespace property 
>> hibernateCompositionCascade="all-delete-orphan". 
>> 
>> The problem is (as seen in the source) that the property will be 
>> passed also to one-to-one associations (where "all" is the 'best' 
>> of what could be set). The all-orphan-delete is not allowed here.
>> 
>> Is there some other way around?
>> 
>> Best regards
>> Darius
>
> So sounds like a bug then?  If there isn't a jira issue for this
> yet can you file one?  I guess you'll need to override the template
> to provide the correct behavior.
> --
> Chad Brandon - chad [at] andromda [dot] org

                




-------------------------------------------------------
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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

Reply via email to