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
Post a Comment