public class D6Crud extends Object
Constructor and Description |
---|
D6Crud(DBConnInfo connInfo)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
execDelete(Class<? extends D6Model> modelObj)
Delete the appropriate line in the specified model object
|
boolean |
execDelete(D6Model modelObj)
Delete the appropriate lines in the specified model object
|
boolean |
execDelete(D6Model[] modelObjs)
Delete the appropriate lines in specified model objects
|
boolean |
execInsert(D6Model[] modelObjects)
Insert the specified model object into the DB
|
boolean |
execInsert(D6Model[] modelObjects,
D6Inex includeExcludeColumnNames)
Insert the specified model object into the DB
|
int |
execSelectCount(Class<? extends D6Model> modelClazz)
Returns the total number of the lines of rows corresponding to the
specified model class
|
int |
execSelectCount(Class<? extends D6Model> modelClazz,
WhereCondition whereCondition)
Returns the total number of the lines of rows corresponding to the
specified model class
|
int |
execSelectCount(Class<? extends D6Model> modelClazz,
WhereCondition whereCondition,
Object[] searchKeys)
Returns the total number of the lines of rows corresponding to the
specified model class
|
int |
execSelectCount(String preparedSql)
Execute the SQL for number search
ex.SELECT COUNT(*) FROM table; |
int |
execSelectCount(String preparedSql,
Object[] searchKeys)
Execute the SQL for number search
|
Object[] |
execSelectTable(Class<? extends D6Model> modelClazz)
Execute select statement and returns the all lines of rows corresponding
to the specified model class as array of Objects
|
Object[] |
execSelectTable(Class<? extends D6Model> modelClazz,
WhereCondition whereCondition) |
Object[] |
execSelectTable(Class<? extends D6Model> modelClazz,
WhereCondition whereCondition,
Object[] searchKeys) |
Object[] |
execSelectTable(String preparedSql,
Class<? extends D6Model> modelClazz)
Execute select statement for the single table.
|
Object[] |
execSelectTable(String preparedSql,
Object[] searchKeys,
Class<? extends D6Model> modelClazz)
Execute select statement for the single table.
|
Map<Class<?>,List<Object>> |
execSelectTableWithJoin(String preparedSql,
Class<? extends D6Model>... modelClazz)
Execute select statement for the joined multiple table.
#execSelectTableWithJoin(String, String[], Class...) |
Map<Class<?>,List<Object>> |
execSelectTableWithJoin(String preparedSql,
Object[] searchKeys,
Class<? extends D6Model>... modelClazz)
Execute select statement for the joined multiple table.
-About SQL You can use prepared SQL. In addition,you can also use non-wildcard ('?') SQL (=raw SQL).In this case searchKeys must be null or empty array(size 0 array). When you use a wildcard('?'), you must not include the "'"(=>single quotes) to preparedSQL. -About processing Used when you execute the SQL that is JOIN multiple tables. In this method, you can specify more than one model class. When the column name specified in the annotation of the model classes is included in the resultSet, a value corresponding to the column name is set to the corresponding field of model objects. In other words, if multiple model class has the same column name, values in the resultSet is set in the same manner for each mode class. |
boolean |
execUpdate(D6Model modelObj)
Update Model Object
|
boolean |
execUpdate(D6Model modelObj,
D6Inex includeExcludeColumnNames)
Update Model Object
|
boolean |
execUpdateByRawSQL(String updateRawSQL)
Execute raw SQL for update
|
Object[] |
getAsModel(Map<Class<?>,List<Object>> o,
Class<? extends D6Model> modelClazz)
convert result into ModelObject from the result of execSelectWithJoin
|
public D6Crud(DBConnInfo connInfo)
connInfo
- public boolean execDelete(Class<? extends D6Model> modelObj)
modelObj
- public boolean execDelete(D6Model modelObj)
modelObj
- public boolean execDelete(D6Model[] modelObjs)
modelObjs
- public boolean execUpdate(D6Model modelObj)
modelObj
- public boolean execUpdate(D6Model modelObj, D6Inex includeExcludeColumnNames)
modelObj
- includeExcludeColumnNames
- public boolean execUpdateByRawSQL(String updateRawSQL)
modelObj
- includeExcludeColumnNames
- public boolean execInsert(D6Model[] modelObjects)
modelObjects
- public boolean execInsert(D6Model[] modelObjects, D6Inex includeExcludeColumnNames)
modelObjects
- includeExcludeColumnNames
- You can select either 'the column name you want to reflected
in the database' AND 'the column name you don't want to
reflect in the database'. When omitted (null specified)
,reflects all properties in the model class has to be
reflected to the database.public int execSelectCount(Class<? extends D6Model> modelClazz)
modelClazz
- public int execSelectCount(Class<? extends D6Model> modelClazz, WhereCondition whereCondition)
modelClazz
- whereCondition
- public int execSelectCount(Class<? extends D6Model> modelClazz, WhereCondition whereCondition, Object[] searchKeys)
modelClazz
- whereCondition
- public int execSelectCount(String preparedSql)
preparedSql
- searchKeys
- public int execSelectCount(String preparedSql, Object[] searchKeys)
preparedSql
- searchKeys
- public Object[] execSelectTable(Class<? extends D6Model> modelClazz)
modelClazz
- public Object[] execSelectTable(Class<? extends D6Model> modelClazz, WhereCondition whereCondition)
public Object[] execSelectTable(Class<? extends D6Model> modelClazz, WhereCondition whereCondition, Object[] searchKeys)
public Object[] execSelectTable(String preparedSql, Class<? extends D6Model> modelClazz)
preparedSql
- modelClazz
- public Object[] execSelectTable(String preparedSql, Object[] searchKeys, Class<? extends D6Model> modelClazz)
preparedSql
- searchKeys
- modelClazz
- public Map<Class<?>,List<Object>> execSelectTableWithJoin(String preparedSql, Class<? extends D6Model>... modelClazz)
#execSelectTableWithJoin(String, String[], Class...)
preparedSql
- modelClazz
- public Map<Class<?>,List<Object>> execSelectTableWithJoin(String preparedSql, Object[] searchKeys, Class<? extends D6Model>... modelClazz)
preparedSql
- searchKeys
- If the prepared SQL includes a wild card (?), Here is list of
the string to be substituted for wild card.
The order of value to be included in the array must be the
same as order of appearance of the wild card.modelClazz
- More than one model class in a comma-separated manner for
mapping the resultsCopyright © 2015. All rights reserved.