Package com.axelor.dms.db.repo
Class DMSFileRepository
- All Implemented Interfaces:
Repository<DMSFile>
-
Field Summary
Fields inherited from class com.axelor.db.JpaRepository
modelClass
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindHomeByRelated
(Model related) findOffline
(int limit, int offset) protected DMSFile
findOrCreateHome
(Model related) Finds or creates parent folders.protected DMSFile
getRootParent
(Model related) Gets root parent folderPopulate the given json map with additional data.void
Remove the given entity.Save the given entity.setOffline
(DMSFile file, boolean offline) Validate the given json map before persisting.
-
Constructor Details
-
DMSFileRepository
public DMSFileRepository()
-
-
Method Details
-
findHomeByRelated
-
save
Description copied from interface:Repository
Save the given entity.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.
- Specified by:
save
in interfaceRepository<DMSFile>
- Overrides:
save
in classJpaRepository<DMSFile>
- Parameters:
entity
- the entity object to save- Returns:
- an instance of the entity with saved state
-
findOrCreateHome
Finds or creates parent folders.- Parameters:
related
- model- Returns:
- home parent
-
getRootParent
Gets root parent folder- Parameters:
related
- model- Returns:
- root parent folder
-
remove
Description copied from interface:Repository
Remove the given entity.- Specified by:
remove
in interfaceRepository<DMSFile>
- Overrides:
remove
in classJpaRepository<DMSFile>
- Parameters:
entity
- the entity object
-
setOffline
-
findOffline
-
validate
Description copied from interface:Repository
Validate the given json map before persisting.This method is called before the json map is converted to model object.
- Specified by:
validate
in interfaceRepository<DMSFile>
- Overrides:
validate
in classJpaRepository<DMSFile>
- Parameters:
json
- the json map to validatecontext
- the context- Returns:
- validated json map
-
populate
Description copied from interface:Repository
Populate the given json map with additional data.This method is called before returning the json data as response.
- Specified by:
populate
in interfaceRepository<DMSFile>
- Overrides:
populate
in classJpaRepository<DMSFile>
- Parameters:
json
- the json map to populatecontext
- the context- Returns:
- the json map itself
-