パッケージ org.nkjmlab.sorm4j

インタフェース Sorm


  • public interface Sorm
    An interface of executing object-relation mapping.
    作成者:
    nkjm
    • フィールドの詳細

      • INITIAL_DEFAULT_CONFIG_STORE

        static final SormConfig INITIAL_DEFAULT_CONFIG_STORE
    • メソッドの詳細

      • create

        static Sorm create​(DataSource dataSource)
        Create a Sorm object which uses DataSource.
        パラメータ:
        dataSource -
        戻り値:
      • toOrmConnection

        static OrmConnection toOrmConnection​(Connection connection)
        Create a OrmConnection wrapping the given JDBC Connection
        パラメータ:
        connection -
        戻り値:
      • accept

        void accept​(ConsumerHandler<OrmConnection> handler)
        Accepts a OrmConnection handler for a task with object-relation mapping. The connection will be closed after the process of handler.
        パラメータ:
        handler -
      • acceptJdbcConnectionHandler

        void acceptJdbcConnectionHandler​(ConsumerHandler<Connection> handler)
        Accepts a Connection handler for a task with object-relation mapping. The connection will be closed after the process of handler.
        パラメータ:
        handler -
      • acceptTransactionHandler

        void acceptTransactionHandler​(ConsumerHandler<OrmTransaction> handler)
        Accepts a OrmTransaction handler for a task with object-relation mapping. The transaction will be committed and the connection will be closed after the process of handler. When the transaction throws a exception, the transaction will be rollback.
        パラメータ:
        handler -
      • apply

        <R> R apply​(FunctionHandler<OrmConnection,​R> handler)
        Applies a OrmConnection handler for a task with object-relation mapping and gets the result. The connection will be closed after the process of handler.
        型パラメータ:
        R -
        パラメータ:
        handler -
        戻り値:
      • applyJdbcConnectionHandler

        <R> R applyJdbcConnectionHandler​(FunctionHandler<Connection,​R> handler)
        Applies a Connection handler for a task with object-relation mapping and gets the result. The connection will be closed after the process of handler.
        型パラメータ:
        R -
        パラメータ:
        handler -
        戻り値:
      • applyTransactionHandler

        <R> R applyTransactionHandler​(FunctionHandler<OrmTransaction,​R> handler)
        Applies a OrmTransaction handler for a task with object-relation mapping and gets the result. The transaction will be committed and the connection will be closed after the process of handler. When the transaction throws a exception, the transaction will be rollback.
        型パラメータ:
        R -
        パラメータ:
        handler -
        戻り値:
      • getConfig

        SormConfig getConfig()
        Gets the config of this object.
        戻り値:
      • getOrm

        Orm getOrm()
        Gets a Orm object.
        戻り値:
      • getTableMappingStatusMap

        Map<String,​String> getTableMappingStatusMap()
        Gets map of the table mapping status. The keys are table names in lower case.
        戻り値: