- 既知のサブインタフェースのリスト:
OrmConnection,OrmTransaction,Sorm
- 作成者:
- nkjm
-
メソッドの概要
修飾子とタイプメソッド説明<T> int[]Deletes objects from the table corresponding to the class of the given objects.<T> intdelete(T object) Deletes an object from the table corresponding to the class of the given objects.<T> int[]delete(T... objects) Deletes objects.<T> intDeletes all objects in the table corresponding to the given class.intdeleteAllIn(String tableName) Deletes all objects in the table corresponding to the given table name.<T> intdeleteByPrimaryKey(Class<T> type, Object... primaryKeyValues) Deletes a row from the table corresponding to the class the by primary key.<T> intdeleteByPrimaryKeyIn(String tableName, Object... primaryKeyValues) Deletes a row from the table corresponding to the table name the by primary key.<T> int[]Deletes objects in the table of the given table name.<T> intDeletes object in the table of the given table name.<T> int[]Deletes objects in the table of the given table name.booleanbooleanexecute(ParameterizedSql sql) <T> TexecuteQuery(FunctionHandler<Connection, PreparedStatement> statementSupplier, ResultSetTraverser<T> traverser) Executes the query with the given PreparedStatement and applies the givenResultSetTraverser.<T> List<T>executeQuery(FunctionHandler<Connection, PreparedStatement> statementSupplier, RowMapper<T> rowMapper) Executes the query with the given PreparedStatement and applies the givenRowMapper.<T> TexecuteQuery(ParameterizedSql sql, ResultSetTraverser<T> traverser) Executes a query and apply the givenResultSetTraverserto the returned result set.<T> List<T>executeQuery(ParameterizedSql sql, RowMapper<T> mapper) Executes a query and apply the givenRowMapperto the each row in returned result set.intexecuteUpdate(String sql, Object... parameters) Executes an update and returns the number of rows modified.int<T> boolean<T> boolean<T> booleanReturns the object which has same primary key exists or not.<T> booleanexists(T object) Returns the object which has same primary key exists or not.Gets the context of this object.Gets JDBCConnection.Gets JDBC database metadata.getJdbcTableMetaData(String tableName) Gets JDBC table metadata.<T> ResultSetTraverser<List<T>>getResultSetTraverser(Class<T> type) Gets function which traverses and maps the all the rows in the given resultSet to an object list.<T> RowMapper<T>getRowMapper(Class<T> type) Gets a function which maps one row in the resultSet to an object.getTableMetaData(Class<?> type) Gets table metadata corresponding to the given object class.getTableName(Class<?> type) Gets table name corresponding to the given object class.getTableSql(Class<?> type) Gets table metadata corresponding to the given object class.getTableSql(String tableName) Gets table SQL to the given table name.<T> int[]Inserts objects in the table corresponding to the class of the given objects.<T> intinsert(T object) Inserts object in the table corresponding to the class of the given object.<T> int[]insert(T... objects) Insert objects in the table corresponding to the class of the given objects.<T> InsertResultinsertAndGet(List<T> objects) Inserts objects and get the last insert result.<T> InsertResultinsertAndGet(T object) Inserts an object and get the result.<T> InsertResultinsertAndGet(T... objects) Inserts objects and get the last insert result.<T> InsertResultinsertAndGetIn(String tableName, List<T> objects) Inserts objects and get the last insert result.<T> InsertResultinsertAndGetIn(String tableName, T object) Inserts an object and get the insert result.<T> InsertResultinsertAndGetIn(String tableName, T... objects) Inserts objects and get the last insert result.<T> int[]Inserts objects and get the last insert result.<T> intInserts an object and get the insert result.<T> int[]Inserts objects and get the last insert result.int[]insertMapIn(String tableName, List<RowMap> result) This method is experimental.intinsertMapIn(String tableName, RowMap object) int[]insertMapIn(String tableName, RowMap... objects) This method is experimental.<T1,T2, T3> List<Tuple.Tuple3<T1, T2, T3>> <T1,T2> List<Tuple.Tuple2<T1, T2>> <T1,T2, T3> List<Tuple.Tuple3<T1, T2, T3>> <T1,T2> List<Tuple.Tuple2<T1, T2>> <T1,T2> List<Tuple.Tuple2<T1, T2>> <T1,T2, T3> List<Tuple.Tuple3<T1, T2, T3>> leftJoinOn(Class<T1> t1, Class<T2> t2, Class<T3> t3, String t1T2OnCondition, String t2T3OnCondition) <T1,T2> List<Tuple.Tuple2<T1, T2>> leftJoinOn(Class<T1> t1, Class<T2> t2, String onCondition) <T> int[]Merges by objects in the table corresponding to the class of the given objects.<T> intmerge(T object) Merges by an object in the table corresponding to the class of the given object.<T> int[]merge(T... objects) Merges by objects in the table corresponding to the class of the given objects.<T> int[]Merges by objects in the table corresponding to the given table name.<T> intMerges by an object in the table corresponding to the given table name.<T> int[]Merges by objects in the table corresponding to the given table name.<T> TReads an object from the database.<T> TreadFirst(Class<T> type, 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> type, 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> type, ParameterizedSql sql) Reads only one object from the database.<T1,T2, T3> List<Tuple.Tuple3<T1, T2, T3>> Reads results as List ofTuple.Tuple3for reading JOIN SQL results typically.<T1,T2, T3> List<Tuple.Tuple3<T1, T2, T3>> readTupleList(Class<T1> t1, Class<T2> t2, Class<T3> t3, ParameterizedSql sql) Reads results as List ofTuple.Tuple3for reading JOIN SQL results typically.<T1,T2> List<Tuple.Tuple2<T1, T2>> readTupleList(Class<T1> t1, Class<T2> t2, String sql, Object... parameters) Reads results as List ofTuple.Tuple2for reading JOIN SQL results typically.<T1,T2> List<Tuple.Tuple2<T1, T2>> readTupleList(Class<T1> t1, Class<T2> t2, ParameterizedSql sql) Reads results as List ofTuple.Tuple2for reading JOIN SQL results typically.<T> List<T>Reads all rows from the table indicated by object class.<T> TselectByPrimaryKey(Class<T> type, Object... primaryKeyValues) Reads an object by its primary keys from the table indicated by object class.<T> ResultSetStream<T>Returns anResultSetStream.<T> ResultSetStream<T>stream(Class<T> type, ParameterizedSql sql) Returns anResultSetStream.<T> ResultSetStream<T>ReturnsResultSetStreamrepresents all rows from the table indicated by object class.<T> int[]Updates by objects in the table corresponding to the class of the given objects.<T> intupdate(T object) Updates by an object in the table corresponding to the class of the given object.<T> int[]update(T... objects) Updates by objects in the table corresponding to the class of the given objects.<T> intupdateByPrimaryKey(Class<T> clazz, RowMap object, Object... primaryKeyValues) intupdateByPrimaryKeyIn(String tableName, RowMap object, Object... primaryKeyValues) <T> int[]Updates by objects in the table corresponding to the given table name.<T> intUpdates by an object in the table corresponding to the given table name.<T> int[]Updates by objects in the table corresponding to the given table name.
-
メソッドの詳細
-
getContext
SormContext getContext()Gets the context of this object.- 戻り値:
-
getJdbcConnection
Connection getJdbcConnection()Gets JDBCConnection.- 戻り値:
-
delete
Deletes objects from the table corresponding to the class of the given objects.- 型パラメータ:
T- the object's element type which is mapped to the unique table.- パラメータ:
objects- the objects to delete to- 戻り値:
- the number of affected rows
-
delete
<T> int delete(T object) Deletes an object from the table corresponding to the class of the given objects.- 型パラメータ:
T- the object's type which is mapped to the unique table.- パラメータ:
object- the object to delete to- 戻り値:
- the number of affected rows
-
delete
<T> int[] delete(T... objects) Deletes objects.- 型パラメータ:
T- the object's element type which is mapped to the unique table.- パラメータ:
objects-- 戻り値:
-
deleteAll
Deletes all objects in the table corresponding to the given class.- 型パラメータ:
T- the type to indicate the unique table.- パラメータ:
type- the type to indicate the unique table.- 戻り値:
-
deleteAllIn
Deletes all objects in the table corresponding to the given table name.- パラメータ:
tableName-- 戻り値:
-
deleteByPrimaryKey
Deletes a row from the table corresponding to the class the by primary key.- 型パラメータ:
T-- パラメータ:
primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
deleteByPrimaryKeyIn
Deletes a row from the table corresponding to the table name the by primary key.- 型パラメータ:
T-- パラメータ:
tableName-primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
deleteIn
Deletes objects in the table of the given table name.- 型パラメータ:
T- the object's element type.- パラメータ:
tableName-objects-- 戻り値:
-
deleteIn
Deletes object in the table of the given table name.- 型パラメータ:
T- the object's type.- パラメータ:
tableName-object-- 戻り値:
-
deleteIn
Deletes objects in the table of the given table name.- 型パラメータ:
T- the object's element type.- パラメータ:
tableName-objects-- 戻り値:
-
execute
-
execute
-
executeQuery
<T> T executeQuery(FunctionHandler<Connection, PreparedStatement> statementSupplier, ResultSetTraverser<T> traverser) Executes the query with the given PreparedStatement and applies the givenResultSetTraverser. If you want to set parameters to a PreparedStatement object by yourself, you can use this method. You can use yourResultSetTraverseror the object getting bygetResultSetTraverser(Class);- 型パラメータ:
T-- パラメータ:
statementSupplier- initialize and supplies PreparedStatementtraverser-- 戻り値:
-
executeQuery
<T> List<T> executeQuery(FunctionHandler<Connection, PreparedStatement> statementSupplier, RowMapper<T> rowMapper) Executes the query with the given PreparedStatement and applies the givenRowMapper. If you want to set parameters to a PreparedStatement object by yourself, you can use this method. You can use yourRowMapperor the object getting bygetRowMapper(Class);- 型パラメータ:
T-- パラメータ:
statementSupplier-rowMapper-- 戻り値:
-
executeQuery
Executes a query and apply the givenResultSetTraverserto the returned result set.This method wraps
Statement.executeQuery(String)Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(PreparedStatement, Object...)- 型パラメータ:
T-- パラメータ:
sql- SQL code to be executed.traverser-- 戻り値:
-
executeQuery
Executes a query and apply the givenRowMapperto the each row in returned result set.- 型パラメータ:
T-- パラメータ:
sql-mapper-- 戻り値:
-
executeUpdate
- パラメータ:
sql-- 戻り値:
-
executeUpdate
Executes an update and returns the number of rows modified.This method wraps
Statement.executeUpdate(String)Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(PreparedStatement, Object...)- パラメータ:
sql- SQL code to be executed.parameters- Parameters to be used in the PreparedStatement.
-
exists
Returns the object which has same primary key exists or not.- 型パラメータ:
T- the object's type.- パラメータ:
tableName-object-- 戻り値:
-
exists
<T> boolean exists(T object) Returns the object which has same primary key exists or not.- 型パラメータ:
T- the object's type which is mapped to the unique table.- パラメータ:
object-- 戻り値:
-
exists
- 型パラメータ:
T-- パラメータ:
tableName-primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
exists
- 型パラメータ:
T-- パラメータ:
type-primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
getResultSetTraverser
Gets function which traverses and maps the all the rows in the given resultSet to an object list.- 型パラメータ:
T- the read object's type.- パラメータ:
type-- 戻り値:
-
getRowMapper
Gets a function which maps one row in the resultSet to an object. The method does not callResultSet.next().- 型パラメータ:
T-- パラメータ:
type-- 戻り値:
-
getTableMetaData
Gets table metadata corresponding to the given object class.- パラメータ:
type-- 戻り値:
-
getJdbcTableMetaData
Gets JDBC table metadata.- パラメータ:
tableName-- 戻り値:
-
getTableSql
Gets table metadata corresponding to the given object class.- パラメータ:
type-- 戻り値:
-
getTableSql
Gets table SQL to the given table name.- パラメータ:
tableName-- 戻り値:
-
getJdbcDatabaseMetaData
JdbcDatabaseMetaData getJdbcDatabaseMetaData()Gets JDBC database metadata.- 戻り値:
-
getTableName
Gets table name corresponding to the given object class.- パラメータ:
type-- 戻り値:
-
insert
Inserts objects in the table corresponding to the class of the given objects.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
-
insert
<T> int insert(T object) Inserts object in the table corresponding to the class of the given object.- 型パラメータ:
T-- パラメータ:
object-- 戻り値:
-
insert
<T> int[] insert(T... objects) Insert objects in the table corresponding to the class of the given objects.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
-
insertAndGet
Inserts objects and get the last insert result.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
-
insertAndGet
Inserts an object and get the result.- 型パラメータ:
T-- パラメータ:
object-- 戻り値:
-
insertAndGet
Inserts objects and get the last insert result.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
-
insertAndGetIn
Inserts objects and get the last insert result.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
insertAndGetIn
Inserts an object and get the insert result.- 型パラメータ:
T-- パラメータ:
tableName-object-- 戻り値:
-
insertAndGetIn
Inserts objects and get the last insert result.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
insertMapIn
This method is experimental.- パラメータ:
tableName-result-- 戻り値:
-
insertMapIn
- パラメータ:
tableName-object-- 戻り値:
-
insertMapIn
This method is experimental.- パラメータ:
tableName-objects-- 戻り値:
-
insertIn
Inserts objects and get the last insert result.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
insertIn
Inserts an object and get the insert result.- 型パラメータ:
T-- パラメータ:
tableName-object-- 戻り値:
-
insertIn
Inserts objects and get the last insert result.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
join
-
join
-
joinOn
-
joinUsing
-
joinOn
-
leftJoinOn
-
leftJoinOn
-
merge
Merges by objects in the table corresponding to the class of the given objects.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
- 関連項目:
-
merge
<T> int merge(T object) Merges by an object in the table corresponding to the class of the given object.Merge methods execute a SQL sentence as MERGE INTO of the H2 grammar. This operation may be not working the other database system. See, MERGE INTO - Commands
- 型パラメータ:
T-- パラメータ:
object-- 戻り値:
-
merge
<T> int[] merge(T... objects) Merges by objects in the table corresponding to the class of the given objects.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
- 関連項目:
-
mergeIn
Merges by objects in the table corresponding to the given table name.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
mergeIn
Merges by an object in the table corresponding to the given table name.- 型パラメータ:
T-- パラメータ:
tableName-object-- 戻り値:
-
mergeIn
Merges by objects in the table corresponding to the given table name.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
readFirst
Reads an object from the database.- 型パラメータ:
T-- パラメータ:
type-sql-- 戻り値:
-
readFirst
Reads an object from the database.- 型パラメータ:
T-- パラメータ:
type-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. Example:ParameterizedSql sql = ParameterizedSql.from("select * from customer"); sorm.readList(Customer.class, sql);- 型パラメータ:
T-- パラメータ:
type-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(PreparedStatement, Object[]) -
readOne
Reads only one object from the database.- 型パラメータ:
T- the type to map the result set rows to- パラメータ:
type- the type to map the result set rows tosql-- 戻り値:
-
readOne
Reads only one object from the database.- 型パラメータ:
T- the type to map the result set rows to- パラメータ:
type- the type to map the result set rows tosql- 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<Tuple.Tuple3<T1,T3> T2, readTupleListT3>> (Class<T1> t1, Class<T2> t2, Class<T3> t3, ParameterizedSql sql) Reads results as List ofTuple.Tuple3for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-T3-- パラメータ:
t1-t2-t3-sql-- 戻り値:
-
readTupleList
<T1,T2, List<Tuple.Tuple3<T1,T3> T2, readTupleListT3>> (Class<T1> t1, Class<T2> t2, Class<T3> t3, String sql, Object... parameters) Reads results as List ofTuple.Tuple3for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-- パラメータ:
t1-t2-sql-parameters-- 戻り値:
-
readTupleList
Reads results as List ofTuple.Tuple2for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-- パラメータ:
t1-t2-sql-- 戻り値:
-
readTupleList
<T1,T2> List<Tuple.Tuple2<T1,T2>> readTupleList(Class<T1> t1, Class<T2> t2, String sql, Object... parameters) Reads results as List ofTuple.Tuple2for reading JOIN SQL results typically.- 型パラメータ:
T1-T2-- パラメータ:
t1-t2-sql-parameters-- 戻り値:
-
selectAll
Reads all rows from the table indicated by object class.- 型パラメータ:
T-- パラメータ:
type-- 戻り値:
-
selectByPrimaryKey
Reads an object by its primary keys from the table indicated by object class.- 型パラメータ:
T-- パラメータ:
type-primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
update
Updates by objects in the table corresponding to the class of the given objects.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
-
update
<T> int update(T object) Updates by an object in the table corresponding to the class of the given object.- 型パラメータ:
T-- パラメータ:
object-- 戻り値:
-
update
<T> int[] update(T... objects) Updates by objects in the table corresponding to the class of the given objects.- 型パラメータ:
T-- パラメータ:
objects-- 戻り値:
-
updateByPrimaryKey
- 型パラメータ:
T-- パラメータ:
clazz-object-primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
updateByPrimaryKeyIn
- パラメータ:
tableName-object-primaryKeyValues- the order should be the same as the column order.- 戻り値:
-
updateIn
Updates by objects in the table corresponding to the given table name.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
updateIn
Updates by an object in the table corresponding to the given table name.- 型パラメータ:
T-- パラメータ:
tableName-object-- 戻り値:
-
updateIn
Updates by objects in the table corresponding to the given table name.- 型パラメータ:
T-- パラメータ:
tableName-objects-- 戻り値:
-
streamAll
ReturnsResultSetStreamrepresents all rows from the table indicated by object class.- 型パラメータ:
T-- パラメータ:
type-- 戻り値:
-
stream
Returns anResultSetStream. It is able to convert to Stream, List, and so on. *- 型パラメータ:
T-- パラメータ:
type-sql-- 戻り値:
-
stream
Returns anResultSetStream. It is able to convert to Stream, List, and so on.Parameters will be set according with the correspondence defined in
SqlParametersSetter.setParameters(PreparedStatement,Object[])*- 型パラメータ:
T-- パラメータ:
type-sql-parameters-- 戻り値:
-