public class DMSFileRepository extends JpaRepository<DMSFile>
modelClass
Constructor and Description |
---|
DMSFileRepository() |
Modifier and Type | Method and Description |
---|---|
DMSFile |
findHomeByRelated(Model related) |
List<DMSFile> |
findOffline(int limit,
int offset) |
protected DMSFile |
findOrCreateHome(Model related)
Finds or creates parent folders.
|
protected DMSFile |
getRootParent(Model related)
Gets root parent folder
|
Map<String,Object> |
populate(Map<String,Object> json,
Map<String,Object> context)
Populate the given json map with additional data.
|
void |
remove(DMSFile entity)
Remove the given entity.
|
DMSFile |
save(DMSFile entity)
Save the given entity.
|
DMSFile |
setOffline(DMSFile file,
boolean offline) |
Map<String,Object> |
validate(Map<String,Object> json,
Map<String,Object> context)
Validate the given json map before persisting.
|
public DMSFile save(DMSFile entity)
Repository
Depending on the implementation, it may return same entity or a copy of it. For example JPA implementation may return a copy if the given entity can't be managed.
save
in interface Repository<DMSFile>
save
in class JpaRepository<DMSFile>
entity
- the entity object to saveprotected DMSFile findOrCreateHome(Model related)
related
- model@Nullable protected DMSFile getRootParent(Model related)
related
- modelpublic void remove(DMSFile entity)
Repository
remove
in interface Repository<DMSFile>
remove
in class JpaRepository<DMSFile>
entity
- the entity objectpublic Map<String,Object> validate(Map<String,Object> json, Map<String,Object> context)
Repository
This method is called before the json map is converted to model object.
validate
in interface Repository<DMSFile>
validate
in class JpaRepository<DMSFile>
json
- the json map to validatecontext
- the contextpublic Map<String,Object> populate(Map<String,Object> json, Map<String,Object> context)
Repository
This method is called before returning the json data as response.
populate
in interface Repository<DMSFile>
populate
in class JpaRepository<DMSFile>
json
- the json map to populatecontext
- the context