bindTrigger(annotationClass, callback); } else { bindTrigger(annotationClass, value, callback);
/** * Binds a lifecycle hook to a particular entity class. The hook will either be called: * - A single time single time per request per class READ, CREATE, UPDATE, or DELETE. * - Multiple times per request per field READ, CREATE, or UPDATE. * * The behavior is determined by the value of the {@code allowMultipleInvocations} flag. * @param entityClass The entity that triggers the lifecycle hook. * @param annotationClass (OnReadPostCommit, OnUpdatePreSecurity, etc) * @param callback The callback function to invoke. * @param allowMultipleInvocations Should the same life cycle hook be invoked multiple times for multiple * CRUD actions on the same model. */ public void bindTrigger(Class<?> entityClass, Class<? extends Annotation> annotationClass, LifeCycleHook callback, boolean allowMultipleInvocations) { bindIfUnbound(entityClass); if (allowMultipleInvocations) { getEntityBinding(entityClass).bindTrigger(annotationClass, callback); } else { getEntityBinding(entityClass).bindTrigger(annotationClass, PersistentResource.CLASS_NO_FIELD, callback); } }
/** * Binds a lifecycle hook to a particular entity class. The hook will either be called: * - A single time single time per request per class READ, CREATE, UPDATE, or DELETE. * - Multiple times per request per field READ, CREATE, or UPDATE. * * The behavior is determined by the value of the {@code allowMultipleInvocations} flag. * @param entityClass The entity that triggers the lifecycle hook. * @param annotationClass (OnReadPostCommit, OnUpdatePreSecurity, etc) * @param callback The callback function to invoke. * @param allowMultipleInvocations Should the same life cycle hook be invoked multiple times for multiple * CRUD actions on the same model. */ public void bindTrigger(Class<?> entityClass, Class<? extends Annotation> annotationClass, LifeCycleHook callback, boolean allowMultipleInvocations) { bindIfUnbound(entityClass); if (allowMultipleInvocations) { getEntityBinding(entityClass).bindTrigger(annotationClass, callback); } else { getEntityBinding(entityClass).bindTrigger(annotationClass, PersistentResource.CLASS_NO_FIELD, callback); } }
bindTrigger(annotationClass, callback); } else { bindTrigger(annotationClass, value, callback);
/** * Binds a lifecycle hook to a particular field or method in an entity. The hook will be called a * single time per request per field READ, CREATE, or UPDATE. * @param entityClass The entity that triggers the lifecycle hook. * @param annotationClass (OnReadPostCommit, OnUpdatePreSecurity, etc) * @param fieldOrMethodName The name of the field or method * @param callback The callback function to invoke. */ public void bindTrigger(Class<?> entityClass, Class<? extends Annotation> annotationClass, String fieldOrMethodName, LifeCycleHook callback) { bindIfUnbound(entityClass); getEntityBinding(entityClass).bindTrigger(annotationClass, fieldOrMethodName, callback); }
/** * Binds a lifecycle hook to a particular field or method in an entity. The hook will be called a * single time per request per field READ, CREATE, or UPDATE. * @param entityClass The entity that triggers the lifecycle hook. * @param annotationClass (OnReadPostCommit, OnUpdatePreSecurity, etc) * @param fieldOrMethodName The name of the field or method * @param callback The callback function to invoke. */ public void bindTrigger(Class<?> entityClass, Class<? extends Annotation> annotationClass, String fieldOrMethodName, LifeCycleHook callback) { bindIfUnbound(entityClass); getEntityBinding(entityClass).bindTrigger(annotationClass, fieldOrMethodName, callback); }