Class AbstractEntityAttrDao<E extends Entity>
java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstractDaoConstant
ru.bitel.bgbilling.common.dao.AbstractDao<E>
ru.bitel.bgbilling.common.dao.AbstractIdDao<E>
ru.bitel.oss.kernel.entity.server.bean.AbstractEntityAttrDao<E>
- Type Parameters:
E-
- Direct Known Subclasses:
AbstractEntityDao
public abstract class AbstractEntityAttrDao<E extends Entity>
extends ru.bitel.bgbilling.common.dao.AbstractIdDao<E>
Абстрактный класс для параметров/атрибутов/параметров объектов
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classNested classes/interfaces inherited from class ru.bitel.bgbilling.common.dao.AbstractDao
ru.bitel.bgbilling.common.dao.AbstractDao.ListParams -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final EntityAttrDaoSupportprotected static final EntityAttrDaoSupportprotected static final EntityAttrDaoSupportprotected Directory<? extends AbstractSpecAttr> protected Directory<? extends EntitySpec> protected final Stringprotected static final Comparator<FilterEntityAttr> protected final intFields inherited from class ru.bitel.bgbilling.common.dao.AbstractDao
orderByPatternFields inherited from class ru.bitel.bgbilling.common.dao.AbstractDaoConstant
con, ERROR, fields, moduleId, SQL_ALL, SQL_AND, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_JOIN, SQL_LEFT_JOIN, SQL_LIMIT, SQL_NOT_IN, SQL_ON, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE, tableName -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEntityAttrDao(Connection con, String tableName, int moduleId, int userId) AbstractEntityAttrDao(Connection con, String tableName, String entityTableSuffix, EntityAttrDaoSupport support, int moduleId, int userId) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckEntityAttribute(EntityAttr entityAttr) booleancheckEntitySpecAttrDelete(int entitySpecAttrId) booleandeleteEntityAttribute(int entityId, int entitySpecAttrId) protected voiddeleteEntityAttributes(int entityId) filterInit(List<FilterEntityAttr> entityFilter) voidfilterJoin(StringBuilder query, String wherePrefix, StringBuilder where, List<FilterEntityAttr> entityFilter) intfilterToPS(PreparedStatement ps, int idx, List<FilterEntityAttr> entityFilter) protected Map<Integer, EntityAttr> getAllEntityAttributes(int entityId, boolean fullMap) Получение всех возможных атрибутов/параметров без учета сущности/группы параметров.protected EntityAttrgetAttribute(int entityId, AbstractSpecAttr spec) protected EntityAttrgetEntityAttribute(int entityId, int entityAttrId) Получение значения атрибута/параметраprotected Map<Integer, EntityAttr> getEntityAttributes(int entitySpecId, int entityId, boolean fullMap) Получение атрибутов/параметров объекта/договора с учетом указанной сущности/группы параметров.protected Map<Integer, EntityAttr> getEntityAttributes(int entityId, Set<Integer> entitySpecAttrIds) protected StringgetEntityValueForIds(int entityId, Set<Integer> ids) protected Eprotected abstract Elist(boolean loadAttributes, Page page, String what, String join, List<FilterEntityAttr> entityFilter, String filter, String groupBy, String orderBy, Object... params) listImpl(boolean loadAttributes, Page page, String what, String join1, String join2, List<FilterEntityAttr> entityFilter, String filter, String groupBy, String orderBy, Object... params) protected voidonAddressItemUpdate(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, Class<?> clazz, int id) protected Optional<EntityAttr> optEntityAttribute(int entityId, int entityAttrId) protected booleanupdateEntityAttribute(int entityId, EntityAttr entityAttr) protected voidupdateEntityAttributes(int entityId, Map<Integer, EntityAttr> entityAttributes) Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractIdDao
delete, executeUpdate, get, getAndDelete, getAndUpdate, loadData, opt, prepareStatement, sqlCommand, sqlCommandAndTable, sqlInsertValues, sqlQuery, sqlUpdateSet, sqlWhereIdMethods inherited from class ru.bitel.bgbilling.common.dao.AbstractDao
deleteImpl, dropTemporaryTable, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getQueryWithFilter, getSQLOrder, list, list, list, listCountImplPS, listImpl, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, queryPeriod, setPageRecordCount, update, updateImplMethods inherited from class ru.bitel.bgbilling.common.dao.AbstractDaoConstant
delete, delete, getSQLOrder, getSQLOrderFields, getTableName, psSetDate, psSetDateOrNull, psSetInt, psSetIntOrNull, psSetPeriod, psSetString, psSetStringOrNull, psSetTimestampOrNull, queryAndIn, setStatementParamMethods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
error, error, error, getLogger, logError, logError, warn
-
Field Details
-
ENTITY_SUPPORT
-
CONTRACT_SUPPORT
-
CONTRACT_OBJECT_SUPPORT
-
userId
protected final int userId -
entityTableSuffix
-
entitySpecDirectory
-
entitySpecAttrDirectory
-
filterWeightComparator
-
-
Constructor Details
-
AbstractEntityAttrDao
public AbstractEntityAttrDao(Connection con, String tableName, String entityTableSuffix, EntityAttrDaoSupport support, int moduleId, int userId) -
AbstractEntityAttrDao
-
-
Method Details
-
getEntityTableSuffix
-
getEntitySpecDirectory
public Directory<? extends Id> getEntitySpecDirectory() throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getEntitySpecAttrDirectory
protected Directory<? extends Id> getEntitySpecAttrDirectory() throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getAttribute
protected EntityAttr getAttribute(int entityId, AbstractSpecAttr spec) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
getEntityAttributes
protected Map<Integer,EntityAttr> getEntityAttributes(int entitySpecId, int entityId, boolean fullMap) throws SQLException Получение атрибутов/параметров объекта/договора с учетом указанной сущности/группы параметров. Если такой сущности/группы параметров не существует, то будет возвращан null.- Parameters:
entitySpecId-entityId-fullMap- при fullMap==true если параметр не заведен (не указан, не добавлен), то данный параметр будет отсутствовать в результате. Примером может служить параметр типа флаг - отсутствие параметра означает false. При fullMap==true при отсутсвии значения в результат попадет пустой EntityAttr.- Returns:
- Throws:
ru.bitel.bgbilling.common.BGExceptionSQLException
-
getEntityAttributes
protected Map<Integer,EntityAttr> getEntityAttributes(int entityId, Set<Integer> entitySpecAttrIds) throws Exception - Throws:
Exception
-
getAllEntityAttributes
protected Map<Integer,EntityAttr> getAllEntityAttributes(int entityId, boolean fullMap) throws Exception Получение всех возможных атрибутов/параметров без учета сущности/группы параметров.- Parameters:
entityId- ID объекта/договора.fullMap- при fullMap==true если параметр не заведен (не указан, не добавлен), то данный параметр будет отсутствовать в результате. Примером может служить параметр типа флаг - отсутствие параметра означает false. При fullMap==true при отсутсвии значения в результат попадет пустой EntityAttr.- Returns:
- Throws:
ru.bitel.bgbilling.common.BGExceptionException
-
getEntityValueForIds
- Throws:
Exception
-
getEntityAttribute
protected EntityAttr getEntityAttribute(int entityId, int entityAttrId) throws ru.bitel.bgbilling.common.BGException Получение значения атрибута/параметра- Parameters:
entityId- ID объекта/договораentityAttrId- ID атрибута/параметра- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
optEntityAttribute
protected Optional<EntityAttr> optEntityAttribute(int entityId, int entityAttrId) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
updateEntityAttribute
-
deleteEntityAttribute
public boolean deleteEntityAttribute(int entityId, int entitySpecAttrId) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
checkEntitySpecAttrDelete
public boolean checkEntitySpecAttrDelete(int entitySpecAttrId) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
updateEntityAttributes
protected void updateEntityAttributes(int entityId, Map<Integer, EntityAttr> entityAttributes) throws SQLException- Throws:
SQLException
-
deleteEntityAttributes
- Throws:
SQLException
-
list
protected List<E> list(boolean loadAttributes, Page page, String what, String join, List<FilterEntityAttr> entityFilter, String filter, String groupBy, String orderBy, Object... params) throws SQLException - Throws:
SQLException
-
filterInit
-
getEntityTableName
-
listImpl
protected List<E> listImpl(boolean loadAttributes, Page page, String what, String join1, String join2, List<FilterEntityAttr> entityFilter, String filter, String groupBy, String orderBy, Object... params) throws SQLException - Throws:
SQLException
-
getFromRS
- Specified by:
getFromRSin classru.bitel.bgbilling.common.dao.AbstractDao<E extends Entity>- Throws:
SQLException
-
getFromRS
- Throws:
SQLException
-
filterJoin
public void filterJoin(StringBuilder query, String wherePrefix, StringBuilder where, List<FilterEntityAttr> entityFilter) -
filterToPS
public int filterToPS(PreparedStatement ps, int idx, List<FilterEntityAttr> entityFilter) throws SQLException - Throws:
SQLException
-
onAddressItemUpdate
protected void onAddressItemUpdate(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, Class<?> clazz, int id) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
checkEntityAttribute
protected void checkEntityAttribute(EntityAttr entityAttr) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-