DefaultGenericDao@Deprecated public abstract class GenericDao<M extends ItemModel> extends java.lang.Object implements Dao
Generic 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 and Description |
|---|
GenericDao()
Deprecated.
Instantiates a new generic dao.
|
| Modifier and Type | Method and Description |
|---|---|
M |
copyDirtyAttributes(M source,
M target)
Deprecated.
Copies dirty attributes from
source model to the target. |
java.lang.Integer |
countAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
boolean excludeSubtypes)
Deprecated.
Counts models matching the given attribute map.
|
M |
deepClone(M model,
java.lang.String... excludeAttributesFromCopy)
Deprecated.
Copies all attributes that are marked as loaded from
model into a new copy of the same
ItemModel type. |
java.util.List<M> |
findAll(int count,
int start)
Deprecated.
Finds all models.
|
java.util.List<M> |
findAllByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
Deprecated.
Finds models matching the given attribute.
|
java.util.List<M> |
findAllByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
int count,
int start)
Deprecated.
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.
Finds models matching the given attribute.
|
java.util.List<M> |
findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs)
Deprecated.
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.
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.
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.
Finds models matching the given attribute map.
|
M |
findFirstByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
java.util.Map<java.lang.String,java.lang.Boolean> orderBy)
Deprecated.
Finds a model matching the given attribute.
|
M |
findFirstByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
java.util.Map<java.lang.String,java.lang.Boolean> orderBy)
Deprecated.
Finds a model matching the given attributes.
|
M |
findUniqueByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue)
Deprecated.
Finds a model matching the given attribute.
|
M |
findUniqueByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs)
Deprecated.
Finds a model matching the given attributes.
|
BaseDao |
getBaseDao()
Deprecated.
|
FlexibleSearchService |
getFlexibleSearchService()
Deprecated.
|
void |
save(M model)
Deprecated.
Persists the model.
|
void |
saveAll(java.util.Collection<M> models)
Deprecated.
Save all.
|
void |
setBaseDao(BaseDao baseDao)
Deprecated.
|
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
Deprecated.
|
public java.util.List<M> findAll(int count, int start)
count - The max. number of models returned.start - The number of the first record.public M findUniqueByAttribute(java.lang.String attributeName, java.lang.Object attributeValue) throws AmbiguousIdentifierException
AmbiguousIdentifierException is thrown. If no model was found null is returned.
attributeName - The name of the attribute.attributeValue - The value of the attributeAmbiguousIdentifierException - If more than one model was found.public M findUniqueByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs) throws AmbiguousIdentifierException
AmbiguousIdentifierException is thrown. If no model was found null is returned.
attribs - A map of attribute names and valuesAmbiguousIdentifierException - If more than one model was found.public M findFirstByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.util.Map<java.lang.String,java.lang.Boolean> orderBy)
null is returned.
attributeName - The name of the attribute.attributeValue - The value of the attributeorderBy - Map providing attribute names that will be included in the order by clause . The boolean
value determines whether the sort order should be ascending (true) or descending (
false).public M findFirstByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderBy)
null is returned.
attribs - A map of attribute names and valuesorderBy - Map providing attribute names that will be included in the order by clause. The boolean
value determines whether the sort order should be ascending (true) or descending (
false).public java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue)
attributeName - The name of the attribute.attributeValue - The value of the attributepublic java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, int count, int start)
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.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)
attributeName - The name of the attribute.attributeValue - The value of the attributeorderBy - Map providing attribute names that will be included in the order by clause . 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.public java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs)
attribs - Map providing attribute names and values that will be included in the where clause or null.
The value can be an ItemModel .public java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, int count, int start)
attribs - Map providing attribute names and values that will be included in the where clause or null.
The value can be an ItemModel.count - The max. number of models returned.start - The number of the first record.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)
attribs - Map providing attribute names and values that will be included in the where clause or null.
The value can be an ItemModel.orderByMap - Map providing attribute names that will be included in the order by clause. 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.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)
attribs - Map providing attribute names and values that will be included in the where clause or null.
The value can be an ItemModel.orderByMap - Map providing attribute names that will be included in the order by clause. 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.public java.lang.Integer countAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
boolean excludeSubtypes)
attribs - Map providing attribute names and values that will be included in the where clause or null.
The value can be an ItemModel .excludeSubtypes - Use if you want to exclude the subtyps so in the case of a Product no Color- or SizeVariants will be
given back.public void save(M model)
model - the model to saveModelSavingException - if the save operation failedModelService.save(java.lang.Object)public void saveAll(java.util.Collection<M> models)
models - the modelspublic M copyDirtyAttributes(M source, M target)
source model to the target.source - A model to read dirty attributes from.target - A model to updated with dirty values of the source.target model.public M deepClone(M model, java.lang.String... excludeAttributesFromCopy)
model into a new copy of the same
ItemModel type. Note that both models are detached from the ModelContext when using this method
you should explicitly call ModelService.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
model - A model to copyexcludeAttributesFromCopy - the exclude attributes from copypublic void setBaseDao(BaseDao baseDao)
baseDao - the baseDao to setpublic BaseDao getBaseDao()
public FlexibleSearchService getFlexibleSearchService()
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
Copyright © 2018 SAP SE. All Rights Reserved.