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 theOrgUnitDao
interface extendingDefaultPagedGenericDao
.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
QUOTE_DISTINCT_CODE_MAX_VERSION_QUERY
Sub-query that makes sure only the latest version for each distinct quote code is returned.protected static java.lang.String
QUOTE_FOR_EMPLOYEE_QUERY_FORMAT
Query template to retrieve quotes associated to an employee.protected static java.lang.String
QUOTE_TO_EMPLOYEE_JOINS
Joining the quote table with other tables (e.g.
-
Constructor Summary
Constructors Constructor Description DefaultOrgUnitDao(java.lang.String typeCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <U extends OrgUnitModel>
SearchPageData<U>findAllUnits(java.util.List<U> units, PageableData pageableData)
Find all units in the branches.<U extends PrincipalModel>
SearchPageData<U>findMembersOfType(OrgUnitModel unit, java.lang.Class<U> memberType, PageableData pageableData)
Find all unit members of a given type.<U extends PrincipalModel>
SearchPageData<U>findMembersOfType(java.lang.Class<U> memberType, PageableData pageableData, java.lang.String... orgUnitUids)
Find all units members of a given type.SearchPageData<QuoteModel>
findQuotesForEmployee(EmployeeModel employee, java.util.Set<QuoteState> states, PageableData pageableData)
Returns allQuoteModel
instances associated with at least one of the given employee's units.<U extends OrgUnitModel>
java.util.List<U>findRootUnits(java.lang.Class<U> type, PageableData pageableData)
Find all root units of the given type, i.e.protected ModelService
getModelService()
protected java.lang.String
getQuoteForEmployeeQuery()
void
setModelService(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, setPagedFlexibleSearchService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.commerceservices.search.dao.PagedGenericDao
find, find, find, find
-
-
-
-
Field Detail
-
QUOTE_DISTINCT_CODE_MAX_VERSION_QUERY
protected static final java.lang.String QUOTE_DISTINCT_CODE_MAX_VERSION_QUERY
Sub-query that makes sure only the latest version for each distinct quote code is returned.- See Also:
- Constant Field Values
-
QUOTE_TO_EMPLOYEE_JOINS
protected static final java.lang.String 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:
- Constant Field Values
-
QUOTE_FOR_EMPLOYEE_QUERY_FORMAT
protected static final java.lang.String 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:
- Constant Field Values
-
-
Method Detail
-
findRootUnits
public <U extends OrgUnitModel> java.util.List<U> findRootUnits(java.lang.Class<U> type, PageableData pageableData)
Description copied from interface:OrgUnitDao
Find all root units of the given type, i.e. the ones that don't have a parent unit of the same type.- Specified by:
findRootUnits
in 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, java.lang.Class<U> memberType, PageableData pageableData)
Description copied from interface:OrgUnitDao
Find all unit members of a given type.- Specified by:
findMembersOfType
in 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(java.lang.Class<U> memberType, PageableData pageableData, java.lang.String... orgUnitUids)
Description copied from interface:OrgUnitDao
Find all units members of a given type.- Specified by:
findMembersOfType
in 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:
SearchPageData
the search page data
-
findQuotesForEmployee
public SearchPageData<QuoteModel> findQuotesForEmployee(EmployeeModel employee, java.util.Set<QuoteState> states, PageableData pageableData)
Description copied from interface:OrgUnitDao
Returns allQuoteModel
instances associated with at least one of the given employee's units.- Specified by:
findQuotesForEmployee
in interfaceOrgUnitDao<T extends OrgUnitModel>
- Parameters:
employee
- an employee who is a member of an organizational unitpageableData
- paging information- Returns:
SearchPageData
containing the paged search result
-
findAllUnits
public <U extends OrgUnitModel> SearchPageData<U> findAllUnits(java.util.List<U> units, PageableData pageableData)
Description copied from interface:OrgUnitDao
Find all units in the branches.- Specified by:
findAllUnits
in interfaceOrgUnitDao<T extends OrgUnitModel>
- Type Parameters:
U
- the generic type- Parameters:
units
- the start point units to find their branches unitspageableData
- paging information- Returns:
SearchPageData
the search page data
-
getQuoteForEmployeeQuery
protected java.lang.String getQuoteForEmployeeQuery()
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
-