Class DefaultOrgUnitDao<T extends OrgUnitModel>
java.lang.Object
de.hybris.platform.commerceservices.search.dao.impl.DefaultPagedGenericDao<T>
de.hybris.platform.commerceservices.organization.daos.impl.DefaultOrgUnitDao<T>
- All Implemented Interfaces:
OrgUnitDao<T>,PagedGenericDao<T>
- Direct Known Subclasses:
DefaultB2BOrgUnitDao
public class DefaultOrgUnitDao<T extends OrgUnitModel>
extends DefaultPagedGenericDao<T>
implements OrgUnitDao<T>
Default implementation of the
OrgUnitDao interface extending DefaultPagedGenericDao.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringSub-query that makes sure only the latest version for each distinct quote code is returned.protected static final StringQuery template to retrieve quotes associated to an employee.protected static final StringJoining the quote table with other tables (e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<U extends OrgUnitModel>
SearchPageData<U>findAllUnits(List<U> units, PageableData pageableData) Find all units in the branches.<U extends PrincipalModel>
SearchPageData<U>findMembersOfType(OrgUnitModel unit, Class<U> memberType, PageableData pageableData) Find all unit members of a given type.<U extends PrincipalModel>
SearchPageData<U>findMembersOfType(Class<U> memberType, PageableData pageableData, String... orgUnitUids) Find all units members of a given type.findQuotesForEmployee(EmployeeModel employee, Set<QuoteState> states, PageableData pageableData) Returns allQuoteModelinstances associated with at least one of the given employee's units.<U extends OrgUnitModel>
List<U>findRootUnits(Class<U> type, PageableData pageableData) Find all root units of the given type, i.e.protected ModelServiceprotected StringvoidsetModelService(ModelService modelService) Methods inherited from class de.hybris.platform.commerceservices.search.dao.impl.DefaultPagedGenericDao
appendOrderByClausesToBuilder, appendWhereClausesToBuilder, createFlexibleSearchQuery, createFlexibleSearchQuery, createFlexibleSearchQuery, createFlexibleSearchQuery, createFlexibleSearchQuery, createFlexibleSearchQuery, createQueryString, createSortQueryData, createSortQueryData, createSortQueryData, find, find, find, find, getPagedFlexibleSearchService, setPagedFlexibleSearchServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.commerceservices.search.dao.PagedGenericDao
find, find, find, find
-
Field Details
-
QUOTE_DISTINCT_CODE_MAX_VERSION_QUERY
Sub-query that makes sure only the latest version for each distinct quote code is returned.- See Also:
-
QUOTE_TO_EMPLOYEE_JOINS
Joining the quote table with other tables (e.g. PrincipipalGroupRelation), so that all quotes associated to the employee's organizational units can be resolved.- See Also:
-
QUOTE_FOR_EMPLOYEE_QUERY_FORMAT
Query template to retrieve quotes associated to an employee. Takes a JOIN statement used to define the relation between quote and employee as a first argument and an additional clause to narrow down the result set as a second argument.- See Also:
-
-
Constructor Details
-
DefaultOrgUnitDao
-
-
Method Details
-
findRootUnits
Description copied from interface:OrgUnitDaoFind all root units of the given type, i.e. the ones that don't have a parent unit of the same type.- Specified by:
findRootUnitsin interfaceOrgUnitDao<T extends OrgUnitModel>- Parameters:
type- the type to find root units forpageableData- paging information- Returns:
- paged search results
-
findMembersOfType
public <U extends PrincipalModel> SearchPageData<U> findMembersOfType(OrgUnitModel unit, Class<U> memberType, PageableData pageableData) Description copied from interface:OrgUnitDaoFind all unit members of a given type.- Specified by:
findMembersOfTypein interfaceOrgUnitDao<T extends OrgUnitModel>- Parameters:
unit- the unit to find all members formemberType- the model type of the members to findpageableData- paging information- Returns:
- paged search results
-
findMembersOfType
public <U extends PrincipalModel> SearchPageData<U> findMembersOfType(Class<U> memberType, PageableData pageableData, String... orgUnitUids) Description copied from interface:OrgUnitDaoFind all units members of a given type.- Specified by:
findMembersOfTypein interfaceOrgUnitDao<T extends OrgUnitModel>- Type Parameters:
U- the generic type- Parameters:
memberType- the model type of the members to findpageableData- paging informationorgUnitUids- the orgUnit uids to find all members for- Returns:
SearchPageDatathe search page data
-
findQuotesForEmployee
public SearchPageData<QuoteModel> findQuotesForEmployee(EmployeeModel employee, Set<QuoteState> states, PageableData pageableData) Description copied from interface:OrgUnitDaoReturns allQuoteModelinstances associated with at least one of the given employee's units.- Specified by:
findQuotesForEmployeein interfaceOrgUnitDao<T extends OrgUnitModel>- Parameters:
employee- an employee who is a member of an organizational unitpageableData- paging information- Returns:
SearchPageDatacontaining the paged search result
-
findAllUnits
public <U extends OrgUnitModel> SearchPageData<U> findAllUnits(List<U> units, PageableData pageableData) Description copied from interface:OrgUnitDaoFind all units in the branches.- Specified by:
findAllUnitsin interfaceOrgUnitDao<T extends OrgUnitModel>- Type Parameters:
U- the generic type- Parameters:
units- the start point units to find their branches unitspageableData- paging information- Returns:
SearchPageDatathe search page data
-
getQuoteForEmployeeQuery
-
getModelService
-
setModelService
-