public interface DriveBackend
| Modifier and Type | Method and Description |
|---|---|
void |
connect(String hostURL,
String username,
String password,
String database,
String table)
Creates a connection to the backend
|
void |
delete(Query queryDetails)
Deletes an object from the backend if found
|
void |
deleteAll(Query queryDetails)
Deletes all entries matched by the query
|
List<DriveObject> |
findAll(Query queryDetails)
Read all objects matching the query parameters
|
List<DriveObject> |
findAll(Query queryDetails,
Pageable pageable)
Read all objects matching the query parameters
|
DriveObject |
findOne(Query queryDetails)
Reads one object matching the query parameters
|
void |
prepareEntity(Class<?> clazz)
Prepares to use a specific entity.
|
Iterable |
rawQuery(Object query)
Deprecated.
|
void |
replace(DriveObject element,
Query query)
Replaces the first element that matches the query
|
void |
setService(DriveService service)
Sets the service the backend is used by.
|
void |
write(DriveObject driveObject,
Query query)
Writes an object to the database.
|
void |
writeReplace(DriveObject element,
Query queryDetails)
Removes one element equal to the query details and adds the element in place
|
void connect(String hostURL, String username, String password, String database, String table)
hostURL - host url used when establishing the connectionusername - the username used when establishing the connectionpassword - the password used when establishing the connectiondatabase - database used when connecting. (Some backends might have this in their url)table - default table used. Depending on the type a default table might be neededvoid write(DriveObject driveObject, Query query)
driveObject - object to savequery - used to define a custom collectionDriveObject findOne(Query queryDetails)
queryDetails - the query to useList<DriveObject> findAll(Query queryDetails)
queryDetails - the query to useList<DriveObject> findAll(Query queryDetails, Pageable pageable)
queryDetails - the query to usepageable - the pageable used for paginationvoid setService(DriveService service)
service - service the backend is used byvoid writeReplace(DriveObject element, Query queryDetails)
element - element to insertqueryDetails - used to filter for deletionvoid replace(DriveObject element, Query query)
element - element that will replace the matched elementquery - used to filter for replacingvoid deleteAll(Query queryDetails)
queryDetails - the query details used to filtervoid delete(Query queryDetails)
queryDetails - the query details used to filter@Deprecated Iterable rawQuery(Object query)
query - backend dependant. For MongoDB see QueryBuildervoid prepareEntity(Class<?> clazz)
clazz - the class of the entity to saveCopyright © 2020. All rights reserved.