Skip to content

Commit e6ccf13

Browse files
cigalyvladmihalcea
authored andcommitted
Add support for Hibernate 7.1 #802
1 parent 44e32c8 commit e6ccf13

File tree

353 files changed

+36722
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+36722
-6
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@ That's it!
2020

2121
The Hypersistence Utils project gives you general-purpose utilities for both Spring and Hibernate.
2222

23-
The main advantage of this project is that it supports a broad range of Hibernate versions, spanning from Hibernate ORM **7.0**, to **6.6**, **6.5**, **6.4**, **6.3**, **6.2**, **6.1**, **6.0**, **5.6**, **5.5**, **5.4**, **5.3**, **5.2**, **5.1**, and **5.0**.
23+
The main advantage of this project is that it supports a broad range of Hibernate versions, spanning from Hibernate ORM **7.1**, **7.0**, to **6.6**, **6.5**, **6.4**, **6.3**, **6.2**, **6.1**, **6.0**, **5.6**, **5.5**, **5.4**, **5.3**, **5.2**, **5.1**, and **5.0**.
2424

2525
### Installation Guide
2626

2727
Depending on the Hibernate version you are using, you need to add the following dependency:
2828

29+
#### Hibernate 7.1
30+
31+
<dependency>
32+
<groupId>io.hypersistence</groupId>
33+
<artifactId>hypersistence-utils-hibernate-71</artifactId>
34+
<version>3.10.1</version>
35+
</dependency>
36+
2937
#### Hibernate 7.0
3038

3139
<dependency>
@@ -100,7 +108,7 @@ Moreover, the dependency version is extremely important because, from time to ti
100108

101109
If you are using JSON Types, then you might be interested in setting the following dependencies based on your Hibernate version:
102110

103-
###### Hibernate 6
111+
###### Hibernate 7 and 6
104112

