Class MongoItemDao

java.lang.Object
dev.getelements.elements.dao.mongo.goods.MongoItemDao
All Implemented Interfaces:
ItemDao

public class MongoItemDao extends Object implements ItemDao
  • Constructor Details

    • MongoItemDao

      public MongoItemDao()
  • Method Details

    • getItemByIdOrName

      public Item getItemByIdOrName(String identifier)
      Description copied from interface: ItemDao
      Retrieves a single Item from the database by its id property or name property.
      Specified by:
      getItemByIdOrName in interface ItemDao
      Parameters:
      identifier - Either an id or name of the Item
      Returns:
      An representation of the Item as it exists in the database.
    • findMongoItem

      public Optional<MongoItem> findMongoItem(Item item)
    • findMongoItem

      public Optional<MongoItem> findMongoItem(String id)
    • findMongoItem

      public Optional<MongoItem> findMongoItem(org.bson.types.ObjectId objectId)
    • getMongoItem

      public MongoItem getMongoItem(Item item)
    • getMongoItem

      public MongoItem getMongoItem(org.bson.types.ObjectId objectId)
    • getPublicItems

      public List<MongoItem> getPublicItems()
    • findMongoItemByNameOrId

      public Optional<MongoItem> findMongoItemByNameOrId(String itemNameOrId)
    • getMongoItemByNameOrId

      public MongoItem getMongoItemByNameOrId(String itemNameOrId)
    • refresh

      public MongoItem refresh(MongoItem mongoItem)
    • getItems

      public Pagination<Item> getItems(int offset, int count, List<String> tags, String category, String query)
      Description copied from interface: ItemDao
      Returns all Items in the subset of items filtered by tags and the given offset position. The count parameter should be greater than 0, but may also be overridden by a system defined limit on the number of records that can be returned at once.
      Specified by:
      getItems in interface ItemDao
      Parameters:
      offset - the offset, which should be a positive integer
      count - a maximum amount of items to be returned, which should be a positive integer greater than 0
      tags - A set of tags to filter items by
      category -
      query - A search query to filter items by
      Returns:
      A Pagination of all Item records within the range specified by the offset and count parameters.
    • updateItem

      public Item updateItem(Item item)
      Description copied from interface: ItemDao
      Updates a given Item.
      Specified by:
      updateItem in interface ItemDao
      Parameters:
      item - An Item to be updated.
      Returns:
      The updated representation of the Item as it exists in the database
    • updateItemWtihMetadata

      public Item updateItemWtihMetadata(Item item, dev.morphia.query.Query<MongoItem> query)
    • createItem

      public Item createItem(Item item)
      Description copied from interface: ItemDao
      Creates a new Item. All properties except for the Id property must be set to valid values. The name property must also be unique in order for this call to succeed.
      Specified by:
      createItem in interface ItemDao
      Parameters:
      item - A new Item
      Returns:
      A representation of the Item as it exists in the database after a successful write.
    • getDatastore

      public dev.morphia.Datastore getDatastore()
    • setDatastore

      @Inject public void setDatastore(dev.morphia.Datastore datastore)
    • getDozerMapper

      public MapperRegistry getDozerMapper()
    • setDozerMapper

      @Inject public void setDozerMapper(MapperRegistry dozerMapperRegistry)
    • getValidationHelper

      public ValidationHelper getValidationHelper()
    • setValidationHelper

      @Inject public void setValidationHelper(ValidationHelper validationHelper)
    • getMongoDBUtils

      public MongoDBUtils getMongoDBUtils()
    • setMongoDBUtils

      @Inject public void setMongoDBUtils(MongoDBUtils mongoDBUtils)
    • getMongoMetadataSpecDao

      public MongoMetadataSpecDao getMongoMetadataSpecDao()
    • setMongoMetadataSpecDao

      @Inject public void setMongoMetadataSpecDao(MongoMetadataSpecDao mongoMetadataSpecDao)