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 DMSFilefindHomeByRelated(Model related)List<DMSFile>findOffline(int limit, int offset)protected DMSFilefindOrCreateHome(Model related)Finds or creates parent folders.protected DMSFilegetRootParent(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.voidremove(DMSFile entity)Remove the given entity.DMSFilesave(DMSFile entity)Save the given entity.DMSFilesetOffline(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:RepositorySave 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:
savein interfaceRepository<DMSFile>- Overrides:
savein 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:RepositoryRemove the given entity.- Specified by:
removein interfaceRepository<DMSFile>- Overrides:
removein 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:RepositoryValidate the given json map before persisting.This method is called before the json map is converted to model object.
- Specified by:
validatein interfaceRepository<DMSFile>- Overrides:
validatein 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:RepositoryPopulate the given json map with additional data.This method is called before returning the json data as response.
- Specified by:
populatein interfaceRepository<DMSFile>- Overrides:
populatein classJpaRepository<DMSFile>- Parameters:
json- the json map to populatecontext- the context- Returns:
- the json map itself
-
-