Class MongoItemDao
java.lang.Object
dev.getelements.elements.dao.mongo.goods.MongoItemDao
- All Implemented Interfaces:
ItemDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateItem(Item item) Creates a new Item.findMongoItem(Item item) findMongoItem(String id) findMongoItem(org.bson.types.ObjectId objectId) findMongoItemByNameOrId(String itemNameOrId) dev.morphia.DatastoregetItemByIdOrName(String identifier) Retrieves a single Item from the database by its id property or name property.Returns all Items in the subset of items filtered by tags and the given offset position.getMongoItem(Item item) getMongoItem(org.bson.types.ObjectId objectId) getMongoItemByNameOrId(String itemNameOrId) voidsetDatastore(dev.morphia.Datastore datastore) voidsetDozerMapper(MapperRegistry dozerMapperRegistry) voidsetMongoDBUtils(MongoDBUtils mongoDBUtils) voidsetMongoMetadataSpecDao(MongoMetadataSpecDao mongoMetadataSpecDao) voidsetValidationHelper(ValidationHelper validationHelper) updateItem(Item item) Updates a given Item.updateItemWtihMetadata(Item item, dev.morphia.query.Query<MongoItem> query)
-
Constructor Details
-
MongoItemDao
public MongoItemDao()
-
-
Method Details
-
getItemByIdOrName
Description copied from interface:ItemDaoRetrieves a single Item from the database by its id property or name property.- Specified by:
getItemByIdOrNamein interfaceItemDao- Parameters:
identifier- Either an id or name of the Item- Returns:
- An representation of the Item as it exists in the database.
-
findMongoItem
-
findMongoItem
-
findMongoItem
-
getMongoItem
-
getMongoItem
-
getPublicItems
-
findMongoItemByNameOrId
-
getMongoItemByNameOrId
-
refresh
-
getItems
public Pagination<Item> getItems(int offset, int count, List<String> tags, String category, String query) Description copied from interface:ItemDaoReturns 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:
getItemsin interfaceItemDao- Parameters:
offset- the offset, which should be a positive integercount- a maximum amount of items to be returned, which should be a positive integer greater than 0tags- A set of tags to filter items bycategory-query- A search query to filter items by- Returns:
- A
Paginationof allItemrecords within the range specified by the offset and count parameters.
-
updateItem
Description copied from interface:ItemDaoUpdates a given Item.- Specified by:
updateItemin interfaceItemDao- Parameters:
item- An Item to be updated.- Returns:
- The updated representation of the Item as it exists in the database
-
updateItemWtihMetadata
-
createItem
Description copied from interface:ItemDaoCreates 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:
createItemin interfaceItemDao- 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
-
setDozerMapper
-
getValidationHelper
-
setValidationHelper
-
getMongoDBUtils
-
setMongoDBUtils
-
getMongoMetadataSpecDao
-
setMongoMetadataSpecDao
-