Class CustomerDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.dao.customer.CustomerDAO
- Direct Known Subclasses:
CustomerDAO
-
Nested Class Summary
Nested classes/interfaces inherited from class CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T> -
Field Summary
Fields inherited from class CommonDAO
con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE_INTO, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE -
Constructor Summary
ConstructorsConstructorDescriptionCustomerDAO(Connection con) CustomerDAO(Connection con, boolean history, int userId) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCustomer(int id) Deletes a customer from DB by codeextractCustomerWithRef(int customerId) Deprecated.getCustomerById(int customerId) Selects a customer by its codegetCustomerByTitle(String customerTitle) Deprecated.static CustomergetCustomerFromRs(ResultSet rs, String prefix) getCustomerTitles(String title, int count) Returns customer titles containing a substringgetGroupIds(int customerId) voidsearchCustomerByLinkedObjectTitle(Pageable<Customer> searchResult, String linkedObjectTypeLike, String linkedObjectTitle) Deprecated.voidsearchCustomerList(Pageable<Customer> searchResult, String title) Selects customers by titlevoidsearchCustomerList(Pageable<Customer> searchResult, Set<Integer> groupIds) Deprecated.voidsearchCustomerListByAddress(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int houseId, String houseFlat, String houseRoom) Selects customers by an address parametervoidsearchCustomerListByAddress(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int streetId, String house, String houseFlat, String houseRoom) Selects customers by an address parametervoidsearchCustomerListByEmail(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> emailParamIdList, String email) Selects customers by an Email-type parametervoidsearchCustomerListByPhone(Pageable<Customer> searchResult, Collection<Integer> phoneParamIdList, String... phoneNumbers) Selects customers by a phone number or numbersvoidsearchCustomerListByText(Pageable<Customer> searchResult, List<Integer> textParamIdList, String value) Selects customers by a text parametervoidupdateCustomer(Customer customer) Updates customer information in DBvoidupdateCustomerTitle(String titleBefore, Customer customer, int changedParamId, Response response) Updates the customer's title, generating it from parametersvoidupdateGroupIds(int customerId, Set<Integer> groupIds) Methods inherited from class CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Constructor Details
-
CustomerDAO
-
CustomerDAO
-
-
Method Details
-
searchCustomerList
-
searchCustomerListByEmail
-
searchCustomerListByText
public void searchCustomerListByText(Pageable<Customer> searchResult, List<Integer> textParamIdList, String value) throws SQLException Selects customers by a text parameter- Parameters:
searchResult-textParamIdList-value-- Throws:
SQLException
-
searchCustomerListByAddress
public void searchCustomerListByAddress(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int streetId, String house, String houseFlat, String houseRoom) throws SQLException Selects customers by an address parameter- Parameters:
searchResult-addressParamIdList-streetId-house-houseFlat-houseRoom-- Throws:
SQLException
-
searchCustomerListByAddress
public void searchCustomerListByAddress(Pageable<ParameterSearchedObject<Customer>> searchResult, List<Integer> addressParamIdList, int houseId, String houseFlat, String houseRoom) Selects customers by an address parameter- Parameters:
searchResult-addressParamIdList-houseId- house codehouseFlat- flathouseRoom- room
-
searchCustomerListByPhone
public void searchCustomerListByPhone(Pageable<Customer> searchResult, Collection<Integer> phoneParamIdList, String... phoneNumbers) Selects customers by a phone number or numbers- Parameters:
searchResult-phoneParamIdList-phoneNumbers-
-
getCustomerById
Selects a customer by its code- Parameters:
customerId-- Returns:
- the customer
-
updateCustomer
Updates customer information in DB- Parameters:
customer-- Throws:
SQLException
-
deleteCustomer
Deletes a customer from DB by code- Parameters:
id-- Throws:
SQLException
-
updateCustomerTitle
public void updateCustomerTitle(String titleBefore, Customer customer, int changedParamId, Response response) throws Exception Updates the customer's title, generating it from parameters- Parameters:
titleBefore- the original titlecustomer- the customerchangedParamId- the changed parameter's coderesponse- if passed, an event about the title change will be added there- Throws:
Exception
-
getCustomerTitles
-
getGroupIds
- Throws:
SQLException
-
updateGroupIds
- Throws:
SQLException
-
getCustomerFromRs
- Parameters:
rs-prefix-- Throws:
SQLException
-
searchCustomerList
Deprecated. -
extractCustomerWithRef
Deprecated. -
searchCustomerByLinkedObjectTitle
@Deprecated public void searchCustomerByLinkedObjectTitle(Pageable<Customer> searchResult, String linkedObjectTypeLike, String linkedObjectTitle) Deprecated. -
getCustomerByTitle
Deprecated.- Throws:
SQLException
-