You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Rick Curtis <cu...@gmail.com> on 2014/12/02 16:18:43 UTC

Re: Set cascading-persist gobally or through ReverseMappingTool

Before we dive into looking at making a change to the ReverseMapping tool,
lets look a bit closer at the problem that you've encountered. Can you post
more details about what is going on when you get the " Suggested actions:
a) Set the cascade attribute for this field to CascadeType.PERSIST or
CascadeType.ALL (JPA annotations) or "persist" or "all" (JPA orm.xml),"
message?

Thanks,
Rick

On Sun, Nov 30, 2014 at 9:21 AM, Tester <sp...@gmail.com> wrote:

> Dear OpenJPA community,
>
> I use the OpenJPA ReverseMappingTool to programmatically create my
> entities. The issues that I'm now encountering is the following error
> message:
>
> Suggested actions: a) Set the cascade attribute for this field to
> CascadeType.PERSIST or CascadeType.ALL (JPA annotations) or "persist" or
> "all" (JPA orm.xml),
>  b) enable cascade-persist globally,
>  c) ...
>
> I see 3 possible solutions to change the CascadingType to Persist (the
> ReverseMappingTool puts CascadinType.Merge by default it seems):
> 1) Pass a configuration to the ReverseMappingTool to add
> CascadingType.Persist instead of the default CascadingType.Merge
>
> => I have been looking in the docs of the ReverseMappingTool, but I cannot
> find a way to set it. Am I overlooking something?
> 2) Set CascadingType.Persist globally in a programmatic way.
>
> => I looked to add it through the JDBCConfiguration/OpenJPAConfiguration or
> EntityManager, but here I still don't see way to set this globally
> 3) Manipulate the generated entity files. This is definitely possible, but
> I would prefer option 1 or 2.
>
> Anybody has an idea on how to achieve point 1 or 2?
>
> Kind regards,
>



-- 
*Rick Curtis*