Class AbstractModelService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.model.impl.AbstractModelService
- All Implemented Interfaces:
ModelService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
DefaultModelService,MockModelService
See
ModelService. The basics of the servicelayer are implemented here.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Collection>
TgetAll(Collection<? extends Object> sources, T result) Convenience method to load all objects in a source collection and adding the loaded objects to a result collection.<T extends Collection>
TgetAll(Collection<? extends Object> sources, T result, String conversionType) Convenience method to load all objects in a source collection and adding the loaded objects to a result collection.<T extends Collection>
TgetAllSources(Collection<? extends Object> models, T result) Convenience method to load all the sources of a given collection of modelsprotected abstract ObjectgetModelForPersistentValue(Object persistentValue) protected abstract ObjectgetPersistentValueForModel(Object model) voidSaves several model model instances at once.<T> TtoModelLayer(Object persistentValue) Converts arbitrary values into a representation to be used inside the model layer.<T> TtoPersistenceLayer(Object modelValue) Converts arbitrary model layer values into a form which may be used in persistence layer.Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.servicelayer.model.ModelService
attach, clearTransactionsSettings, clone, clone, clone, clone, create, create, detach, detach, detachAll, disableTransactions, enableTransactions, get, get, get, getAttributeValue, getAttributeValue, getAttributeValues, getByExample, getModelType, getModelType, getModelTypeClass, getSource, getWithLock, initDefaults, isAttached, isModified, isNew, isRemoved, isSourceAttached, isUniqueConstraintErrorAsRootCause, isUpToDate, lock, lock, refresh, remove, remove, removeAll, removeAll, save, saveAll, saveAll, setAttributeValue, setAttributeValue
-
Constructor Details
-
AbstractModelService
public AbstractModelService()
-
-
Method Details
-
saveAll
Description copied from interface:ModelServiceSaves several model model instances at once. If at least one instance causes a validation error no modifications are written.- Specified by:
saveAllin interfaceModelService- Parameters:
models- the model instances to save- Throws:
ModelSavingException- See Also:
-
toModelLayer
Description copied from interface:ModelServiceConverts arbitrary values into a representation to be used inside the model layer. Generally this converts all object with existing model converter into their model representation. Collections and maps are copied on demand. Any other objects stay unchanged.- Specified by:
toModelLayerin interfaceModelService- Parameters:
persistentValue- the value loaded from persistence layer.
-
getModelForPersistentValue
-
toPersistenceLayer
Description copied from interface:ModelServiceConverts arbitrary model layer values into a form which may be used in persistence layer. Generally this converts all models back into their source. Collections and maps are copied on demand. Any other objects stay unchanged.- Specified by:
toPersistenceLayerin interfaceModelService- Parameters:
modelValue- the value to be translated back into persistence layer form
-
getPersistentValueForModel
-
getAllSources
Description copied from interface:ModelServiceConvenience method to load all the sources of a given collection of models- Specified by:
getAllSourcesin interfaceModelService- Parameters:
models- the objects for which to retrieve model instancesresult- the collection to add the model instances to- Returns:
- the result collects
-
getAll
Description copied from interface:ModelServiceConvenience method to load all objects in a source collection and adding the loaded objects to a result collection.- Specified by:
getAllin interfaceModelService- Parameters:
sources- the objects for which to retrieve model instancesresult- the collection to add the model instances to- Returns:
- the result collects
- See Also:
-
getAll
public <T extends Collection> T getAll(Collection<? extends Object> sources, T result, String conversionType) Description copied from interface:ModelServiceConvenience method to load all objects in a source collection and adding the loaded objects to a result collection. This method allows to specify the type to lookup the converter!- Specified by:
getAllin interfaceModelService- Parameters:
sources- the objects for which to retrieve model instancesresult- the collection to add the model instances toconversionType- the type to be used for looking up the model converter- Returns:
- the result collects
- See Also:
-