Class MappedEntity

  • All Implemented Interfaces:
    AutoCloseable

    public class MappedEntity
    extends Object
    implements AutoCloseable
    Mapped entity contains information about an entity that has been mapped using the engine.
    Since:
    2.0.0
    Author:
    Rui Vilao (rui.vilao@feedzai.com)
    • Constructor Detail

      • MappedEntity

        public MappedEntity()
        Creates a new instance of MappedEntity.
    • Method Detail

      • setEntity

        public MappedEntity setEntity​(DbEntity entity)
        Sets the entity.
        Parameters:
        entity - The entity.
        Returns:
        This mapped entity
      • setInsert

        public MappedEntity setInsert​(PreparedStatement insert)
        Sets the insert statement.
        Parameters:
        insert - The insert statement.
        Returns:
        This mapped entity
      • getEntity

        public DbEntity getEntity()
        Gets the entity.
        Returns:
        The entity.
      • getInsert

        public PreparedStatement getInsert()
        Gets the prepared statement for inserts.
        Returns:
        The prepared statement for inserts.
      • getInsertReturning

        public PreparedStatement getInsertReturning()
        Gets the prepared statement for inserts that retrieve the generated keys using the insert statement.
        Returns:
        The insert statement that allows returning the generated keys.
      • setInsertReturning

        public MappedEntity setInsertReturning​(PreparedStatement insertReturning)
        Sets the insert statement that allows returning the generated keys.
        Parameters:
        insertReturning - The insert statement that allows returning the generated keys
        Returns:
        This mapped entity
      • getAutoIncColumn

        public String getAutoIncColumn()
        Gets the auto increment column.
        Returns:
        The auto increment column.
      • setAutoIncColumn

        public MappedEntity setAutoIncColumn​(String autoIncColumn)
        Sets the auto increment column.
        Parameters:
        autoIncColumn - the auto increment column.
        Returns:
        This mapped entity.
      • isSequenceDirty

        public boolean isSequenceDirty()
        Checks if a sequence is dirty. A sequence is dirty only if it was potentially marked as so and there's an auto increment column set.
        Returns:
        true if the sequence is dirty, false otherwise.
      • setSequenceDirty

        public void setSequenceDirty​(boolean sequenceDirty)
        Sets a sequence as dirty or not.
        Parameters:
        sequenceDirty - The flag signaling the status of the sequence.