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 activeApplication
with 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.Datastore
void
setDatastore
(dev.morphia.Datastore datastore) void
setMapperRegistry
(MapperRegistry dozerMapperRegistry) void
softDeleteApplication
(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, wait
Methods inherited from interface dev.getelements.elements.sdk.dao.ApplicationDao
getActiveApplication
-
Constructor Details
-
MongoApplicationDao
public MongoApplicationDao()
-
-
Method Details
-
createOrUpdateInactiveApplication
Description copied from interface:ApplicationDao
Creates a new application and inserts it into the database. The returned value represents theApplication
as it was inserted into the database.If the existing
Application
objects is int eh database however is flagged as hidden or inactive this will simply reinstate the old record.- Specified by:
createOrUpdateInactiveApplication
in interfaceApplicationDao
- Parameters:
application
- the application- Returns:
- the application instance as it was created
-
getActiveApplications
Description copied from interface:ApplicationDao
Gets all active applications.- Specified by:
getActiveApplications
in interfaceApplicationDao
- Returns:
- a
Pagination<Application>
of all activeApplication
instances
-
getActiveApplications
Description copied from interface:ApplicationDao
Gets the active applications registered in the databse given the offset and count.- Specified by:
getActiveApplications
in interfaceApplicationDao
- Parameters:
offset
- the offsetcount
- the count- Returns:
- a
Pagination
ofApplication
instances
-
getActiveApplications
Description copied from interface:ApplicationDao
Gets the active applications registered in the databse given the offset and count.- Specified by:
getActiveApplications
in interfaceApplicationDao
- Parameters:
offset
- the offsetcount
- the countsearch
- a query to filter the results- Returns:
- a
Pagination
ofApplication
instances
-
findActiveApplication
Description copied from interface:ApplicationDao
Finds an activeApplication
with the supplied name or id.- Specified by:
findActiveApplication
in interfaceApplicationDao
- Parameters:
nameOrId
- the name or id- Returns:
- an
Optional
of theApplication
-
getActiveApplicationWithoutAttributes
Description copied from interface:ApplicationDao
Extension of getActiveApplication with no attributes set. ofNotFoundException
if the object cannot be found, or is inactive.- Specified by:
getActiveApplicationWithoutAttributes
in interfaceApplicationDao
- Returns:
- an Application instance, never null
-
updateActiveApplication
Description copied from interface:ApplicationDao
Updates an application with the specific name/identifiers. When changing the application name the ID must be specified.- Specified by:
updateActiveApplication
in interfaceApplicationDao
- Parameters:
nameOrId
- the name, or idapplication
- theApplication
object to write- Returns:
- the
Application
object as it was persisted to the database.
-
softDeleteApplication
Description copied from interface:ApplicationDao
Deletes 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:
softDeleteApplication
in 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
-