
public abstract class AbstractDbDataDao<E> extends AbstractDbData
AbstractDbData.UpdatedInfo| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_MODEL |
protected E |
pojo |
allFields, dbSession, isSaved, otherFields, primaryKey| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDbDataDao()
Abstract constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
asJson() |
abstract void |
changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
Change UpdatedInfo status
|
void |
delete()
Delete object from table
|
boolean |
exist()
Test the existence of the current object
|
protected abstract AbstractDAO<E> |
getDao() |
protected String |
getInsertAllValues()
|
com.fasterxml.jackson.databind.node.ObjectNode |
getJson()
Create the equivalent object in Json (no database access)
|
protected abstract String |
getPrimaryField() |
protected abstract String |
getPrimaryKey() |
protected String |
getSelectAllFields()
|
protected abstract String |
getTable() |
protected String |
getUpdateAllFields()
|
protected void |
getValues(DbPreparedStatement preparedStatement,
DbValue[] values)
|
protected String |
getWherePrimaryKey()
|
protected void |
initObject()
To setup primaryKey, otherFields, allFields.
|
void |
insert()
Insert object into table
|
void |
select()
Select object from table
|
protected void |
setFromArray()
|
void |
setFromJson(com.fasterxml.jackson.databind.node.ObjectNode node,
boolean ignorePrimaryKey)
Set the values from the Json node to the current object (no database
access)
|
protected abstract void |
setFromJson(String field,
com.fasterxml.jackson.databind.JsonNode value) |
protected void |
setPrimaryKey()
|
protected void |
setToArray()
|
String |
toJson() |
void |
update()
Update object to table
|
get, getAllFields, getTrueValue, getValue, setTrueValue, setValue, setValuespublic static final String JSON_MODEL
protected E pojo
protected abstract String getTable()
getTable in class AbstractDbDataprotected abstract AbstractDAO<E> getDao() throws DAOConnectionException
DAOConnectionExceptionprotected abstract String getPrimaryKey()
protected abstract String getPrimaryField()
public abstract void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
changeUpdatedInfo in class AbstractDbDatainfo - public boolean exist()
throws WaarpDatabaseException
exist in class AbstractDbDataWaarpDatabaseExceptionpublic void select()
throws WaarpDatabaseException
select in class AbstractDbDataWaarpDatabaseExceptionpublic void insert()
throws WaarpDatabaseException
insert in class AbstractDbDataWaarpDatabaseExceptionpublic void update()
throws WaarpDatabaseException
update in class AbstractDbDataWaarpDatabaseExceptionpublic void delete()
throws WaarpDatabaseException
delete in class AbstractDbDataWaarpDatabaseExceptionpublic String asJson()
asJson in class AbstractDbDatapublic String toJson()
public com.fasterxml.jackson.databind.node.ObjectNode getJson()
getJson in class AbstractDbDataprotected abstract void setFromJson(String field, com.fasterxml.jackson.databind.JsonNode value)
public void setFromJson(com.fasterxml.jackson.databind.node.ObjectNode node,
boolean ignorePrimaryKey)
throws WaarpDatabaseSqlException
setFromJson in class AbstractDbDatanode - ignorePrimaryKey - True will ignore primaryKey from JsonWaarpDatabaseSqlExceptionprotected void initObject()
AbstractDbDatainitObject in class AbstractDbDataprotected String getWherePrimaryKey()
getWherePrimaryKey in class AbstractDbDataprotected void setPrimaryKey()
setPrimaryKey in class AbstractDbDataprotected String getSelectAllFields()
getSelectAllFields in class AbstractDbDataprotected String getInsertAllValues()
getInsertAllValues in class AbstractDbDataprotected String getUpdateAllFields()
getUpdateAllFields in class AbstractDbDataprotected void setToArray()
setToArray in class AbstractDbDataprotected void setFromArray()
throws WaarpDatabaseSqlException
setFromArray in class AbstractDbDataWaarpDatabaseSqlExceptionprotected void getValues(DbPreparedStatement preparedStatement, DbValue[] values) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
getValues in class AbstractDbDataWaarpDatabaseNoConnectionExceptionWaarpDatabaseSqlExceptionCopyright © 2009–2020 Waarp. All rights reserved.