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.Datastore
getItemByIdOrName
(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) void
setDatastore
(dev.morphia.Datastore datastore) void
setDozerMapper
(MapperRegistry dozerMapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoMetadataSpecDao
(MongoMetadataSpecDao mongoMetadataSpecDao) void
setValidationHelper
(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:ItemDao
Retrieves a single Item from the database by its id property or name property.- Specified by:
getItemByIdOrName
in 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: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 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
Pagination
of allItem
records within the range specified by the offset and count parameters.
-
updateItem
Description copied from interface:ItemDao
Updates a given Item.- Specified by:
updateItem
in 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: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 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
-