Class ForbidJpqlUpdateDeletePostProcessor

  • All Implemented Interfaces:
    org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

    public class ForbidJpqlUpdateDeletePostProcessor
    extends java.lang.Object
    implements org.springframework.core.PriorityOrdered, org.springframework.beans.factory.config.BeanPostProcessor
    A BeanPostProcessor that inspects the Query methods on a repository bean and dies when a query is written in JPQL that tries to modify the database with an update or delete. This is to prevent us from writing queries that will skip through the auditing layer that envers provides.
    • Constructor Detail

      • ForbidJpqlUpdateDeletePostProcessor

        public ForbidJpqlUpdateDeletePostProcessor()
    • Method Detail

      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • postProcessBeforeInitialization

        public java.lang.Object postProcessBeforeInitialization​(java.lang.Object bean,
                                                                java.lang.String beanName)
                                                         throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException
      • postProcessAfterInitialization

        public java.lang.Object postProcessAfterInitialization​(java.lang.Object bean,
                                                               java.lang.String beanName)
                                                        throws org.springframework.beans.BeansException
        Specified by:
        postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException