Class TestInMemoryDataStore

java.lang.Object
io.jmix.samples.rest.service.TestInMemoryDataStore
All Implemented Interfaces:
DataStore

@Component("test_InMemoryDataStore") @Scope("prototype") public class TestInMemoryDataStore extends Object implements DataStore
  • Constructor Details

    • TestInMemoryDataStore

      public TestInMemoryDataStore()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: DataStore
      This data store instance name with which it is registered in Stores.
      Specified by:
      getName in interface DataStore
    • setName

      public void setName(String name)
      Description copied from interface: DataStore
      Sets this data store instance name with which it is registered in Stores.
      Specified by:
      setName in interface DataStore
    • load

      @Nullable public Object load(LoadContext<?> context)
      Description copied from interface: DataStore
      Loads a single entity instance.
      Specified by:
      load in interface DataStore
      Returns:
      the loaded object, or null if not found
    • loadList

      public List<Object> loadList(LoadContext<?> context)
      Description copied from interface: DataStore
      Loads collection of entity instances.
      Specified by:
      loadList in interface DataStore
      Returns:
      a list of instances, or empty list if nothing found
    • getCount

      public long getCount(LoadContext<?> context)
      Description copied from interface: DataStore
      Returns the number of entity instances for the given query passed in the LoadContext.
      Specified by:
      getCount in interface DataStore
      Returns:
      number of instances in the storage
    • save

      public Set<Object> save(SaveContext context)
      Description copied from interface: DataStore
      Saves a collection of entity instances.
      Specified by:
      save in interface DataStore
      Returns:
      set of saved instances
    • loadValues

      public List<KeyValueEntity> loadValues(ValueLoadContext context)
      Description copied from interface: DataStore
      Loads list of key-value pairs.
      Specified by:
      loadValues in interface DataStore
      Parameters:
      context - defines a query for scalar values and a list of keys for returned KeyValueEntity
      Returns:
      list of KeyValueEntity instances
    • getCount

      public long getCount(ValueLoadContext context)
      Description copied from interface: DataStore
      Returns the number of key-value pairs for the given query passed in the ValueLoadContext.
      Specified by:
      getCount in interface DataStore
      Parameters:
      context - defines the query
      Returns:
      number of key-value pairs in the data store
    • clear

      public void clear()