パッケージ org.nkjmlab.sorm4j
インタフェース OrmReader
- 既知のサブインタフェースのリスト:
Orm,OrmConnection,OrmTransaction,Sorm
public interface OrmReader
The interface of reading functions of object-relation mapping.
- 作成者:
- nkjm
-
メソッドの概要
修飾子とタイプメソッド説明<T> booleanexists(T object) Returns the object which has same primary key exists or not.<T> ResultSetTraverser<List<T>>getResultSetTraverser(Class<T> objectClass) Gets function which traverses and maps the all the rows in the given resultSet to an object list.<T> RowMapper<T>getRowMapper(Class<T> objectClass) Gets a function which maps one row in the resultSet to an object.<T> List<T>Reads all rows from the table indicated by object class.<T> TreadByPrimaryKey(Class<T> objectClass, Object... primaryKeyValues) Reads an object by its primary keys from the table indicated by object class.<T> TReads an object from the database.<T> TreadFirst(Class<T> objectClass, ParameterizedSql sql) Reads an object from the database.<T> List<T>Reads a list of objects from the database by mapping the results of the parameterized SQL query into instances of the given object class.<T> List<T>readList(Class<T> objectClass, 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.<T> TReads only one object from the database.<T> TreadOne(Class<T> objectClass, ParameterizedSql sql) Reads only one object from the database.Reads results as List ofTuple3for reading JOIN SQL results typically.readTupleList(Class<T1> t1, Class<T2> t2, Class<T3> t3, ParameterizedSql sql) Reads results as List ofTuple3for reading JOIN SQL results typically.readTupleList(Class<T1> t1, Class<T2> t2, String sql, Object... parameters) Reads results as List ofTuple2for reading JOIN SQL results typically.readTupleList(Class<T1> t1, Class<T2> t2, ParameterizedSql sql) Reads results as List ofTuple2for reading JOIN SQL results typically.
-
メソッドの詳細
-
readAll
Reads all rows from the table indicated by object class.- 型パラメータ:
T-- パラメータ:
objectClass-- 戻り値:
-
readByPrimaryKey
Reads an object by its primary keys from the table indicated by object class.- 型パラメータ:
T-- パラメータ:
objectClass-primaryKeyValues-- 戻り値:
-
readFirst
Reads an object from the database.- 型パラメータ:
T-- パラメータ:
objectClass-sql-- 戻り値:
-
readFirst
Reads an object from the database.- 型パラメータ:
T-- パラメータ:
objectClass-sql- with ordered parameter. The other type parameters (e.g. named parameter, list parameter) could not be used.parameters- are ordered parameter.- 戻り値:
-
readList
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.- 型パラメータ:
T-- パラメータ:
objectClass-sql-- 戻り値:
-
readList
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[]) -
readOne
Reads only one object from the database.- 型パラメータ:
T-- パラメータ:
objectClass-sql-- 戻り値:
-
readOne
Reads only one object from the database.- 型パラメータ:
T-- パラメータ:
objectClass-sql- with ordered parameter. The other type parameters (e.g. named parameter, list parameter) could not be used.parameters- are ordered parameter.- 戻り値:
-
readTupleList
<T1,T2, List<Tuple3<T1,T3> T2, readTupleListT3>> (Class<T1> t1, Class<T2> t2, Class<T3> t3, ParameterizedSql sql) Reads results as List ofTuple3for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-T3-- パラメータ:
t1-t2-t3-sql-- 戻り値:
-
readTupleList
<T1,T2, List<Tuple3<T1,T3> T2, readTupleListT3>> (Class<T1> t1, Class<T2> t2, Class<T3> t3, String sql, Object... parameters) Reads results as List ofTuple3for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-- パラメータ:
t1-t2-sql-parameters-- 戻り値:
-
readTupleList
Reads results as List ofTuple2for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-- パラメータ:
t1-t2-sql-- 戻り値:
-
readTupleList
<T1,T2> List<Tuple2<T1,T2>> readTupleList(Class<T1> t1, Class<T2> t2, String sql, Object... parameters) Reads results as List ofTuple2for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-- パラメータ:
t1-t2-sql-parameters-- 戻り値:
-
getRowMapper
Gets a function which maps one row in the resultSet to an object. The method does not callResultSet.next().- 型パラメータ:
T-- パラメータ:
objectClass-- 戻り値:
-
getResultSetTraverser
Gets function which traverses and maps the all the rows in the given resultSet to an object list.- 型パラメータ:
T-- パラメータ:
objectClass-- 戻り値:
-
exists
<T> boolean exists(T object) Returns the object which has same primary key exists or not.- パラメータ:
object-- 戻り値:
-