パッケージ org.nkjmlab.sorm4j

インタフェース OrmReader

    • メソッドの詳細

      • readAll

        <T> List<T> readAll​(Class<T> objectClass)
      • readByPrimaryKey

        <T> T readByPrimaryKey​(Class<T> objectClass,
                               Object... primaryKeyValues)
        Reads an object from the database by its primary keys.
      • readFirst

        <T> T readFirst​(Class<T> objectClass,
                        String sql,
                        Object... parameters)
      • readLazy

        <T> ReadResultSet<T> readLazy​(Class<T> objectClass,
                                      String sql,
                                      Object... parameters)
        Returns an ReadResultSet and convert it to Stream, List, and so on.

        Parameters will be set according with the correspondence defined in JavaToSqlDataConverter#setParameters(PreparedStatement, int[], Object[])

        導入されたバージョン:
        1.0
      • readList

        <T> List<T> readList​(Class<T> objectClass,
                             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 JavaToSqlDataConverter#setParameters(PreparedStatement, int[], Object[])

      • readMapFirst

        Map<String,​Object> readMapFirst​(String sql,
                                              Object... parameters)
        Reads a first row from the database by mapping the results of the SQL query into an instance of Map.

        Types returned from the database will be converted to Java types in the map according with the correspondence defined in SqlToJavaDataConverter.getValueBySqlType(ResultSet, int, int).

        Parameters will be set according with the correspondence defined in JavaToSqlDataConverter#setParameters(PreparedStatement, int[], Object[])

        導入されたバージョン:
        1.0
      • readMapLazy

        ReadResultSet<Map<String,​Object>> readMapLazy​(String sql,
                                                            Object... parameters)
        Returns an ReadResultSet instance containing data from the execution of the provided parametrized SQL and convert it to Stream, List, and so on.

        Types returned from the database will be converted to Java types in the map according with the correspondence defined in SqlToJavaDataConverter.getValueBySqlType(ResultSet, int, int).

        Parameters will be set according with the correspondence defined in JavaToSqlDataConverter#setParameters(PreparedStatement, int[], Object[])

        導入されたバージョン:
        1.0
      • readMapList

        List<Map<String,​Object>> readMapList​(String sql,
                                                   Object... parameters)
        Reads a list of objects from the database by mapping the SQL execution results to instances of Map containing data from the execution of the provided parametrized SQL and

        Types returned from the database will be converted to Java types in the map according with the correspondence defined in SqlToJavaDataConverter.getValueBySqlType(ResultSet, int, int).

        Parameters will be set according with the correspondence defined in JavaTOSqlDataConverter#setParameters(PreparedStatement, int[], Object[])

        導入されたバージョン:
        1.0