Class JpaUtils.CriteriaVersionUpdater<E,​R,​T>

  • Enclosing class:
    JpaUtils

    public abstract static class JpaUtils.CriteriaVersionUpdater<E,​R,​T>
    extends Object
    Creates a custom wrapper that initialises commonly used JPA variables in order to increment entity's root version. You can customise the version update through apply() and run it with the incrementRootVersion methods.
    Since:
    9.4
    • Field Detail

      • cb

        protected final javax.persistence.criteria.CriteriaBuilder cb
      • q

        protected final javax.persistence.criteria.CriteriaQuery<R> q
      • entity

        protected final javax.persistence.criteria.Root<? extends E> entity
    • Constructor Detail

      • CriteriaVersionUpdater

        public CriteriaVersionUpdater​(org.hibernate.SessionFactory sessionFactory,
                                      Class<? extends E> entity,
                                      Class<R> result,
                                      VersioningSupplement<T> versioningSupplement)
    • Method Detail

      • apply

        protected abstract void apply()
        It should fetch the unique, single entry whose root version needs to be incremented.
      • incrementRootVersion

        public void incrementRootVersion()
        Triggers root version incrementation if the root exists.