public class DefaultSandBoxCollectionHelper extends Object implements SandBoxCollectionHelper
Modifier and Type | Field and Description |
---|---|
protected String |
cacheRegion |
protected Class<?> |
containerType |
protected Field |
field |
protected String |
foreignKeyField |
protected String |
foreignKeyIdField |
protected Boolean |
isCollection |
protected Boolean |
isInitialized |
protected Boolean |
isSuccessful |
protected String |
joinFetchProperty |
protected List<org.broadleafcommerce.common.util.Tuple<String,String>> |
sortExpressions |
protected String |
targetProperty |
protected Class<?> |
type |
Constructor and Description |
---|
DefaultSandBoxCollectionHelper(Class<?> containerType,
Field field,
String joinFetchProperty)
This constructor allows the system to derive the collection configuration from the collection Field itself,
which allows discovery from the annotations surrounding the field.
|
DefaultSandBoxCollectionHelper(String cacheRegion,
String foreignKeyField,
String foreignKeyIdField,
List<org.broadleafcommerce.common.util.Tuple<String,String>> sortExpressions,
String targetProperty,
Class<?> type)
If all the configuration params are known ahead of time, they can be passed to this constructor to populate the
final values in the bean.
|
Modifier and Type | Method and Description |
---|---|
Object |
getAppropriateLargeSortingValue(String sortProperty)
Get a large value to apply to any query results that do not define a value in the sorting field.
|
String |
getCacheKey()
A key to identify the collection batch fetch query in the batch fetch cache.
|
String |
getCacheRegion()
Get the cache region used on the collection, if applicable (can be null)
|
String |
getCollectionFetchQuery()
Get the HQL query used to retrieve the collection members
|
String |
getForeignKeyField()
Get the field on the collection member that points back to the containing entity
|
String |
getForeignKeyIdField()
Get the id field of the containing entity class
|
List<org.broadleafcommerce.common.util.Tuple<String,String>> |
getSortExpressions()
Get the sorting expressions for the query results, if applicable (can be null or empty)
|
String |
getTargetProperty()
Only applicable to
AdminPresentationAdornedTargetCollection annotated collections. |
Class<?> |
getType()
Get the type for the collection members
|
boolean |
initialize(org.hibernate.Session session)
Build up the internal structure based on the annotations and information derived from the Field param passed
to
DefaultSandBoxCollectionHelper(Class, Field, String) . |
Map<Serializable,List> |
sortByForeignKey(List results,
List<Serializable> fkValue)
Sort batch fetch results for sandboxable collections by their foreign key relationship.
|
protected String foreignKeyField
protected String foreignKeyIdField
protected String cacheRegion
protected String targetProperty
protected List<org.broadleafcommerce.common.util.Tuple<String,String>> sortExpressions
protected Class<?> type
protected Field field
protected Class<?> containerType
protected Boolean isCollection
protected Boolean isInitialized
protected Boolean isSuccessful
protected String joinFetchProperty
public DefaultSandBoxCollectionHelper(Class<?> containerType, Field field, String joinFetchProperty)
initialize(Session)
.containerType
- field
- joinFetchProperty
- public DefaultSandBoxCollectionHelper(String cacheRegion, String foreignKeyField, String foreignKeyIdField, List<org.broadleafcommerce.common.util.Tuple<String,String>> sortExpressions, String targetProperty, Class<?> type)
cacheRegion
- foreignKeyField
- foreignKeyIdField
- sortExpressions
- targetProperty
- type
- public boolean initialize(org.hibernate.Session session)
DefaultSandBoxCollectionHelper(Class, Field, String)
. It is safe to call this method repeatedly,
as it is synchronized and will only execute once based on a "isInitialized" flag.session
- public Map<Serializable,List> sortByForeignKey(List results, List<Serializable> fkValue)
SandBoxCollectionHelper
sortByForeignKey
in interface SandBoxCollectionHelper
public String getCollectionFetchQuery()
SandBoxCollectionHelper
getCollectionFetchQuery
in interface SandBoxCollectionHelper
public Object getAppropriateLargeSortingValue(String sortProperty)
SandBoxCollectionHelper
getAppropriateLargeSortingValue
in interface SandBoxCollectionHelper
public String getCacheKey()
SandBoxCollectionHelper
EnterpriseCollectionDao
for
more information.getCacheKey
in interface SandBoxCollectionHelper
public String getCacheRegion()
SandBoxCollectionHelper
getCacheRegion
in interface SandBoxCollectionHelper
public String getForeignKeyField()
SandBoxCollectionHelper
getForeignKeyField
in interface SandBoxCollectionHelper
public String getForeignKeyIdField()
SandBoxCollectionHelper
getForeignKeyIdField
in interface SandBoxCollectionHelper
public List<org.broadleafcommerce.common.util.Tuple<String,String>> getSortExpressions()
SandBoxCollectionHelper
getSortExpressions
in interface SandBoxCollectionHelper
public String getTargetProperty()
SandBoxCollectionHelper
AdminPresentationAdornedTargetCollection
annotated collections. This property references
the target entity in the adorned target structure.getTargetProperty
in interface SandBoxCollectionHelper
public Class<?> getType()
SandBoxCollectionHelper
getType
in interface SandBoxCollectionHelper
Copyright © 2019. All rights reserved.