public class CommonDAO
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
con |
protected java.text.DateFormat |
dateFormat_DDMMYYYY |
protected java.text.DateFormat |
dateFormat_DDMMYYYY_HHMM |
protected org.apache.log4j.Logger |
log |
protected static java.lang.String |
SQL_AND |
protected static java.lang.String |
SQL_DELETE |
protected static java.lang.String |
SQL_DESC |
protected static java.lang.String |
SQL_FROM |
protected static java.lang.String |
SQL_GROUP_BY |
protected static java.lang.String |
SQL_INNER_JOIN |
protected static java.lang.String |
SQL_INSERT |
protected static java.lang.String |
SQL_LEFT_JOIN |
protected static java.lang.String |
SQL_LIMIT |
protected static java.lang.String |
SQL_ORDER_BY |
protected static java.lang.String |
SQL_REPLACE |
protected static java.lang.String |
SQL_SELECT |
protected static java.lang.String |
SQL_SELECT_ALL_FROM |
protected static java.lang.String |
SQL_SELECT_COUNT_ROWS |
protected static java.lang.String |
SQL_SET |
protected static java.lang.String |
SQL_UPDATE |
protected static java.lang.String |
SQL_WHERE |
Modifier | Constructor and Description |
---|---|
protected |
CommonDAO(java.sql.Connection con) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
addLikeSql(java.lang.String likePattern,
java.lang.String fieldName)
Deprecated.
|
static java.sql.Date |
convertDateToSqlDate(java.util.Date date) |
protected java.sql.Timestamp |
convertDateToTimestamp(java.util.Date date) |
protected void |
deleteById(java.lang.String tableName,
int id) |
protected int |
getFoundRows(java.sql.PreparedStatement ps) |
protected java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> |
getGroupedIds(java.lang.String tableName,
java.lang.String linkColumn,
java.lang.String selectColumn) |
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> |
getGroupedIds(java.lang.String tableName,
java.lang.String linkColumn,
java.lang.String selectColumn,
java.lang.String posColumn) |
protected java.util.Set<java.lang.Integer> |
getIds(java.lang.String tableName,
java.lang.String linkColumn,
java.lang.String selectColumn,
int id) |
protected java.util.List<java.lang.Integer> |
getIds(java.lang.String tableName,
java.lang.String linkColumn,
java.lang.String selectColumn,
java.lang.String posColumn,
int id) |
static java.lang.String |
getLikePattern(java.lang.String substring,
java.lang.String mode) |
protected java.lang.String |
getMySQLLimit(Page page) |
protected java.lang.String |
getPeriodSql(Period period,
java.lang.String fieldName) |
protected int |
lastInsertId(java.sql.PreparedStatement ps) |
protected int |
setPeriodParamValue(Period period,
java.sql.PreparedStatement ps,
int index) |
protected void |
setRecordCount(Page page,
java.sql.PreparedStatement ps) |
protected void |
sqlToBgException(java.sql.SQLException e) |
void |
updateColumn(java.lang.String tableName,
int id,
java.lang.String columnName,
java.lang.String value) |
protected void |
updateIds(java.lang.String tableName,
java.lang.String linkColumn,
java.lang.String valueColumn,
int id,
java.util.Set<java.lang.Integer> values) |
protected void |
updateIds(java.lang.String tableName,
java.lang.String linkColumn,
java.lang.String valueColumn,
java.lang.String posColumn,
int id,
java.util.List<java.lang.Integer> values) |
protected static final java.lang.String SQL_SELECT
protected static final java.lang.String SQL_SELECT_ALL_FROM
protected static final java.lang.String SQL_SELECT_COUNT_ROWS
protected static final java.lang.String SQL_INSERT
protected static final java.lang.String SQL_SET
protected static final java.lang.String SQL_UPDATE
protected static final java.lang.String SQL_DELETE
protected static final java.lang.String SQL_FROM
protected static final java.lang.String SQL_LEFT_JOIN
protected static final java.lang.String SQL_INNER_JOIN
protected static final java.lang.String SQL_WHERE
protected static final java.lang.String SQL_ORDER_BY
protected static final java.lang.String SQL_GROUP_BY
protected static final java.lang.String SQL_AND
protected static final java.lang.String SQL_LIMIT
protected static final java.lang.String SQL_DESC
protected static final java.lang.String SQL_REPLACE
protected java.text.DateFormat dateFormat_DDMMYYYY
protected java.text.DateFormat dateFormat_DDMMYYYY_HHMM
protected org.apache.log4j.Logger log
protected java.sql.Connection con
protected int lastInsertId(java.sql.PreparedStatement ps) throws java.sql.SQLException
java.sql.SQLException
protected int getFoundRows(java.sql.PreparedStatement ps) throws java.sql.SQLException
java.sql.SQLException
@Deprecated protected java.lang.String addLikeSql(java.lang.String likePattern, java.lang.String fieldName)
CustomerDAO.searchCustomerList(ru.bgcrm.model.SearchResult, String)
.public static final java.lang.String getLikePattern(java.lang.String substring, java.lang.String mode)
protected java.lang.String getMySQLLimit(Page page)
protected void setRecordCount(Page page, java.sql.PreparedStatement ps) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String getPeriodSql(Period period, java.lang.String fieldName)
protected int setPeriodParamValue(Period period, java.sql.PreparedStatement ps, int index) throws java.sql.SQLException
java.sql.SQLException
public static java.sql.Date convertDateToSqlDate(java.util.Date date)
protected java.sql.Timestamp convertDateToTimestamp(java.util.Date date)
protected java.util.Set<java.lang.Integer> getIds(java.lang.String tableName, java.lang.String linkColumn, java.lang.String selectColumn, int id) throws BGException
BGException
protected java.util.List<java.lang.Integer> getIds(java.lang.String tableName, java.lang.String linkColumn, java.lang.String selectColumn, java.lang.String posColumn, int id) throws BGException
BGException
protected java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> getGroupedIds(java.lang.String tableName, java.lang.String linkColumn, java.lang.String selectColumn) throws BGException
BGException
protected java.util.Map<java.lang.Integer,java.util.List<java.lang.Integer>> getGroupedIds(java.lang.String tableName, java.lang.String linkColumn, java.lang.String selectColumn, java.lang.String posColumn) throws BGException
BGException
protected void deleteById(java.lang.String tableName, int id) throws BGException
BGException
protected void updateIds(java.lang.String tableName, java.lang.String linkColumn, java.lang.String valueColumn, int id, java.util.Set<java.lang.Integer> values) throws BGException
BGException
protected void updateIds(java.lang.String tableName, java.lang.String linkColumn, java.lang.String valueColumn, java.lang.String posColumn, int id, java.util.List<java.lang.Integer> values) throws BGException
BGException
public void updateColumn(java.lang.String tableName, int id, java.lang.String columnName, java.lang.String value) throws BGException
BGException
protected void sqlToBgException(java.sql.SQLException e) throws BGMessageException, BGException
BGMessageException
BGException