All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mongodb.morphia.EntityInterceptor Maven / Gradle / Ivy

The newest version!
package org.mongodb.morphia;


import com.mongodb.DBObject;
import org.mongodb.morphia.annotations.PostLoad;
import org.mongodb.morphia.annotations.PostPersist;
import org.mongodb.morphia.annotations.PreLoad;
import org.mongodb.morphia.annotations.PreSave;
import org.mongodb.morphia.mapping.Mapper;


/**
 * Interface for intercepting @Entity lifecycle events
 */
public interface EntityInterceptor {
    /**
     * @param ent    the entity being processed
     * @param dbObj  the DBObject form of the entity
     * @param mapper the Mapper being used
     * @see PostLoad
     */
    void postLoad(Object ent, DBObject dbObj, Mapper mapper);

    /**
     * @param ent    the entity being processed
     * @param dbObj  the DBObject form of the entity
     * @param mapper the Mapper being used
     * @see PostPersist
     */
    void postPersist(Object ent, DBObject dbObj, Mapper mapper);

    /**
     * @param ent    the entity being processed
     * @param dbObj  the DBObject form of the entity
     * @param mapper the Mapper being used
     * @see PreLoad
     */
    void preLoad(Object ent, DBObject dbObj, Mapper mapper);

    /**
     * @param ent    the entity being processed
     * @param dbObj  the DBObject form of the entity
     * @param mapper the Mapper being used
     * @see PostPersist
     */
    void prePersist(Object ent, DBObject dbObj, Mapper mapper);

    /**
     * @param ent    the entity being processed
     * @param dbObj  the DBObject form of the entity
     * @param mapper the Mapper being used
     * @see PreSave
     */
    void preSave(Object ent, DBObject dbObj, Mapper mapper);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy