Is there a way to disable @AdditionalCriteria in EclipseLink? -


it's easy use @additionalcriteria in eclipselink example filter out soft deleted entities there way disable temporarily before executing specific query?

yes, it's possible, easy workaround. specified @additionalcriteria annotation this:

@additionalcriteria(":disabledeletedfeature = 1 or this.isdeleted = false") 

and specified default property value disable flag in persistence.xml:

<property name="disabledeletedfeature" value="0"/> 

so default filtering enabled can disable @ entitymanager level this:

entitymanager.setproperty("disabledeletedfeature", 1); 

it works fine me, hope helps!


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -