org.spicefactory.pimento.intercept
Annotation Type Load


@Target(value=METHOD)
@Retention(value=RUNTIME)
@Documented
public @interface Load

Marks a method as a listener for entities that get loaded into the client. This is different than the JPA entity listeners since the annotated method will only be invoked if the entity will be sent to the client, not if it was only loaded into memory by the JPA provider. The listener method must have a single method parameter of a persistent entity type. It may have an optional second parameter of type org.spicefactory.pimento.intercept.EntityEncoder which may be used to exclude properties from the entity before it gets sent to the client without modifying the actual entity. It may throw Exception in which case the transaction will be rolled back and an ErrorResponse will be sent to the client instead. This listener is especially useful for adding security constraints to entities.

Author:
Jens Halm