Class BaseDao
java.lang.Object
de.fraunhofer.iosb.ilt.frostclient.dao.BaseDao
- All Implemented Interfaces:
Dao
The implementation of a data access object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.http.entity.ContentType -
Constructor Summary
ConstructorsConstructorDescriptionBaseDao(SensorThingsService service, Entity parent, NavigationPropertyEntitySet navigationLink) BaseDao(SensorThingsService service, EntityType entityType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreate a new entity.voidDelete an entity.find(long id) Find the entity with the given Long id.find(Entity parent, NavigationPropertyEntity npe) Find the entity related to the given parent, like the Thing for a Datastream.Find an entity.Find the entity with the given String id.Find an entity.protected SensorThingsServicevoidUpdate the given entity with the given patch.query()Start a query to find an entity collection.voidUpdate an entity.
-
Field Details
-
APPLICATION_JSON_PATCH
public static final org.apache.http.entity.ContentType APPLICATION_JSON_PATCH
-
-
Constructor Details
-
BaseDao
Constructor.- Parameters:
service- the service to operate onentityType- the type of entity to deal with.
-
-
Method Details
-
create
Description copied from interface:DaoCreate a new entity.- Specified by:
createin interfaceDao- Parameters:
entity- the entity to create- Throws:
ServiceFailureException- the operation failed
-
find
Description copied from interface:DaoFind an entity.- Specified by:
findin interfaceDao- Parameters:
id- the entity's unique id- Returns:
- the entity
- Throws:
ServiceFailureException- the operation failed
-
find
Find the entity with the given Long id. This is a shorthand for find(new IdLong(id));- Parameters:
id- the entity's unique id- Returns:
- the entity
- Throws:
ServiceFailureException- the operation failed
-
find
Find the entity with the given String id. This is a shorthand for find(new IdLong(id));- Parameters:
id- the entity's unique id- Returns:
- the entity
- Throws:
ServiceFailureException- the operation failed
-
find
Description copied from interface:DaoFind an entity.- Specified by:
findin interfaceDao- Parameters:
uri- the entity's URI- Returns:
- the entity
- Throws:
ServiceFailureException- the operation failed
-
update
Description copied from interface:DaoUpdate an entity.- Specified by:
updatein interfaceDao- Parameters:
entity- the entity to update- Throws:
ServiceFailureException- the operation failed
-
patch
public void patch(Entity entity, List<com.github.fge.jsonpatch.JsonPatchOperation> patch) throws ServiceFailureException Description copied from interface:DaoUpdate the given entity with the given patch. Does not update the entity object itself. To see the result, fetch it anew from the server.- Specified by:
patchin interfaceDao- Parameters:
entity- The entity to update on the server.patch- The patch to apply to the entity.- Throws:
ServiceFailureException- the operation failed
-
delete
Description copied from interface:DaoDelete an entity.- Specified by:
deletein interfaceDao- Parameters:
entity- the entity to delete- Throws:
ServiceFailureException- the operation failed
-
query
Description copied from interface:DaoStart a query to find an entity collection. -
getService
-