DefaultGenericDao@Deprecated public class BaseDao extends java.lang.Object implements Dao
| Constructor and Description |
|---|
BaseDao()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
<M extends ItemModel> |
copyDirtyAttributes(M source,
M target)
Deprecated.
Copies dirty attributes from
source model to the target. |
<M extends ItemModel> |
countAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
boolean excludeSubtypes,
java.lang.Class<M> modelClass)
Deprecated.
Counts models matching the given attribute map.
|
<M extends ItemModel> |
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. |
<M extends ItemModel> |
findAll(int count,
int start,
java.lang.Class<M> modelClass)
Deprecated.
Finds all models.
|
<M extends ItemModel> |
findAllByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute.
|
<M extends ItemModel> |
findAllByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
int count,
int start,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute.
|
<M extends ItemModel> |
findAllByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
java.util.Map<java.lang.String,java.lang.Boolean> orderBy,
int count,
int start,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute.
|
<M extends ItemModel> |
findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute map.
|
<M extends ItemModel> |
findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
int count,
int start,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute map.
|
<M extends ItemModel> |
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,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute map.
|
<M extends ItemModel> |
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,
java.lang.Class<M> modelClass)
Deprecated.
Finds models matching the given attribute map.
|
<M> M |
findByBeanProperty(java.util.Collection<M> collection,
java.lang.String propertyName,
java.lang.String propertyValue)
Deprecated.
|
<M extends ItemModel> |
findFirstByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
java.lang.Class<M> modelClass)
Deprecated.
Finds a model matching the given attribute.
|
<M extends ItemModel> |
findFirstByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
java.util.Map<java.lang.String,java.lang.Boolean> orderBy,
java.lang.Class<M> modelClass)
Deprecated.
Finds a model matching the given attribute.
|
<M extends ItemModel> |
findFirstByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
java.util.Map<java.lang.String,java.lang.Boolean> orderBy,
java.lang.Class<M> modelClass)
Deprecated.
Finds a model matching the given attributes.
|
<M extends ItemModel> |
findLastInsertedItem(java.lang.Class<M> modelClass)
Deprecated.
|
<M extends ItemModel> |
findUniqueByAttribute(java.lang.String attributeName,
java.lang.Object attributeValue,
java.lang.Class<M> modelClass)
Deprecated.
Finds a model matching the given attribute.
|
<M extends ItemModel> |
findUniqueByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs,
java.lang.Class<M> modelClass)
Deprecated.
Finds a model matching the given attributes.
|
protected java.util.Set<java.lang.String> |
getAllAttributes(ItemModel model)
Deprecated.
Get all the attributes an ItemModel instance including all the attributes of its super classes.
|
FlexibleSearchService |
getFlexibleSearchService()
Deprecated.
Gets the search service.
|
ModelService |
getModelService()
Deprecated.
Gets the model service.
|
<M extends ItemModel> |
save(M model)
Deprecated.
Persists the model.
|
<M extends ItemModel> |
saveAll(java.util.Collection<M> models)
Deprecated.
Save all.
|
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
Deprecated.
Sets the search service.
|
void |
setModelService(ModelService modelService)
Deprecated.
Sets the model service.
|
public <M extends ItemModel> java.util.List<M> findAll(int count, int start, java.lang.Class<M> modelClass)
count - The max. number of models returned.start - The number of the first record.public <M extends ItemModel> M findUniqueByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.lang.Class<M> modelClass) 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 extends ItemModel> M findUniqueByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.lang.Class<M> modelClass) 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 extends ItemModel> M findFirstByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.lang.Class<M> modelClass)
null is returned.
attributeName - The name of the attribute.attributeValue - The value of the attributepublic <M extends ItemModel> M findFirstByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.util.Map<java.lang.String,java.lang.Boolean> orderBy, java.lang.Class<M> modelClass)
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 extends ItemModel> M findLastInsertedItem(java.lang.Class<M> modelClass)
public <M extends ItemModel> M findFirstByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.util.Map<java.lang.String,java.lang.Boolean> orderBy, java.lang.Class<M> modelClass)
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 <M extends ItemModel> java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, java.lang.Class<M> modelClass)
attributeName - The name of the attribute.attributeValue - The value of the attributepublic <M extends ItemModel> java.util.List<M> findAllByAttribute(java.lang.String attributeName, java.lang.Object attributeValue, int count, int start, java.lang.Class<M> modelClass)
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 <M extends ItemModel> 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, java.lang.Class<M> modelClass)
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 <M extends ItemModel> java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, java.lang.Class<M> modelClass)
attribs - Map providing attribute names and values that will be included in the where clause or null.
The value can be an ItemModel.public <M extends ItemModel> java.util.List<M> findAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, int count, int start, java.lang.Class<M> modelClass)
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 <M extends ItemModel> 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, java.lang.Class<M> modelClass)
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 <M extends ItemModel> 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, java.lang.Class<M> modelClass)
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.modelClass - Service Layer model classpublic <M extends ItemModel> java.lang.Integer countAllByAttributes(java.util.Map<java.lang.String,java.lang.Object> attribs, boolean excludeSubtypes, java.lang.Class<M> modelClass)
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 <M extends ItemModel> void save(M model)
model - the model to saveModelSavingException - if the save operation failedModelService.save(java.lang.Object)public <M extends ItemModel> void saveAll(java.util.Collection<M> models)
models - the modelspublic FlexibleSearchService getFlexibleSearchService()
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
flexibleSearchService - the flexibleSearchService to setpublic ModelService getModelService()
public void setModelService(ModelService modelService)
modelService - the modelService to setpublic <M extends ItemModel> 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 extends ItemModel> 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 copyprotected java.util.Set<java.lang.String> getAllAttributes(ItemModel model)
public <M> M findByBeanProperty(java.util.Collection<M> collection,
java.lang.String propertyName,
java.lang.String propertyValue)
Copyright © 2018 SAP SE. All Rights Reserved.