We have tried to use the principle "convention over configuration", i.e.
provide as good default values as possible. 

I don't think "no cascade" is a good default value.

The logic behind the default value for cascade can be found in
DatabaseGenerationHelper.getDerivedCascade

What we could do is to place the values for the different cases in
generator.properties to simplify customization. Alternatively it is enough
to customize with oAW AOP and overwrite the getCascade function in
dbhelper.ext

You mention FaultTimer and FaultType. Is that a typo? 

I guess you know that you can define it as:
Entity FaultTimer {
    - @Fault fault cascade="none"
}

/Patrik


Steffen Stundzig wrote:
> 
> Hi,
> 
> If i model a many-to-one association like
> 
> ---
> Entity FaultTimer {
>     - @Fault fault
> }
> 
> Entity Fault {}
> ---
> 
> then the following snippet in FaultType.hbm.xml is generated:
> 
> ---
>      <many-to-one name="fault" column="FAULT" class="xyz.Fault" 
> cascade="all"/>
> ---
> 
> The problem is the cascade="all". If I delete the timer, the fault is 
> also be removed, which causes a DatabaseAccessaException. I must 
> explicit model cascade="none".
> 
> Could we change the default generation of the cascade attribute to 
> generate nothing if no explicit cascade is modelled in model?
> 
> regards
> 
> 
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-sculptor--cascade%3D%22all%22-tp21334672s17564p21337391.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to