Class MongoDistinctInventoryItemDao
java.lang.Object
dev.getelements.elements.dao.mongo.goods.MongoDistinctInventoryItemDao
- All Implemented Interfaces:
DistinctInventoryItemDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountDistinctMetadataField
(String profileId, String fieldName) Gets a total number of distinct values for provided metadata field name.createDistinctInventoryItem
(DistinctInventoryItem distinctInventoryItem) Creates a distinct inventory item.void
deleteDistinctInventoryItem
(String inventoryItemId) Deletes a distinct inventory item.findDistinctInventoryItemForOwner
(String id, String ownerId) Finds the distinct inventory item with the owner ID and owner ID.dev.morphia.Datastore
Creates a distinct inventory item.getDistinctInventoryItems
(int offset, int count, String userId, String profileId, boolean publicOnly) Gets a listing distinct inventory items.getDistinctInventoryItems
(int offset, int count, String userId, String profileId, boolean publicOnly, String queryString) Gets a listing distinct inventory items filtering by query string.getTotalDistinctInventoryItems
(String userId, String profileId, boolean publicOnly, String queryString) Gets a total number of items for provided userId or profileIdvoid
setBooleanQueryParser
(BooleanQueryParser booleanQueryParser) void
setDatastore
(dev.morphia.Datastore datastore) void
setMapper
(MapperRegistry mapperRegistry) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setMongoItemDao
(MongoItemDao mongoItemDao) void
setMongoProfileDao
(MongoProfileDao mongoProfileDao) void
setMongoUserDao
(MongoUserDao mongoUserDao) void
setValidationHelper
(ValidationHelper validationHelper) updateDistinctInventoryItem
(DistinctInventoryItem distinctInventoryItem) Updates a distinct inventory item.
-
Constructor Details
-
MongoDistinctInventoryItemDao
public MongoDistinctInventoryItemDao()
-
-
Method Details
-
createDistinctInventoryItem
public DistinctInventoryItem createDistinctInventoryItem(DistinctInventoryItem distinctInventoryItem) Description copied from interface:DistinctInventoryItemDao
Creates a distinct inventory item.- Specified by:
createDistinctInventoryItem
in interfaceDistinctInventoryItemDao
- Parameters:
distinctInventoryItem
- the distinct inventory item.- Returns:
- a distinct inventory item
-
getDistinctInventoryItem
Description copied from interface:DistinctInventoryItemDao
Creates a distinct inventory item.- Specified by:
getDistinctInventoryItem
in interfaceDistinctInventoryItemDao
- Parameters:
id
- the distinct inventory item.- Returns:
- a distinct inventory item
-
getDistinctInventoryItems
public Pagination<DistinctInventoryItem> getDistinctInventoryItems(int offset, int count, String userId, String profileId, boolean publicOnly) Description copied from interface:DistinctInventoryItemDao
Gets a listing distinct inventory items.- Specified by:
getDistinctInventoryItems
in interfaceDistinctInventoryItemDao
- Parameters:
offset
- the offset from the beginning of the datasetcount
- the number of items to returnuserId
- checked id of userprofileId
- checked id of profile.publicOnly
- mark inventory items that are referred to only this with publicVisible flag- Returns:
- a
Pagination<InventoryItem>
-
getDistinctInventoryItems
public Pagination<DistinctInventoryItem> getDistinctInventoryItems(int offset, int count, String userId, String profileId, boolean publicOnly, String queryString) Description copied from interface:DistinctInventoryItemDao
Gets a listing distinct inventory items filtering by query string.- Specified by:
getDistinctInventoryItems
in interfaceDistinctInventoryItemDao
- Parameters:
offset
- the offset from the beginning of the datasetcount
- the number of items to returnuserId
- checked id of userprofileId
- checked id of profile.publicOnly
- mark inventory items that are referred to only this with publicVisible flag- Returns:
- a
Pagination<InventoryItem>
-
getTotalDistinctInventoryItems
public Long getTotalDistinctInventoryItems(String userId, String profileId, boolean publicOnly, String queryString) Description copied from interface:DistinctInventoryItemDao
Gets a total number of items for provided userId or profileId- Specified by:
getTotalDistinctInventoryItems
in interfaceDistinctInventoryItemDao
- Parameters:
userId
- checked id of userprofileId
- checked id of profile.publicOnly
- mark inventory items that are referred to only this with publicVisible flag- Returns:
- a number of items
-
countDistinctMetadataField
Description copied from interface:DistinctInventoryItemDao
Gets a total number of distinct values for provided metadata field name.- Specified by:
countDistinctMetadataField
in interfaceDistinctInventoryItemDao
- Parameters:
profileId
- optional value to count items that belongs only to that profilefieldName
- metadata field name- Returns:
- a number of distinct values
-
updateDistinctInventoryItem
public DistinctInventoryItem updateDistinctInventoryItem(DistinctInventoryItem distinctInventoryItem) Description copied from interface:DistinctInventoryItemDao
Updates a distinct inventory item.- Specified by:
updateDistinctInventoryItem
in interfaceDistinctInventoryItemDao
- Parameters:
distinctInventoryItem
- the distinct inventory item- Returns:
- the item, as written to the database
-
deleteDistinctInventoryItem
Description copied from interface:DistinctInventoryItemDao
Deletes a distinct inventory item.- Specified by:
deleteDistinctInventoryItem
in interfaceDistinctInventoryItemDao
- Parameters:
inventoryItemId
- the distinct inventory item
-
findDistinctInventoryItemForOwner
Description copied from interface:DistinctInventoryItemDao
Finds the distinct inventory item with the owner ID and owner ID. This can be used for an ownership check of the specified item.- Specified by:
findDistinctInventoryItemForOwner
in interfaceDistinctInventoryItemDao
- Parameters:
id
- theDistinctInventoryItem.getId()
ownerId
- the owner of the ID (either user or profile)- Returns:
- the item
-
getMapper
-
setMapper
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getMongoItemDao
-
setMongoItemDao
-
getMongoUserDao
-
setMongoUserDao
-
getMongoProfileDao
-
setMongoProfileDao
-
getValidationHelper
-
setValidationHelper
-
getMongoDBUtils
-
setMongoDBUtils
-
getBooleanQueryParser
-
setBooleanQueryParser
-