Class JPAQuarkusHelperImpl

  • All Implemented Interfaces:
    io.mateu.util.IJPAHelper, EventListener, javax.servlet.ServletContextListener

    @AutoService(io.mateu.util.IJPAHelper.class)
    @ApplicationScoped
    public class JPAQuarkusHelperImpl
    extends Object
    implements io.mateu.util.IJPAHelper, javax.servlet.ServletContextListener
    • Constructor Detail

      • JPAQuarkusHelperImpl

        public JPAQuarkusHelperImpl()
    • Method Detail

      • post

        @PostConstruct
        public void post()
      • transact

        public void transact​(io.mateu.util.persistence.JPATransaction t)
                      throws Throwable
        Specified by:
        transact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • transact

        public void transact​(io.mateu.util.persistence.JPATransaction t,
                             io.mateu.util.runnable.RunnableThrowsThrowable callback)
                      throws Throwable
        Specified by:
        transact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • transact

        public void transact​(String persistenceUnit,
                             io.mateu.util.persistence.JPATransaction t)
                      throws Throwable
        Specified by:
        transact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • transact

        public void transact​(String persistenceUnit,
                             io.mateu.util.persistence.JPATransaction t,
                             io.mateu.util.runnable.RunnableThrowsThrowable callback)
                      throws Throwable
        Specified by:
        transact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • printStackTrace

        public void printStackTrace​(Throwable e)
      • closeEMFs

        public void closeEMFs()
        Specified by:
        closeEMFs in interface io.mateu.util.IJPAHelper
      • setEMF

        public void setEMF​(javax.persistence.EntityManagerFactory f)
        Specified by:
        setEMF in interface io.mateu.util.IJPAHelper
      • getEMF

        public javax.persistence.EntityManagerFactory getEMF()
        Specified by:
        getEMF in interface io.mateu.util.IJPAHelper
      • getEMF

        public javax.persistence.EntityManagerFactory getEMF​(String persistenceUnit)
        Specified by:
        getEMF in interface io.mateu.util.IJPAHelper
      • notransact

        public void notransact​(io.mateu.util.persistence.JPATransaction t)
                        throws Throwable
        Specified by:
        notransact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • notransact

        public void notransact​(io.mateu.util.persistence.JPATransaction t,
                               boolean printException)
                        throws Throwable
        Specified by:
        notransact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • notransact

        public void notransact​(String persistenceUnit,
                               io.mateu.util.persistence.JPATransaction t)
                        throws Throwable
        Specified by:
        notransact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • notransact

        public void notransact​(String persistenceUnit,
                               io.mateu.util.persistence.JPATransaction t,
                               boolean printException)
                        throws Throwable
        Specified by:
        notransact in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • find

        public <T> T find​(Class<T> type,
                          Object id)
                   throws Throwable
        Specified by:
        find in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • findAll

        public <T> List<T> findAll​(javax.persistence.EntityManager em,
                                   Class<T> type)
                            throws Throwable
        Specified by:
        findAll in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • findAll

        public <T> List<T> findAll​(Class<T> type)
                            throws Throwable
        Specified by:
        findAll in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • getAll

        public <T> List<T> getAll​(Class<T> type)
        Specified by:
        getAll in interface io.mateu.util.IJPAHelper
      • get

        public <T> T get​(Class<T> type,
                         Object id)
        Specified by:
        get in interface io.mateu.util.IJPAHelper
      • getStreams

        public org.jinq.jpa.JinqJPAStreamProvider getStreams()
        Specified by:
        getStreams in interface io.mateu.util.IJPAHelper
      • getStreams

        public org.jinq.jpa.JinqJPAStreamProvider getStreams​(String persistenceUnit)
        Specified by:
        getStreams in interface io.mateu.util.IJPAHelper
      • selectValue

        public <T> Optional<T> selectValue​(String jpql)
                                    throws Throwable
        Specified by:
        selectValue in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • selectObjects

        public List selectObjects​(String jpql)
                           throws Throwable
        Specified by:
        selectObjects in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • selectObjects

        public List selectObjects​(String jpql,
                                  Class targetClass)
                           throws Throwable
        Specified by:
        selectObjects in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • nativeSelectValue

        public Object nativeSelectValue​(String sql)
                                 throws Throwable
        Specified by:
        nativeSelectValue in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • sqlSelectPage

        public List<Object[]> sqlSelectPage​(String jpql,
                                            int offset,
                                            int limit)
                                     throws Throwable
        Specified by:
        sqlSelectPage in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • sqlCount

        public int sqlCount​(String sql)
                     throws Throwable
        Specified by:
        sqlCount in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • runNativeSqlUpdate

        public String runNativeSqlUpdate​(String sql)
                                  throws Throwable
        Specified by:
        runNativeSqlUpdate in interface io.mateu.util.IJPAHelper
        Throws:
        Throwable
      • deleteWithId

        public <T> void deleteWithId​(javax.persistence.EntityManager em,
                                     Class<T> type,
                                     Object id)
        Specified by:
        deleteWithId in interface io.mateu.util.IJPAHelper
      • find

        public <T> T find​(javax.persistence.EntityManager em,
                          Class<T> type,
                          Object... params)
        Specified by:
        find in interface io.mateu.util.IJPAHelper
      • find

        public <T> T find​(Class<T> type,
                          Object... params)
        Specified by:
        find in interface io.mateu.util.IJPAHelper
      • createQuery

        public <T> javax.persistence.TypedQuery<T> createQuery​(javax.persistence.EntityManager em,
                                                               Class<T> type,
                                                               Object[] params)
        Specified by:
        createQuery in interface io.mateu.util.IJPAHelper
      • list

        public <T> List<T> list​(javax.persistence.EntityManager em,
                                Class<T> type,
                                Object... params)
        Specified by:
        list in interface io.mateu.util.IJPAHelper
      • delete

        public <T> void delete​(javax.persistence.EntityManager em,
                               Class<T> type,
                               Object... params)
        Specified by:
        delete in interface io.mateu.util.IJPAHelper
      • count

        public <T> int count​(javax.persistence.EntityManager em,
                             Class<T> type)
        Specified by:
        count in interface io.mateu.util.IJPAHelper
      • count

        public <T> int count​(javax.persistence.EntityManager em,
                             Class<T> type,
                             Object... params)
        Specified by:
        count in interface io.mateu.util.IJPAHelper
      • createQueryForCount

        public <T> javax.persistence.TypedQuery<T> createQueryForCount​(javax.persistence.EntityManager em,
                                                                       Class<T> type,
                                                                       Object[] params)
        Specified by:
        createQueryForCount in interface io.mateu.util.IJPAHelper
      • update

        public void update​(Object a,
                           String fieldName,
                           Object value)
        Specified by:
        update in interface io.mateu.util.IJPAHelper
      • contextInitialized

        public void contextInitialized​(javax.servlet.ServletContextEvent servletContextEvent)
        Specified by:
        contextInitialized in interface javax.servlet.ServletContextListener
      • contextDestroyed

        public void contextDestroyed​(javax.servlet.ServletContextEvent servletContextEvent)
        Specified by:
        contextDestroyed in interface javax.servlet.ServletContextListener