Class AbstractEntityAttrDao<E extends Id>
java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.common.dao.AbstarctDaoConstant
ru.bitel.common.dao.AbstractDao<B>
ru.bitel.common.dao.AbstractIdDao<E>
ru.bitel.oss.kernel.entity.server.bean.AbstractEntityAttrDao<E>
- Type Parameters:
E-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
AbstractEntityDao,ContractDao,ContractObjectDao
public abstract class AbstractEntityAttrDao<E extends Id>
extends ru.bitel.common.dao.AbstractIdDao<E>
Абстрактный класс для параметров/атрибутов/параметров объектов
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classNested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao
ru.bitel.common.dao.AbstractDao.ResultSetIterator -
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.common.dao.AbstractDao
cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, moduleId, orderByPattern, tableNameFields inherited from class ru.bitel.common.dao.AbstarctDaoConstant
ERROR, fields, SQL_ALL, SQL_AND, SQL_CALC_FOUND_ROWS, 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 -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEntityAttrDao(Connection con, int moduleId, int userId, String tableName) AbstractEntityAttrDao(Connection con, int moduleId, int userId, String tableName, String entityTableSuffix, EntityAttrDaoSupport support) -
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.common.dao.AbstractIdDao
delete, executeUpdate, get, getAndDelete, getAndUpdate, optMethods inherited from class ru.bitel.common.dao.AbstractDao
close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, recycle, setStatementParam, update, updateImplMethods inherited from class ru.bitel.common.dao.AbstarctDaoConstant
getSQLOrderMethods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
getLogger, logError
-
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, int moduleId, int userId, String tableName, String entityTableSuffix, EntityAttrDaoSupport support) -
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 ru.bitel.bgbilling.common.BGException Получение атрибутов/параметров объекта/договора с учетом указанной сущности/группы параметров. Если такой сущности/группы параметров не существует, то будет возвращан null.- Parameters:
entitySpecId-entityId-fullMap- при fullMap==true если параметр не заведен (не указан, не добавлен), то данный параметр будет отсутствовать в результате. Примером может служить параметр типа флаг - отсутствие параметра означает false. При fullMap==true при отсутсвии значения в результат попадет пустой EntityAttr.- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getEntityAttributes
protected Map<Integer,EntityAttr> getEntityAttributes(int entityId, Set<Integer> entitySpecAttrIds) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
getAllEntityAttributes
protected Map<Integer,EntityAttr> getAllEntityAttributes(int entityId, boolean fullMap) throws ru.bitel.bgbilling.common.BGException Получение всех возможных атрибутов/параметров без учета сущности/группы параметров.- Parameters:
entityId- ID объекта/договора.fullMap- при fullMap==true если параметр не заведен (не указан, не добавлен), то данный параметр будет отсутствовать в результате. Примером может служить параметр типа флаг - отсутствие параметра означает false. При fullMap==true при отсутсвии значения в результат попадет пустой EntityAttr.- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getEntityValueForIds
protected Map<Integer,String> getEntityValueForIds(int entityId, Set<Integer> ids) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
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
protected boolean updateEntityAttribute(int entityId, EntityAttr entityAttr) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
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 ru.bitel.bgbilling.common.BGException, SQLException- Throws:
ru.bitel.bgbilling.common.BGExceptionSQLException
-
deleteEntityAttributes
protected void deleteEntityAttributes(int entityId) throws ru.bitel.bgbilling.common.BGException, SQLException - Throws:
ru.bitel.bgbilling.common.BGExceptionSQLException
-
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 ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
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 ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
getFromRS
- Specified by:
getFromRSin classru.bitel.common.dao.AbstractDao<E extends Id>- Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
getFromRS
protected abstract E getFromRS(ResultSet rs, boolean loadAttributes) throws SQLException, ru.bitel.bgbilling.common.BGException - Throws:
SQLExceptionru.bitel.bgbilling.common.BGException
-
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
-