Class MongoApplicationDao
java.lang.Object
dev.getelements.elements.dao.mongo.application.MongoApplicationDao
- All Implemented Interfaces:
ApplicationDao
Created by patricktwohig on 7/10/15.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdateInactiveApplication(Application application) Creates a new application and inserts it into the database.findActiveApplication(String nameOrId) Finds an activeApplicationwith the supplied name or id.findActiveMongoApplication(String mongoApplicationNameOrId) Gets all active applications.getActiveApplications(int offset, int count) Gets the active applications registered in the databse given the offset and count.getActiveApplications(int offset, int count, String search) Gets the active applications registered in the databse given the offset and count.getActiveApplicationWithoutAttributes(String nameOrId) Extension of getActiveApplication with no attributes set.getActiveMongoApplication(String mongoApplicationNameOrId) dev.morphia.DatastorevoidsetDatastore(dev.morphia.Datastore datastore) voidsetMapperRegistry(MapperRegistry dozerMapperRegistry) voidsoftDeleteApplication(String nameOrId) Deletes an Application with the specific name or identifier.updateActiveApplication(String nameOrId, Application application) Updates an application with the specific name/identifiers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.dao.ApplicationDao
getActiveApplication
-
Constructor Details
-
MongoApplicationDao
public MongoApplicationDao()
-
-
Method Details
-
createOrUpdateInactiveApplication
Description copied from interface:ApplicationDaoCreates a new application and inserts it into the database. The returned value represents theApplicationas it was inserted into the database.If the existing
Applicationobjects is int eh database however is flagged as hidden or inactive this will simply reinstate the old record.- Specified by:
createOrUpdateInactiveApplicationin interfaceApplicationDao- Parameters:
application- the application- Returns:
- the application instance as it was created
-
getActiveApplications
Description copied from interface:ApplicationDaoGets all active applications.- Specified by:
getActiveApplicationsin interfaceApplicationDao- Returns:
- a
Pagination<Application>of all activeApplicationinstances
-
getActiveApplications
Description copied from interface:ApplicationDaoGets the active applications registered in the databse given the offset and count.- Specified by:
getActiveApplicationsin interfaceApplicationDao- Parameters:
offset- the offsetcount- the count- Returns:
- a
PaginationofApplicationinstances
-
getActiveApplications
Description copied from interface:ApplicationDaoGets the active applications registered in the databse given the offset and count.- Specified by:
getActiveApplicationsin interfaceApplicationDao- Parameters:
offset- the offsetcount- the countsearch- a query to filter the results- Returns:
- a
PaginationofApplicationinstances
-
findActiveApplication
Description copied from interface:ApplicationDaoFinds an activeApplicationwith the supplied name or id.- Specified by:
findActiveApplicationin interfaceApplicationDao- Parameters:
nameOrId- the name or id- Returns:
- an
Optionalof theApplication
-
getActiveApplicationWithoutAttributes
Description copied from interface:ApplicationDaoExtension of getActiveApplication with no attributes set. ofNotFoundExceptionif the object cannot be found, or is inactive.- Specified by:
getActiveApplicationWithoutAttributesin interfaceApplicationDao- Returns:
- an Application instance, never null
-
updateActiveApplication
Description copied from interface:ApplicationDaoUpdates an application with the specific name/identifiers. When changing the application name the ID must be specified.- Specified by:
updateActiveApplicationin interfaceApplicationDao- Parameters:
nameOrId- the name, or idapplication- theApplicationobject to write- Returns:
- the
Applicationobject as it was persisted to the database.
-
softDeleteApplication
Description copied from interface:ApplicationDaoDeletes an Application with the specific name or identifier. The application is no actually removed, but rather it is flagged as inactive to preserve any consistency with dependent data.- Specified by:
softDeleteApplicationin interfaceApplicationDao- Parameters:
nameOrId- the name, or id
-
findActiveMongoApplication
-
getActiveMongoApplication
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
setMapperRegistry
-