Class FileEntityViewPersistenceAdapter<View extends IFileEntityView,​File extends IFileEntity<?,​Data> & IFileSizeProviding,​Data extends IFileDataEntity<File>,​Context>

    • Constructor Detail

      • FileEntityViewPersistenceAdapter

        protected FileEntityViewPersistenceAdapter​(Class<View> dtoClass,
                                                   Class<File> fileEntityType,
                                                   Class<Data> fileDataEntityType)
        Creates a file entity adapter for a general file entity.
        Parameters:
        fileEntityType - The type of the file entity.
        fileDataEntityType - The type of the file data entity.
    • Method Detail

      • addSelectCriteria

        protected void addSelectCriteria​(de.xima.cmn.criteria.AttributeSelectCriteriaManager acm)
        Adds additional select criteria for extra attributes needed to construct the view. The default implementation does not add any additional criteria.
        Parameters:
        acm - The attribute select criteria manager to which to add the criteria.
      • addUpdateCriteria

        protected void addUpdateCriteria​(IEntityContext ec,
                                         de.xima.cmn.criteria.UpdateCriteriaManager ucm,
                                         View view)
        Adds additional update criteria for extra attributes that need to be updated when updating the entity. The default implementation does not add any additional criteria.
        Parameters:
        ucm - The update criteria manager to which to add the criteria.
        view - The view from which to take the values.
      • createContextualFilter

        protected abstract de.xima.cmn.criteria.FilterCriterion createContextualFilter​(Context context)
        Creates the filter to limit the database query to the given context.
        Parameters:
        context - The context to which to limit the query.
        Returns:
        The contextual filter.
      • hydrateView

        protected void hydrateView​(View view,
                                   javax.persistence.Tuple tuple)
        Hydrates the view with additional attributes from the loaded tuple. Should be compatible with addSelectCriteria. The default implementation does not hydrate any additional attributes.
        Parameters:
        view - The view to hydrate.
        tuple - The tuple from which to take the values.
      • ignoreLockingVersion

        protected boolean ignoreLockingVersion()
        When set to true, the locking version is ignored. When set to false, an exception is thrown when the locking version does not match.
        Returns:
        Whether to ignore the locking version.
      • newEntity

        protected File newEntity()
        Creates a new empty instance of the entity. The default implementation uses reflection to create a new instance via the default constructor. You may override this method if the class does not have a default constructor or to provide a more efficient way to create a new instance.
        Returns:
        A new instance of the entity.
      • newView

        protected View newView()
        Creates a new empty instance of the view. The default implementation uses reflection to create a new instance via the default constructor. You may override this method if the class does not have a default constructor or to provide a more efficient way to create a new instance.
        Returns:
        A new instance of the view.