パッケージ org.nkjmlab.sorm4j.typed

インタフェース TypedOrmReader<T>

  • 既知のサブインタフェースのリスト:
    TypedOrm<T>, TypedOrmConnection<T>, TypedOrmTransaction<T>

    public interface TypedOrmReader<T>
    The typed interface of reading functions of object-relation mapping.
    作成者:
    nkjm
    • メソッドの詳細

      • readAll

        List<T> readAll()
        Reads all rows from the table indicated by object class.
        戻り値:
      • readByPrimaryKey

        T readByPrimaryKey​(Object... primaryKeyValues)
        Reads an object by its primary keys from the table indicated by object class.
        パラメータ:
        primaryKeyValues -
        戻り値:
      • readFirst

        T readFirst​(ParameterizedSql sql)
        Reads an object from the database.
        パラメータ:
        sql -
        戻り値:
      • readFirst

        T readFirst​(String sql,
                    Object... parameters)
        Reads an object from the database.
        パラメータ:
        sql - with ordered parameter. The other type parameters (e.g. named parameter, list parameter) could not be used.
        parameters - are ordered parameter.
        戻り値:
      • readList

        List<T> readList​(ParameterizedSql sql)
        Reads a list of objects from the database by mapping the results of the parameterized SQL query into instances of the given object class. Only the columns returned from the SQL query will be set into the object instance.
        パラメータ:
        sql -
        戻り値:
      • readList

        List<T> readList​(String sql,
                         Object... parameters)
        Reads a list of objects from the database by mapping the results of the parameterized SQL query into instances of the given object class. Only the columns returned from the SQL query will be set into the object instance.

        Parameters will be set according with the correspondence defined in SqlParametersSetter.setParameters(SormOptions, PreparedStatement, Object[])

        パラメータ:
        sql - with ordered parameter. The other type parameters (e.g. named parameter, list parameter) could not be used.
        parameters - are ordered parameter.
        戻り値:
      • readOne

        T readOne​(ParameterizedSql sql)
        Reads only one object from the database.
        パラメータ:
        sql -
        戻り値:
      • readOne

        T readOne​(String sql,
                  Object... parameters)
        Reads only one object from the database.
        パラメータ:
        sql -
        parameters -
        戻り値:
      • getRowMapper

        RowMapper<T> getRowMapper()
        Gets a function which maps one row in the resultSet to an object. The method does not call ResultSet.next().
        戻り値:
      • getResultSetTraverser

        ResultSetTraverser<List<T>> getResultSetTraverser()
        Gets function which traverses and maps the all the rows in the given resultSet to an object list.
        戻り値:
      • exists

        boolean exists​(T object)
        Returns the object which has same primary key exists or not.
        パラメータ:
        object -
        戻り値: