Package com.axelor.dms.db.repo
Class DMSFileRepository
- java.lang.Object
-
- com.axelor.db.JpaRepository<DMSFile>
-
- com.axelor.dms.db.repo.DMSFileRepository
-
- All Implemented Interfaces:
Repository<DMSFile>
public class DMSFileRepository extends JpaRepository<DMSFile>
-
-
Field Summary
-
Fields inherited from class com.axelor.db.JpaRepository
modelClass
-
-
Constructor Summary
Constructors Constructor Description DMSFileRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 folderMap<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.
-
-
-
Method Detail
-
save
public DMSFile save(DMSFile entity)
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
protected DMSFile findOrCreateHome(Model related)
Finds or creates parent folders.- Parameters:
related
- model- Returns:
- home parent
-
getRootParent
@Nullable protected DMSFile getRootParent(Model related)
Gets root parent folder- Parameters:
related
- model- Returns:
- root parent folder
-
remove
public void remove(DMSFile entity)
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
-
validate
public Map<String,Object> validate(Map<String,Object> json, Map<String,Object> context)
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
public Map<String,Object> populate(Map<String,Object> json, Map<String,Object> context)
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
-
-