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

public abstract class AbstractModelService extends AbstractService implements ModelService
See ModelService. The basics of the servicelayer are implemented here.
See Also:
  • Constructor Details

    • AbstractModelService

      public AbstractModelService()
  • Method Details

    • saveAll

      public void saveAll(Object... models) throws ModelSavingException
      Description copied from interface: ModelService
      Saves several model model instances at once. If at least one instance causes a validation error no modifications are written.
      Specified by:
      saveAll in interface ModelService
      Parameters:
      models - the model instances to save
      Throws:
      ModelSavingException
      See Also:
    • toModelLayer

      public <T> T toModelLayer(Object persistentValue)
      Description copied from interface: ModelService
      Converts 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:
      toModelLayer in interface ModelService
      Parameters:
      persistentValue - the value loaded from persistence layer.
    • getModelForPersistentValue

      protected abstract Object getModelForPersistentValue(Object persistentValue)
    • toPersistenceLayer

      public <T> T toPersistenceLayer(Object modelValue)
      Description copied from interface: ModelService
      Converts 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:
      toPersistenceLayer in interface ModelService
      Parameters:
      modelValue - the value to be translated back into persistence layer form
    • getPersistentValueForModel

      protected abstract Object getPersistentValueForModel(Object model)
    • getAllSources

      public <T extends Collection> T getAllSources(Collection<? extends Object> models, T result)
      Description copied from interface: ModelService
      Convenience method to load all the sources of a given collection of models
      Specified by:
      getAllSources in interface ModelService
      Parameters:
      models - the objects for which to retrieve model instances
      result - the collection to add the model instances to
      Returns:
      the result collects
    • getAll

      public <T extends Collection> T getAll(Collection<? extends Object> sources, T result)
      Description copied from interface: ModelService
      Convenience method to load all objects in a source collection and adding the loaded objects to a result collection.
      Specified by:
      getAll in interface ModelService
      Parameters:
      sources - the objects for which to retrieve model instances
      result - 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: ModelService
      Convenience 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:
      getAll in interface ModelService
      Parameters:
      sources - the objects for which to retrieve model instances
      result - the collection to add the model instances to
      conversionType - the type to be used for looking up the model converter
      Returns:
      the result collects
      See Also: