Class MybatisExtension

  • All Implemented Interfaces:
    javax.enterprise.inject.spi.Extension

    public class MybatisExtension
    extends java.lang.Object
    implements javax.enterprise.inject.spi.Extension
    MyBatis CDI extension.
    Author:
    Frank D. Martinez [mnesarco]
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void afterBeanDiscovery​(javax.enterprise.inject.spi.AfterBeanDiscovery abd, javax.enterprise.inject.spi.BeanManager bm)
      Register all mybatis injectable beans.
      protected <T> void processAnnotatedType​(javax.enterprise.inject.spi.ProcessAnnotatedType<T> pat)
      Collect types of all mappers annotated with Mapper.
      protected <X> void processInjectionTarget​(javax.enterprise.inject.spi.ProcessInjectionTarget<X> event)
      Collect all targets to match Mappers and Session providers dependency.
      protected <T,​X>
      void
      processProducer​(javax.enterprise.inject.spi.ProcessProducer<T,​X> pp)
      Collect all SqlSessionFactory producers annotated with SessionFactoryProvider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MybatisExtension

        public MybatisExtension()
    • Method Detail

      • processAnnotatedType

        protected <T> void processAnnotatedType​(@Observes
                                                javax.enterprise.inject.spi.ProcessAnnotatedType<T> pat)
        Collect types of all mappers annotated with Mapper.
        Type Parameters:
        T - the generic type
        Parameters:
        pat - the pat
      • processProducer

        protected <T,​X> void processProducer​(@Observes
                                                   javax.enterprise.inject.spi.ProcessProducer<T,​X> pp)
        Collect all SqlSessionFactory producers annotated with SessionFactoryProvider.
        Type Parameters:
        T - the generic type
        X - the generic type
        Parameters:
        pp - the pp
      • processInjectionTarget

        protected <X> void processInjectionTarget​(@Observes
                                                  javax.enterprise.inject.spi.ProcessInjectionTarget<X> event)
        Collect all targets to match Mappers and Session providers dependency.
        Type Parameters:
        X - the generic type
        Parameters:
        event - the event
      • afterBeanDiscovery

        protected void afterBeanDiscovery​(@Observes
                                          javax.enterprise.inject.spi.AfterBeanDiscovery abd,
                                          javax.enterprise.inject.spi.BeanManager bm)
        Register all mybatis injectable beans.
        Parameters:
        abd - the abd
        bm - the bm