Class AbstractEntityAttrDao<E extends Id>
java.lang.Object
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:
java.lang.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 Classes Modifier and Type Class Description protected static classAbstractEntityAttrDao.AddressItemModifiedEventListenerNested classes/interfaces inherited from class ru.bitel.common.dao.AbstractDao
ru.bitel.common.dao.AbstractDao.ResultSetIterator -
Field Summary
Fields Modifier and Type Field Description protected static EntityAttrDaoSupportCONTRACT_OBJECT_SUPPORTprotected static EntityAttrDaoSupportCONTRACT_SUPPORTprotected static EntityAttrDaoSupportENTITY_SUPPORTprotected Directory<? extends EntitySpecAttr>entitySpecAttrDirectoryprotected Directory<? extends EntitySpec>entitySpecDirectoryprotected java.lang.StringentityTableSuffixprotected static java.util.Comparator<FilterEntityAttr>filterWeightComparatorprotected intuserIdFields 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_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_LIMIT, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE -
Constructor Summary
Constructors Constructor Description AbstractEntityAttrDao(java.sql.Connection con, int moduleId, int userId, java.lang.String tableName)AbstractEntityAttrDao(java.sql.Connection con, int moduleId, int userId, java.lang.String tableName, java.lang.String entityTableSuffix, EntityAttrDaoSupport support) -
Method Summary
Modifier and Type Method Description protected voidcheckEntityAttribute(EntityAttr entityAttr)booleancheckEntitySpecAttrDelete(int entitySpecAttrId)protected voiddeleteEntityAttributes(int entityId)java.util.List<FilterEntityAttr>filterInit(java.util.List<FilterEntityAttr> entityFilter)voidfilterJoin(java.lang.StringBuilder query, java.lang.String wherePrefix, java.lang.StringBuilder where, java.util.List<FilterEntityAttr> entityFilter)intfilterToPS(java.sql.PreparedStatement ps, int idx, java.util.List<FilterEntityAttr> entityFilter)protected java.util.Map<java.lang.Integer,EntityAttr>getAllEntityAttributes(int entityId, boolean fullMap)Получение всех возможных атрибутов/параметров без учета сущности/группы параметров.protected EntityAttrgetAttribute(int entityId, EntitySpecAttr spec)protected EntityAttrgetEntityAttribute(int entityId, int entityAttrId)Получение значения атрибута/параметраprotected java.util.Map<java.lang.Integer,EntityAttr>getEntityAttributes(int entirySpecId, int entityId, boolean fullMap)Получение атрибутов/параметров объекта/договора с учетом указанной сущности/группы параметров.protected Directory<? extends Id>getEntitySpecAttrDirectory()Directory<? extends Id>getEntitySpecDirectory()protected java.lang.StringgetEntityTableName()java.lang.StringgetEntityTableSuffix()protected java.util.Map<java.lang.Integer,java.lang.String>getEntityValueForIds(int entityId, java.util.Set<java.lang.Integer> ids)protected EgetFromRS(java.sql.ResultSet rs)protected abstract EgetFromRS(java.sql.ResultSet rs, boolean loadAttributes)protected java.util.List<E>list(boolean loadAttributes, Page page, java.lang.String what, java.lang.String join, java.util.List<FilterEntityAttr> entityFilter, java.lang.String filter, java.lang.String groupBy, java.lang.String orderBy, java.lang.Object... params)protected java.util.List<E>listImpl(boolean loadAttributes, Page page, java.lang.String what, java.lang.String join1, java.lang.String join2, java.util.List<FilterEntityAttr> entityFilter, java.lang.String filter, java.lang.String groupBy, java.lang.String orderBy, java.lang.Object... params)protected voidonAddressItemUpdate(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, java.lang.Class<?> clazz, int id)protected booleanupdateEntityAttribute(int entityId, EntityAttr entityAttr)protected voidupdateEntityAttributes(int entityId, java.util.Map<java.lang.Integer,EntityAttr> entityAttributes)Methods inherited from class ru.bitel.common.dao.AbstractIdDao
delete, get, getAndDelete, getAndUpdateMethods 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
ENTITY_SUPPORT
-
CONTRACT_SUPPORT
-
CONTRACT_OBJECT_SUPPORT
-
userId
protected final int userId -
entityTableSuffix
protected final java.lang.String entityTableSuffix -
entitySpecDirectory
-
entitySpecAttrDirectory
-
filterWeightComparator
-
-
Constructor Details
-
AbstractEntityAttrDao
public AbstractEntityAttrDao(java.sql.Connection con, int moduleId, int userId, java.lang.String tableName, java.lang.String entityTableSuffix, EntityAttrDaoSupport support) -
AbstractEntityAttrDao
public AbstractEntityAttrDao(java.sql.Connection con, int moduleId, int userId, java.lang.String tableName)
-
-
Method Details
-
getEntityTableSuffix
public java.lang.String 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, EntitySpecAttr spec) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getEntityAttributes
protected java.util.Map<java.lang.Integer,EntityAttr> getEntityAttributes(int entirySpecId, int entityId, boolean fullMap) throws ru.bitel.bgbilling.common.BGExceptionПолучение атрибутов/параметров объекта/договора с учетом указанной сущности/группы параметров. Если такой сущности/группы параметров не существует, то будет возвращан null.- Parameters:
entirySpecId-entityId-fullMap- при fullMap==true если параметр не заведен (не указан, не добавлен), то данный параметр будет отсутствовать в результате. Примером может служить параметр типа флаг - отсутствие параметра означает false. При fullMap==true при отсутсвии значения в результат попадет пустой EntityAttr.- Returns:
- Throws:
ru.bitel.bgbilling.common.BGException
-
getAllEntityAttributes
protected java.util.Map<java.lang.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 java.util.Map<java.lang.Integer,java.lang.String> getEntityValueForIds(int entityId, java.util.Set<java.lang.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
-
updateEntityAttribute
protected boolean updateEntityAttribute(int entityId, EntityAttr entityAttr) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException- Throws:
java.sql.SQLExceptionru.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, java.util.Map<java.lang.Integer,EntityAttr> entityAttributes) throws ru.bitel.bgbilling.common.BGException, java.sql.SQLException- Throws:
ru.bitel.bgbilling.common.BGExceptionjava.sql.SQLException
-
deleteEntityAttributes
protected void deleteEntityAttributes(int entityId) throws ru.bitel.bgbilling.common.BGException, java.sql.SQLException- Throws:
ru.bitel.bgbilling.common.BGExceptionjava.sql.SQLException
-
list
protected java.util.List<E> list(boolean loadAttributes, Page page, java.lang.String what, java.lang.String join, java.util.List<FilterEntityAttr> entityFilter, java.lang.String filter, java.lang.String groupBy, java.lang.String orderBy, java.lang.Object... params) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
filterInit
-
getEntityTableName
protected java.lang.String getEntityTableName() -
listImpl
protected java.util.List<E> listImpl(boolean loadAttributes, Page page, java.lang.String what, java.lang.String join1, java.lang.String join2, java.util.List<FilterEntityAttr> entityFilter, java.lang.String filter, java.lang.String groupBy, java.lang.String orderBy, java.lang.Object... params) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
getFromRS
protected E getFromRS(java.sql.ResultSet rs) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException -
getFromRS
protected abstract E getFromRS(java.sql.ResultSet rs, boolean loadAttributes) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException- Throws:
java.sql.SQLExceptionru.bitel.bgbilling.common.BGException
-
filterJoin
public void filterJoin(java.lang.StringBuilder query, java.lang.String wherePrefix, java.lang.StringBuilder where, java.util.List<FilterEntityAttr> entityFilter) -
filterToPS
public int filterToPS(java.sql.PreparedStatement ps, int idx, java.util.List<FilterEntityAttr> entityFilter) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
onAddressItemUpdate
protected void onAddressItemUpdate(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, java.lang.Class<?> clazz, int id) throws java.sql.SQLException, ru.bitel.bgbilling.common.BGException- Throws:
java.sql.SQLExceptionru.bitel.bgbilling.common.BGException
-
checkEntityAttribute
protected void checkEntityAttribute(EntityAttr entityAttr) throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-