Giter VIP home page Giter VIP logo

cdi's Introduction

MyBatis CDI Extension

Java CI Coverage Status Maven central Sonatype Nexus (Snapshots) License

mybatis-logo

MyBatis-CDI extension takes care of the lifecycle of MyBatis mappers and SqlSessions. MyBatis components are directly injected into your CDI beans ready to be used, there is no need to create or destroy them. It also provides local and JTA transaction support based on the @Transactional annotation.

Compatibility

CDI API VERSION JDK 17 JDK 11 JDK 8
cdi-1.0 (not supported) N N N
cdi-1.1 Y Y Y
cdi-1.2 Y Y Y
cdi-2.0 (preferred) Y Y Y
cdi-3.0 (not supported) N N N
cdi-4.0 (not supported) N N N

Jakarta EE support is not yet provided by this framework.

Jdk17+ requires jboss-classfilewriter to be at 1.2.5 or it will error, classfilewriter

Building

Maven does not allow multiple auto activated profiles (ie activateByDefault and Jdk). This project supports 3 different CDI support levels currently and was set to default to cdi-1.2. Jdk 8 does not allow add opens and this is needed now for jdk 17. We further are supporting jakarta EE packaging in addition to java EE packaging. This results is a tricky situation. Therefore, we have opted to no longer use activateByDefault which means a build without providing a profile will fail with missing classes. Github actions is provisioned to always provide the specific cdi-api profile. Any localized usage must now do the same as defined below.

The cdi profile can be cdi-1.1, cdi-1.2, or cdi-2.0 and required to run with any of the following.

  • mvn clean install -P"cdi-1.1"
  • mvn clean install -P"cdi-1.2"
  • mvn clean install -P"cdi-2.0"

Testing with Arquillian

In order to test with Arquillian, one class needs to be added to 'JavaArchive' in order for this to load properly. Add 'SqlSessionManagerRegistry.class'.

See attachment on mybatis#86 from 2021-12-30 ArquillianMybatisExample.zip here. This is to be run under jdk 8 to be error free but will run as-is under jdk 11 with an invocation error which still allows it to run. Further updates are needed to get this code example current.

Essentials

Contributed Examples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.