All Projects → mybatis → cdi

mybatis / cdi

Licence: Apache-2.0 license
MyBatis CDI Extension

Programming Languages

java
68154 projects - #9 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to cdi

generator-jvm
Generate JVM (java, kotlin, scala) project with gradle / maven / sbt build systems and docker / docker-compose for rapid development
Stars: ✭ 40 (+81.82%)
Mutual labels:  java-ee, cdi
agorava-core
Agorava Core API and Implentations
Stars: ✭ 51 (+131.82%)
Mutual labels:  cdi
cdi-test
JUnit extension for easy and efficient testing of CDI components
Stars: ✭ 23 (+4.55%)
Mutual labels:  cdi
Speedment
Speedment is a Stream ORM Java Toolkit and Runtime
Stars: ✭ 1,978 (+8890.91%)
Mutual labels:  java-ee
java-learning-note
Welcome to Java Learning Note! It aims to give you the basic knowledge about Java.
Stars: ✭ 121 (+450%)
Mutual labels:  java-ee
drift-server
Drift server
Stars: ✭ 19 (-13.64%)
Mutual labels:  java-ee
jeeshop
No description or website provided.
Stars: ✭ 39 (+77.27%)
Mutual labels:  java-ee
Javaee7 Samples
Java EE 7 Samples
Stars: ✭ 2,470 (+11127.27%)
Mutual labels:  cdi
javaee8-cookbook
Jakarta EE 8 Cookbook (second edition)
Stars: ✭ 40 (+81.82%)
Mutual labels:  cdi
vaadin-stepbystep-demo-contacts
Step by step demo Vaadin 8 app with simple JPA backend
Stars: ✭ 13 (-40.91%)
Mutual labels:  cdi
cdi-events-playground
Demonstrates the capabilities of Java EE CDI events
Stars: ✭ 23 (+4.55%)
Mutual labels:  cdi
CeDImu
Experimental Philips CD-I emulator written in C++
Stars: ✭ 41 (+86.36%)
Mutual labels:  cdi
pairing-shiro-javaee7
Source code for the "Pairing Apache Shiro and Java EE 7" book
Stars: ✭ 21 (-4.55%)
Mutual labels:  cdi
migrate-Java-EE-app-to-azure
Migrate an existing Java EE workload to Azure
Stars: ✭ 12 (-45.45%)
Mutual labels:  cdi
logging-interceptor
CDI interceptor for logging to slf4j
Stars: ✭ 25 (+13.64%)
Mutual labels:  cdi
further-cdi
🔊 Going further with CDI presentation
Stars: ✭ 28 (+27.27%)
Mutual labels:  cdi
cdi-guide-tutorials
CDI Guide And Tutorials - Many examples of how to use CDI and CDI 2.0 like Qualifiers, Interceptors, Decorators, Lazy Initialization an much more!
Stars: ✭ 29 (+31.82%)
Mutual labels:  cdi
NodeMCU-BlackBox
ESP8266 based CAN-Bus Diagnostic Tool
Stars: ✭ 28 (+27.27%)
Mutual labels:  cdi
jpa-unit
JUnit extension to test javax.persistence entities
Stars: ✭ 28 (+27.27%)
Mutual labels:  cdi
jakartaee8-starter-boilerplate
A boilerplate project for starting a Jakarta EE 8 application in seconds
Stars: ✭ 55 (+150%)
Mutual labels:  cdi

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 provided by the 'jakarta' branch on this project (skip tests when running as transaction testing framework doesn't support jakarta yet).

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 #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

  • Ready to deploy sample web app (Jee7): samples
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].