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>
  • Constructor Details

    • DMSFileRepository

      public DMSFileRepository()
  • Method Details

    • findHomeByRelated

      @Nullable public DMSFile findHomeByRelated(Model related)
    • 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 interface Repository<DMSFile>
      Overrides:
      save in class JpaRepository<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 interface Repository<DMSFile>
      Overrides:
      remove in class JpaRepository<DMSFile>
      Parameters:
      entity - the entity object
    • setOffline

      public DMSFile setOffline(DMSFile file, boolean offline)
    • findOffline

      public List<DMSFile> findOffline(int limit, int offset)
    • 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 interface Repository<DMSFile>
      Overrides:
      validate in class JpaRepository<DMSFile>
      Parameters:
      json - the json map to validate
      context - 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 interface Repository<DMSFile>
      Overrides:
      populate in class JpaRepository<DMSFile>
      Parameters:
      json - the json map to populate
      context - the context
      Returns:
      the json map itself