Examples for connecting MySQL interjecting with Spring, Hibernate, JPA, JTA, Atomikos standalone or in Tomcat
# | dependency | version |
---|---|---|
1 | SpringFramework |
4.3.2.RELEASE |
2 | Hibernate |
5.2.2.Final |
3 | Atomikos |
4.0.4 |
4 | JPA |
2.1 |
# | Example | Spring | Hibernate | JPA | Distributed Transaction | Tested | Remarks |
---|---|---|---|---|---|---|---|
1 | hibernate standalone | ❌ | ✅ | ❌ | ❌ | ✅ | Standalone Hibernate example with hibernate.cfg.xml |
2 | hibernate jpa | ❌ | ✅ | ✅ | ❌ | ✅ | Using persistence.xml to config JPA |
3 | spring hibernate | ✅ | ✅ | ❌ | ❌ | ✅ | Using c3p0 datasource and hibernate session factory. |
4 | spring hibernate jpa | ✅ | ✅ | ✅ | ❌ | ✅ | Using none persistence.xml, all JPA configuration is managed by spring. |
5 | spring hibernate atomikos | ✅ | ✅ | ✅ | ✅ | ✅ | Using hibernate session facotry with Atomikos Transaction manager, Annotation drived TX. |
6 | spring hibernate jpa atomikos | ✅ | ✅ | ✅ | ✅ | ✅ | Using JPA with atomikos transaction as JTA, and self-defined AtomikosJtaPlatform. |
7 | spring hibernate jpa atomikos jndi | ✅ | ✅ | ✅ | ✅ | ✅ | Using JPA with atomikos transaction as JTA, and JNDI deployed by tomcat. |
8 | hibernate Interface oriented entity | ❌ | ✅ | ❌ | ❌ | ✅ | Standalone Hibernate example using interface instaed of class to define entity, and HQL. |