Package de.hybris.platform.b2b.dao.impl
Class BaseDao
java.lang.Object
de.hybris.platform.b2b.dao.impl.BaseDao
- All Implemented Interfaces:
Dao
Deprecated, for removal: This API element is subject to removal in a future version.
This dao provides convinience methods to look up models without having to implement your own Dao.
-
Constructor Summary
ConstructorsConstructorDescriptionBaseDao()Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescription<M extends ItemModel>
McopyDirtyAttributes(M source, M target) Deprecated, for removal: This API element is subject to removal in a future version.Copies dirty attributes fromsourcemodel to thetarget.countAllByAttributes(Map<String, Object> attribs, boolean excludeSubtypes, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Counts models matching the given attribute map.<M extends ItemModel>
MDeprecated, for removal: This API element is subject to removal in a future version.Copies all attributes that are marked as loaded frommodelinto a new copy of the sameItemModeltype.Deprecated, for removal: This API element is subject to removal in a future version.Finds all models.findAllByAttribute(String attributeName, Object attributeValue, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.findAllByAttribute(String attributeName, Object attributeValue, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.findAllByAttribute(String attributeName, Object attributeValue, Map<String, Boolean> orderBy, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.findAllByAttributes(Map<String, Object> attribs, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.findAllByAttributes(Map<String, Object> attribs, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.findAllByAttributes(Map<String, Object> attribs, Map<String, Boolean> orderByMap, int count, int start, boolean excludeSubtypes, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.findAllByAttributes(Map<String, Object> attribs, Map<String, Boolean> orderByMap, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.<M> MfindByBeanProperty(Collection<M> collection, String propertyName, String propertyValue) Deprecated, for removal: This API element is subject to removal in a future version.<M extends ItemModel>
MfindFirstByAttribute(String attributeName, Object attributeValue, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute.<M extends ItemModel>
MfindFirstByAttribute(String attributeName, Object attributeValue, Map<String, Boolean> orderBy, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute.<M extends ItemModel>
MDeprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attributes.<M extends ItemModel>
MfindLastInsertedItem(Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.<M extends ItemModel>
MfindUniqueByAttribute(String attributeName, Object attributeValue, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute.<M extends ItemModel>
MfindUniqueByAttributes(Map<String, Object> attribs, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attributes.getAllAttributes(ItemModel model) Deprecated, for removal: This API element is subject to removal in a future version.Get all the attributes an ItemModel instance including all the attributes of its super classes.Deprecated, for removal: This API element is subject to removal in a future version.Gets the search service.Deprecated, for removal: This API element is subject to removal in a future version.Gets the model service.<M extends ItemModel>
voidsave(M model) Deprecated, for removal: This API element is subject to removal in a future version.Persists the model.<M extends ItemModel>
voidsaveAll(Collection<M> models) Deprecated, for removal: This API element is subject to removal in a future version.Save all.voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService) Deprecated, for removal: This API element is subject to removal in a future version.Sets the search service.voidsetModelService(ModelService modelService) Deprecated, for removal: This API element is subject to removal in a future version.Sets the model service.
-
Constructor Details
-
BaseDao
public BaseDao()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
findAll
Deprecated, for removal: This API element is subject to removal in a future version.Finds all models.- Parameters:
count- The max. number of models returned.start- The number of the first record.- Returns:
- A list of models.
-
findUniqueByAttribute
public <M extends ItemModel> M findUniqueByAttribute(String attributeName, Object attributeValue, Class<M> modelClass) throws AmbiguousIdentifierException Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute. If the query returns more than one model aAmbiguousIdentifierExceptionis thrown. If no model was foundnullis returned.- Parameters:
attributeName- The name of the attribute.attributeValue- The value of the attribute- Returns:
- A list of models.
- Throws:
AmbiguousIdentifierException- If more than one model was found.
-
findUniqueByAttributes
public <M extends ItemModel> M findUniqueByAttributes(Map<String, Object> attribs, Class<M> modelClass) throws AmbiguousIdentifierExceptionDeprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attributes. If the query returns more than one model aAmbiguousIdentifierExceptionis thrown. If no model was foundnullis returned.- Parameters:
attribs- A map of attribute names and values- Returns:
- A list of models.
- Throws:
AmbiguousIdentifierException- If more than one model was found.
-
findFirstByAttribute
public <M extends ItemModel> M findFirstByAttribute(String attributeName, Object attributeValue, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute. If the query returns more than one model the first model is returned. If no model was foundnullis returned.- Parameters:
attributeName- The name of the attribute.attributeValue- The value of the attribute- Returns:
- A list of models.
-
findFirstByAttribute
public <M extends ItemModel> M findFirstByAttribute(String attributeName, Object attributeValue, Map<String, Boolean> orderBy, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute. If the query returns more than one model the first model is returned. If no model was foundnullis returned.- Parameters:
attributeName- The name of the attribute.attributeValue- The value of the attributeorderBy- Map providing attribute names that will be included in theorder byclause . The boolean value determines whether the sort order should be ascending (true) or descending (false).- Returns:
- A list of models.
-
findLastInsertedItem
Deprecated, for removal: This API element is subject to removal in a future version. -
findFirstByAttributes
public <M extends ItemModel> M findFirstByAttributes(Map<String, Object> attribs, Map<String, Boolean> orderBy, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attributes. If the query returns more than one model the first model is returned. If no model was foundnullis returned.- Parameters:
attribs- A map of attribute names and valuesorderBy- Map providing attribute names that will be included in theorder byclause. The boolean value determines whether the sort order should be ascending (true) or descending (false).- Returns:
- A list of models.
-
findAllByAttribute
public <M extends ItemModel> List<M> findAllByAttribute(String attributeName, Object attributeValue, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.- Parameters:
attributeName- The name of the attribute.attributeValue- The value of the attribute- Returns:
- A list of models.
-
findAllByAttribute
public <M extends ItemModel> List<M> findAllByAttribute(String attributeName, Object attributeValue, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.- Parameters:
attributeName- The name of the attribute.attributeValue- The value of the attributecount- The max. number of models returned.start- The number of the first record.- Returns:
- A list of models.
-
findAllByAttribute
public <M extends ItemModel> List<M> findAllByAttribute(String attributeName, Object attributeValue, Map<String, Boolean> orderBy, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.- Parameters:
attributeName- The name of the attribute.attributeValue- The value of the attributeorderBy- Map providing attribute names that will be included in theorder byclause . The boolean value determines whether the sort order should be ascending (true) or descending (false).count- The max. number of models returned.start- The number of the first record.- Returns:
- A list of models.
-
findAllByAttributes
public <M extends ItemModel> List<M> findAllByAttributes(Map<String, Object> attribs, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.- Parameters:
attribs- Map providing attribute names and values that will be included in thewhereclause or null. The value can be anItemModel.- Returns:
- the list< m>
-
findAllByAttributes
public <M extends ItemModel> List<M> findAllByAttributes(Map<String, Object> attribs, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.- Parameters:
attribs- Map providing attribute names and values that will be included in thewhereclause or null. The value can be anItemModel.count- The max. number of models returned.start- The number of the first record.- Returns:
- A list of models.
-
findAllByAttributes
public <M extends ItemModel> List<M> findAllByAttributes(Map<String, Object> attribs, Map<String, Boolean> orderByMap, int count, int start, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.- Parameters:
attribs- Map providing attribute names and values that will be included in thewhereclause or null. The value can be anItemModel.orderByMap- Map providing attribute names that will be included in theorder byclause. The boolean value determines whether the sort order should be ascending (true) or descending (false).count- The max. number of models returned.start- The number of the first record.- Returns:
- A list of models.
-
findAllByAttributes
public <M extends ItemModel> List<M> findAllByAttributes(Map<String, Object> attribs, Map<String, Boolean> orderByMap, int count, int start, boolean excludeSubtypes, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.- Parameters:
attribs- Map providing attribute names and values that will be included in thewhereclause or null. The value can be anItemModel.orderByMap- Map providing attribute names that will be included in theorder byclause. The boolean value determines whether the sort order should be ascending (true) or descending (false).count- The max. number of models returned.start- The number of the first record.excludeSubtypes- Use if you want to exclude the subtyps so in the case of a Product no Color- or SizeVariants will be given back.modelClass- Service Layer model class- Returns:
- A list of models.
-
countAllByAttributes
public <M extends ItemModel> Integer countAllByAttributes(Map<String, Object> attribs, boolean excludeSubtypes, Class<M> modelClass) Deprecated, for removal: This API element is subject to removal in a future version.Counts models matching the given attribute map.- Parameters:
attribs- Map providing attribute names and values that will be included in thewhereclause or null. The value can be anItemModel.excludeSubtypes- Use if you want to exclude the subtyps so in the case of a Product no Color- or SizeVariants will be given back.- Returns:
- A list of models.
-
save
Deprecated, for removal: This API element is subject to removal in a future version.Persists the model.- Parameters:
model- the model to save- Throws:
ModelSavingException- if the save operation failed- See Also:
-
saveAll
Deprecated, for removal: This API element is subject to removal in a future version.Save all.- Parameters:
models- the models
-
getFlexibleSearchService
Deprecated, for removal: This API element is subject to removal in a future version.Gets the search service.- Returns:
- the flexibleSearchService
-
setFlexibleSearchService
Deprecated, for removal: This API element is subject to removal in a future version.Sets the search service.- Parameters:
flexibleSearchService- the flexibleSearchService to set
-
getModelService
Deprecated, for removal: This API element is subject to removal in a future version.Gets the model service.- Returns:
- the modelService
-
setModelService
Deprecated, for removal: This API element is subject to removal in a future version.Sets the model service.- Parameters:
modelService- the modelService to set
-
copyDirtyAttributes
Deprecated, for removal: This API element is subject to removal in a future version.Copies dirty attributes fromsourcemodel to thetarget.- Parameters:
source- A model to read dirty attributes from.target- A model to updated with dirty values of the source.- Returns:
- An updated
targetmodel.
-
deepClone
Deprecated, for removal: This API element is subject to removal in a future version.Copies all attributes that are marked as loaded frommodelinto a new copy of the sameItemModeltype. Note that both models are detached from theModelContextwhen using this method you should explicitly callModelService.attach(Object)The following attributes will not be copied. Item.CREATION_TIME Item.MODIFIED_TIME Item.PK Item.OWNER assignedCockpitItemTemplates allDocuments synchronizationSources synchronizedCopies savedValues valueHistory
- Parameters:
model- A model to copyexcludeAttributesFromCopy- the exclude attributes from copy- Returns:
- A copy of a model.
-
getAllAttributes
Deprecated, for removal: This API element is subject to removal in a future version.Get all the attributes an ItemModel instance including all the attributes of its super classes. -
findByBeanProperty
public <M> M findByBeanProperty(Collection<M> collection, String propertyName, String propertyValue) Deprecated, for removal: This API element is subject to removal in a future version.
-
DefaultGenericDao