Package org.cyclos.impl.users
Class BasePropertyResolver<K,R extends SimpleEntity>
- java.lang.Object
-
- org.cyclos.impl.users.BasePropertyResolver<K,R>
-
- Type Parameters:
K- The resultMapkey typeR- The type of the entity which is related to the product
- All Implemented Interfaces:
PropertyResolver<K>
- Direct Known Subclasses:
AdminProductAuthorizationRolesResolver,AdminProductNotificationsResolver,BaseAccessClientsPropertyResolver,BaseProductVouchersPropertyResolver,DashboardActionsPropertyResolver,ManagedProductsResolver,MemberProductCustomOperationsResolver,MemberProductCustomWizardsResolver,PasswordActionsPropertyResolver,ProductAdFieldPropertyResolver,ProductMyContactFieldPropertyResolver,ProductMyProfileFieldPropertyResolver,ProductOperatorProfileFieldPropertyResolver,ProductsRecordTypesPropertyResolver,ProductTokenTypePropertyResolver,ProductTransferStatusFlowsPropertyResolver,ProductUserContactFieldPropertyResolver,ProductUserProfileFieldPropertyResolver,UserNotificationsPropertyResolver
public abstract class BasePropertyResolver<K,R extends SimpleEntity> extends Object implements PropertyResolver<K>
Base class forPropertyResolvers
-
-
Field Summary
Fields Modifier and Type Field Description protected ApplicationContextapplicationContextprotected ConversionHandlerconversionHandlerprotected RawEntityManagerHandlerrawEntityManagerHandler
-
Constructor Summary
Constructors Constructor Description BasePropertyResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T extends SimpleEntity>
Tfind(Class<T> entityClass, Long id)protected Comparator<K>getComparator()protected abstract KgetKey(R relationship)Must be implemented in order to return the key from the given relationship.protected abstract com.querydsl.core.types.Path<K>getKeyPath()Returns the path that resolves to the key.StringgetKeyPropertyName()Returns the property name which resolves to the relationship key.Set<com.querydsl.core.types.dsl.BooleanPath>getPaths()Returns the paths handled by thisPropertyResolverprotected abstract Collection<R>getRelationships(Product product)Must be implemented to resolve the related entities to the given product.protected abstract voidinitPaths(Set<com.querydsl.core.types.dsl.BooleanPath> paths)BooleanPropertiesHolder<K>resolve(Collection<? extends Product> products)Resolve the value for the given products collection
-
-
-
Field Detail
-
applicationContext
@Autowired protected ApplicationContext applicationContext
-
rawEntityManagerHandler
@Autowired protected RawEntityManagerHandler rawEntityManagerHandler
-
conversionHandler
@Autowired protected ConversionHandler conversionHandler
-
-
Method Detail
-
getKeyPropertyName
public String getKeyPropertyName()
Returns the property name which resolves to the relationship key. By default, delegates to the property name of the path returned bygetKeyPath().- Specified by:
getKeyPropertyNamein interfacePropertyResolver<K>
-
getPaths
public Set<com.querydsl.core.types.dsl.BooleanPath> getPaths()
Description copied from interface:PropertyResolverReturns the paths handled by thisPropertyResolver- Specified by:
getPathsin interfacePropertyResolver<K>
-
resolve
public final BooleanPropertiesHolder<K> resolve(Collection<? extends Product> products)
Description copied from interface:PropertyResolverResolve the value for the given products collection- Specified by:
resolvein interfacePropertyResolver<K>
-
find
protected <T extends SimpleEntity> T find(Class<T> entityClass, Long id)
-
getComparator
protected Comparator<K> getComparator()
-
getKey
protected abstract K getKey(R relationship)
Must be implemented in order to return the key from the given relationship. Returning null means this relationship shouldn't be taken into account
-
getKeyPath
protected abstract com.querydsl.core.types.Path<K> getKeyPath()
Returns the path that resolves to the key. For using custom key property names, subclasses should return null in this method and overridegetKeyPropertyName().
-
getRelationships
protected abstract Collection<R> getRelationships(Product product)
Must be implemented to resolve the related entities to the given product. Returning null means if doesn't apply to this product type
-
initPaths
protected abstract void initPaths(Set<com.querydsl.core.types.dsl.BooleanPath> paths)
-
-