105113
````xml
106114
<dependency>
@@ -172,9 +180,9 @@ If you are mapping a PostgreSQL-specific column type (e.g., `inet`, `hstore`, `a
172180
The `JsonType` allows you to map JSON column types, no matter if you're using Oracle,
173181
SQL Server, PostgreSQL or MySQL.
174182

175-
###### Hibernate 6
183+
###### Hibernate 7 and 6
176184

177-
If you're using Hibernate 6, you can map any JSON column to `Map`, `List`, POJO, `String`, or `JsonNode` entity property:
185+
If you're using Hibernate 7 or 6, you can map any JSON column to `Map`, `List`, POJO, `String`, or `JsonNode` entity property:
178186

179187
````java
180188
@Type(JsonType.class)

hypersistence-utils-hibernate-63/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
<!--<hibernate.version>6.3.2.Final</hibernate.version>-->
206206
<!--<hibernate.version>6.4.10.Final</hibernate.version>-->
207207
<!--<hibernate.version>6.5.3.Final</hibernate.version>-->
208-
<hibernate.version>6.6.18.Final</hibernate.version>
208+
<hibernate.version>6.6.28.Final</hibernate.version>
209209

210210
<jackson-module-jakarta-xmlbind-annotation>2.15.3</jackson-module-jakarta-xmlbind-annotation>
211211
<guava.version>32.1.3-jre</guava.version>

hypersistence-utils-hibernate-70/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
<maven.compiler.release>${jdk.version}</maven.compiler.release>
210210
<maven.compiler.testRelease>${jdk-test.version}</maven.compiler.testRelease>
211211

212-
<hibernate.version>7.0.2.Final</hibernate.version>
212+
<hibernate.version>7.0.10.Final</hibernate.version>
213213

214214
<jackson-module-jakarta-xmlbind-annotation>2.15.3</jackson-module-jakarta-xmlbind-annotation>
215215
<guava.version>32.1.3-jre</guava.version>
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
3+
<parent>
4+
<groupId>io.hypersistence</groupId>
5+
<artifactId>hypersistence-utils-parent</artifactId>
6+
<version>3.10.4-SNAPSHOT</version>
7+
</parent>
8+
9+
<modelVersion>4.0.0</modelVersion>
10+
11+
<artifactId>hypersistence-utils-hibernate-71</artifactId>
12+
<version>3.10.4-SNAPSHOT</version>
13+
<packaging>jar</packaging>
14+
15+
<name>hypersistence-utils-hibernate-71</name>
16+
<description>Utilities for Spring and Hibernate ORM 7.1</description>
17+
18+
<dependencies>
19+
20+
<dependency>
21+
<groupId>net.ttddyy</groupId>
22+
<artifactId>datasource-proxy</artifactId>
23+
<version>${datasource-proxy.version}</version>
24+
<scope>provided</scope>
25+
<optional>true</optional>
26+
</dependency>
27+
28+
<dependency>
29+
<groupId>org.hibernate.orm</groupId>
30+
<artifactId>hibernate-core</artifactId>
31+
<version>${hibernate.version}</version>
32+
<scope>provided</scope>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>com.fasterxml.jackson.module</groupId>
37+
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
38+
<version>${jackson-module-jakarta-xmlbind-annotation}</version>
39+
<scope>provided</scope>
40+
<optional>true</optional>
41+
</dependency>
42+
43+
<dependency>
44+
<groupId>com.google.guava</groupId>
45+
<artifactId>guava</artifactId>
46+
<version>${guava.version}</version>
47+
<scope>provided</scope>
48+
<optional>true</optional>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>org.javamoney</groupId>
53+
<artifactId>moneta</artifactId>
54+
<version>${moneta.version}</version>
55+
<type>pom</type>
56+
<scope>provided</scope>
57+
<optional>true</optional>
58+
</dependency>
59+
60+
<dependency>
61+
<groupId>org.hibernate.orm</groupId>
62+
<artifactId>hibernate-jcache</artifactId>
63+
<version>${hibernate.version}</version>
64+
<scope>test</scope>
65+
</dependency>
66+
67+
<dependency>
68+
<groupId>org.ehcache</groupId>
69+
<artifactId>ehcache</artifactId>
70+
<version>${ehcache.version}</version>
71+
<scope>test</scope>
72+
<exclusions>
73+
<exclusion>
74+
<groupId>org.glassfish.jaxb</groupId>
75+
<artifactId>jaxb-runtime</artifactId>
76+
</exclusion>
77+
</exclusions>
78+
</dependency>
79+
80+
<dependency>
81+
<groupId>jakarta.xml.bind</groupId>
82+
<artifactId>jakarta.xml.bind-api</artifactId>
83+
<version>${jakarta-bind.api.version}</version>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>com.zaxxer</groupId>
88+
<artifactId>HikariCP</artifactId>
89+
<version>${hikari.version}</version>
90+
<exclusions>
91+
<exclusion>
92+
<groupId>org.slf4j</groupId>
93+
<artifactId>slf4j-api</artifactId>
94+
</exclusion>
95+
</exclusions>
96+
<scope>provided</scope>
97+
<optional>true</optional>
98+
</dependency>
99+
100+
<dependency>
101+
<groupId>org.aspectj</groupId>
102+
<artifactId>aspectjrt</artifactId>
103+
<version>${aspectj.version}</version>
104+
<scope>provided</scope>
105+
<optional>true</optional>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>org.aspectj</groupId>
110+
<artifactId>aspectjweaver</artifactId>
111+
<version>${aspectj.version}</version>
112+
<scope>provided</scope>
113+
<optional>true</optional>
114+
</dependency>
115+
116+
<dependency>
117+
<groupId>org.springframework</groupId>
118+
<artifactId>spring-beans</artifactId>
119+
<version>${spring.version}</version>
120+
<scope>provided</scope>
121+
<optional>true</optional>
122+
</dependency>
123+
124+
<dependency>
125+
<groupId>org.springframework</groupId>
126+
<artifactId>spring-context</artifactId>
127+
<version>${spring.version}</version>
128+
<scope>provided</scope>
129+
<optional>true</optional>
130+
</dependency>
131+
132+
<dependency>
133+
<groupId>org.springframework</groupId>
134+
<artifactId>spring-tx</artifactId>
135+
<version>${spring.version}</version>
136+
<scope>provided</scope>
137+
<optional>true</optional>
138+
</dependency>
139+
140+
<dependency>
141+
<groupId>org.springframework</groupId>
142+
<artifactId>spring-orm</artifactId>
143+
<version>${spring.version}</version>
144+
<scope>provided</scope>
145+
<optional>true</optional>
146+
</dependency>
147+
148+
<dependency>
149+
<groupId>org.springframework.data</groupId>
150+
<artifactId>spring-data-jpa</artifactId>
151+
<version>${spring-data.version}</version>
152+
<scope>provided</scope>
153+
<optional>true</optional>
154+
</dependency>
155+
156+
<!-- Testing -->
157+
158+
<dependency>
159+
<groupId>org.hibernate.orm</groupId>
160+
<artifactId>hibernate-envers</artifactId>
161+
<version>${hibernate.version}</version>
162+
<scope>test</scope>
163+
</dependency>
164+
165+
<dependency>
166+
<groupId>org.springframework</groupId>
167+
<artifactId>spring-test</artifactId>
168+
<version>${spring.version}</version>
169+
<type>jar</type>
170+
<scope>test</scope>
171+
</dependency>
172+
173+
<dependency>
174+
<groupId>org.jspecify</groupId>
175+
<artifactId>jspecify</artifactId>
176+
<version>${jspecify.version}</version>
177+
<scope>test</scope>
178+
</dependency>
179+
180+
</dependencies>
181+
182+
<build>
183+
<plugins>
184+
<plugin>
185+
<groupId>org.apache.maven.plugins</groupId>
186+
<artifactId>maven-jar-plugin</artifactId>
187+
<version>${maven-jar-plugin.version}</version>
188+
<configuration>
189+
<archive>
190+
<manifestEntries>
191+
<Automatic-Module-Name>io.hypersistence.utils.hibernate.type</Automatic-Module-Name>
192+
</manifestEntries>
193+
</archive>
194+
</configuration>
195+
<executions>
196+
<execution>
197+
<goals>
198+
<goal>test-jar</goal>
199+
</goals>
200+
</execution>
201+
</executions>
202+
</plugin>
203+
</plugins>
204+
</build>
205+
206+
<properties>
207+
<jdk.version>17</jdk.version>
208+
<jdk-test.version>17</jdk-test.version>
209+
<maven.compiler.release>${jdk.version}</maven.compiler.release>
210+
<maven.compiler.testRelease>${jdk-test.version}</maven.compiler.testRelease>
211+
212+
<hibernate.version>7.1.0.Final</hibernate.version>
213+
214+
<jackson-module-jakarta-xmlbind-annotation>2.15.3</jackson-module-jakarta-xmlbind-annotation>
215+
<guava.version>32.1.3-jre</guava.version>
216+
<moneta.version>1.4.2</moneta.version>
217+
218+
<ehcache.version>3.10.8</ehcache.version>
219+
<jakarta-bind.api.version>4.0.1</jakarta-bind.api.version>
220+
221+
<hikari.version>5.0.1</hikari.version>
222+
<aspectj.version>1.9.20.1</aspectj.version>
223+
<spring.version>7.0.0-M5</spring.version>
224+
<spring-data.version>4.0.0-M3</spring-data.version>
225+
<jspecify.version>1.0.0</jspecify.version>
226+
227+
</properties>
228+
229+
</project>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package io.hypersistence.utils.common;
2+
3+
import java.io.InputStream;
4+
import java.net.URL;
5+
6+
/**
7+
* <code>ClassLoaderUtils</code> - Class loading related utilities holder.
8+
*
9+
* @author Vlad Mihalcea
10+
* @since 2.1.0
11+
*/
12+
public final class ClassLoaderUtils {
13+
14+
private ClassLoaderUtils() {
15+
throw new UnsupportedOperationException("ClassLoaderUtils is not instantiable!");
16+
}
17+
18+
/**
19+
* Load the available ClassLoader
20+
*
21+
* @return ClassLoader
22+
*/
23+
public static ClassLoader getClassLoader() {
24+
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
25+
return (classLoader != null) ? classLoader : ClassLoaderUtils.class.getClassLoader();
26+
}
27+
28+
/**
29+
* Load the Class denoted by the given string representation
30+
*
31+
* @param className class string representation
32+
* @param <T> class generic type
33+
* @return Class
34+
* @throws ClassNotFoundException if the class cannot be resolved
35+
*/
36+
@SuppressWarnings("unchecked")
37+
public static <T> Class<T> loadClass(String className) throws ClassNotFoundException {
38+
return (Class<T>) getClassLoader().loadClass(className);
39+
}
40+
41+
/**
42+
* Find if Class denoted by the given string representation is loadable
43+
*
44+
* @param className class string representation
45+
* @return Class
46+
*/
47+
@SuppressWarnings("unchecked")
48+
public static boolean findClass(String className) {
49+
try {
50+
return getClassLoader().loadClass(className) != null;
51+
} catch (ClassNotFoundException e) {
52+
return false;
53+
} catch (NoClassDefFoundError e) {
54+
return false;
55+
}
56+
}
57+
58+
/**
59+
* Get the resource URL
60+
*
61+
* @param resourceName resource name
62+
* @return resource URL
63+
*/
64+
public static URL getResource(String resourceName) {
65+
return getClassLoader().getResource(resourceName);
66+
}
67+
68+
/**
69+
* Get the resource InputStream
70+
*
71+
* @param resourceName resource name
72+
* @return resource InputStream
73+
*/
74+
public static InputStream getResourceAsStream(String resourceName) {
75+
return getClassLoader().getResourceAsStream(resourceName);
76+
}
77+
}

0 commit comments

Comments
 (0)