Package de.hybris.platform.b2b.dao.impl
Class GenericDao<M extends ItemModel>
- java.lang.Object
-
- de.hybris.platform.b2b.dao.impl.GenericDao<M>
-
- All Implemented Interfaces:
Dao
@Deprecated(since="4.4", forRemoval=true) public abstract class GenericDao<M extends ItemModel> extends java.lang.Object implements DaoDeprecated, for removal: This API element is subject to removal in a future version.Since 4.4. UserDefaultGenericDaoGeneric DAO to provide generic functionality common to all DAOs.
Just extend from this class providing the generated hybris Item class I and the Model class M.
-
-
Constructor Summary
Constructors Constructor Description GenericDao()Deprecated, for removal: This API element is subject to removal in a future version.Instantiates a new generic dao.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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.java.lang.IntegercountAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, boolean excludeSubtypes)Deprecated, for removal: This API element is subject to removal in a future version.Counts models matching the given attribute map.MdeepClone(M model, java.lang.String... excludeAttributesFromCopy)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.java.util.List<M>findAll(int count, int start)Deprecated, for removal: This API element is subject to removal in a future version.Finds all models.java.util.List<M>findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.java.util.List<M>findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, int count, int start)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.java.util.List<M>findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.util.Map<java.lang.String,java.lang.Boolean> orderBy, int count, int start)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute.java.util.List<M>findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.java.util.List<M>findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, int count, int start)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.java.util.List<M>findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderByMap, int count, int start)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.java.util.List<M>findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderByMap, int count, int start, boolean excludeSubtypes)Deprecated, for removal: This API element is subject to removal in a future version.Finds models matching the given attribute map.MfindFirstByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.util.Map<java.lang.String,java.lang.Boolean> orderBy)Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute.MfindFirstByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderBy)Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attributes.MfindUniqueByAttribute(java.lang.String attributeName, java.lang.Object attributeValue)Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attribute.MfindUniqueByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs)Deprecated, for removal: This API element is subject to removal in a future version.Finds a model matching the given attributes.BaseDaogetBaseDao()Deprecated, for removal: This API element is subject to removal in a future version.FlexibleSearchServicegetFlexibleSearchService()Deprecated, for removal: This API element is subject to removal in a future version.voidsave(M model)Deprecated, for removal: This API element is subject to removal in a future version.Persists the model.voidsaveAll(java.util.Collection<M> models)Deprecated, for removal: This API element is subject to removal in a future version.Save all.voidsetBaseDao(BaseDao baseDao)Deprecated, for removal: This API element is subject to removal in a future version.voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Method Detail
-
findAll
public java.util.List<M> findAll(int count, int start)
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 findUniqueByAttribute(java.lang.String attributeName, java.lang.Object attributeValue) 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 findUniqueByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs) throws AmbiguousIdentifierException
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 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 findFirstByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.util.Map<java.lang.String,java.lang.Boolean> orderBy)
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.
-
findFirstByAttributes
public M findFirstByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderBy)
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 java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
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 java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, int count, int start)
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 java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.util.Map<java.lang.String,java.lang.Boolean> orderBy, int count, int start)
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 java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs)
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 java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, int count, int start)
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 java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderByMap, int count, int start)
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 java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderByMap, int count, int start, boolean excludeSubtypes)
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.- Returns:
- A list of models.
-
countAllByAttributes
public java.lang.Integer countAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, boolean excludeSubtypes)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
public void save(M model)
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:
ModelService.save(java.lang.Object)
-
saveAll
public void saveAll(java.util.Collection<M> models)
Deprecated, for removal: This API element is subject to removal in a future version.Save all.- Parameters:
models- the models
-
copyDirtyAttributes
public M copyDirtyAttributes(M source, M target)
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
public M deepClone(M model, java.lang.String... excludeAttributesFromCopy)
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.
-
setBaseDao
public void setBaseDao(BaseDao baseDao)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
baseDao- the baseDao to set
-
getBaseDao
public BaseDao getBaseDao()
Deprecated, for removal: This API element is subject to removal in a future version.
-
getFlexibleSearchService
public FlexibleSearchService getFlexibleSearchService()
Deprecated, for removal: This API element is subject to removal in a future version.
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-