public abstract class CommonLinkDAO extends CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T extends Id>
con, dateFormat_DDMMYYYY, dateFormat_DDMMYYYY_HHMM, log, SQL_AND, SQL_DELETE, SQL_DESC, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT, SQL_INSERT_IGNORE, SQL_LEFT_JOIN, SQL_LEFT_OUTER_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_OR, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UPDATE, SQL_WHERE
Modifier | Constructor and Description |
---|---|
protected |
CommonLinkDAO(java.sql.Connection con) |
Modifier and Type | Method and Description |
---|---|
void |
addLink(CommonObjectLink link)
Привязка объекта.
|
void |
addLinkAndLog(CommonObjectLink link,
int userId) |
void |
addLinkIfNotExist(CommonObjectLink link)
Привязка объекта если он не привязан к данному объекту.
|
void |
copyLinks(int objectFromId,
int objectToId,
java.lang.String typePrefix) |
void |
copyLinks(int objectFromId,
int objectToId,
java.lang.String typePrefix,
java.lang.String excludeType) |
void |
deleteLink(CommonObjectLink link)
Удаляет ссылку объекта на один другой объект.
|
void |
deleteLinkAndLog(CommonObjectLink link,
int userId) |
void |
deleteLinksTo(CommonObjectLink link)
Удаляет все ссылки объектов данного типа на какой-то другой объект.
|
void |
deleteLinksWithType(CommonObjectLink link)
Удаляет все ссылки объектов данного типа на другие типы объектов.
|
void |
deleteObjectLinks(int objectId)
Удаляет все ссылки объекта.
|
protected abstract java.lang.String |
getColumnName() |
protected abstract EntityLogDAO |
getEntityLogDAO() |
static CommonLinkDAO |
getLinkDAO(java.lang.String objectType,
java.sql.Connection con) |
java.util.List<Contract> |
getLinkedContracts(int objectId) |
Customer |
getLinkedCustomer(int objectID)
Получение первого найденого Контрагента из привязок
к объекту с id objectID
|
java.util.List<Customer> |
getLinkedCustomers(int objectID)
Получение всех прикрепленых контрагентов к объекту
|
java.util.List<CommonObjectLink> |
getObjectLinksWithType(int objectId,
java.lang.String typeLike)
Возвращает список привязанных к объекту сущностей.
|
protected abstract java.lang.String |
getObjectType() |
protected abstract java.lang.String |
getTable() |
boolean |
isLinkExists(CommonObjectLink link)
Проверка наличия привязки.
|
CommonObjectLink |
prepareLink(CommonObjectLink link) |
void |
updateLinkTitles(int linkedObjectId,
java.lang.String linkedObjectTypeLike,
java.lang.String title) |
deleteById, execute, execute, execute, executeInsert, executeUpdate, getById, getFoundRows, getFoundRows, getGroupedIds, getGroupedIds, getIds, getIds, getLikePattern, getLikePatternEnd, getLikePatternStart, getLikePatternSub, getMySQLLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, sqlToBgException, update, updateColumn, updateIds, updateIds
public static CommonLinkDAO getLinkDAO(java.lang.String objectType, java.sql.Connection con) throws BGException
BGException
public java.util.List<CommonObjectLink> getObjectLinksWithType(int objectId, java.lang.String typeLike) throws BGException
objectId
- код объекта.typeLike
- MySQL Like выражение для фильтрации, необязательно.BGException
public java.util.List<Contract> getLinkedContracts(int objectId) throws BGException
BGException
public Customer getLinkedCustomer(int objectID)
objectID
- - id объекта у которого нужно получить привязанный КАpublic java.util.List<Customer> getLinkedCustomers(int objectID)
objectID
- - id объекта у которого нужно получить привязанные КАpublic CommonObjectLink prepareLink(CommonObjectLink link)
public void updateLinkTitles(int linkedObjectId, java.lang.String linkedObjectTypeLike, java.lang.String title) throws BGException
BGException
public void addLink(CommonObjectLink link) throws BGException
link
- BGException
public void addLinkIfNotExist(CommonObjectLink link) throws BGException
link
- BGException
public boolean isLinkExists(CommonObjectLink link) throws BGException
link
- BGException
public void deleteLink(CommonObjectLink link) throws BGException
link
- BGException
public void deleteObjectLinks(int objectId) throws BGException
objectId
- java.sql.SQLException
BGException
public void deleteLinksTo(CommonObjectLink link) throws BGException
link
- BGException
public void deleteLinksWithType(CommonObjectLink link) throws BGException
link
- BGException
public void copyLinks(int objectFromId, int objectToId, java.lang.String typePrefix) throws BGException
BGException
public void copyLinks(int objectFromId, int objectToId, java.lang.String typePrefix, java.lang.String excludeType) throws BGException
BGException
protected abstract java.lang.String getTable()
protected abstract java.lang.String getColumnName()
protected abstract java.lang.String getObjectType()
public void addLinkAndLog(CommonObjectLink link, int userId) throws BGException
BGException
public void deleteLinkAndLog(CommonObjectLink link, int userId) throws BGException
BGException
protected abstract EntityLogDAO getEntityLogDAO()