Skip to content

Entity Listener #2384

Description

@gtsluk

`@Entity(value = "entity", useDiscriminator = false)
@EntityListeners(FieldSigner.class)
public class Entity Aextends RootDocument {
private String name;
@EncryptedField
private String businessEmail;
}

@target({ElementType.FIELD, ElementType.TYPE})
@retention(RetentionPolicy.RUNTIME)
public @interface EncryptedField {
}
@singleton
@startup
public class FieldSigner {
@PrePersist
void prePersist(Object entity) throws IllegalAccessException {}
@PostLoad
void onPostLoad( Object entity ) throws IllegalAccessException {
}
`
The signer class may be triggered when the entity register in morphia lifeCycle decoder. Are there any properties ensure the entity class being mapped in the lifeCycleDeoced?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions