Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module for hibernate 6.4 #691

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
221 changes: 221 additions & 0 deletions hypersistence-utils-hibernate-64/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
<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">

<parent>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-parent</artifactId>
<version>3.7.1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>hypersistence-utils-hibernate-64</artifactId>
<version>3.7.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>hypersistence-utils-hibernate-64</name>
<description>Utilities for Spring and Hibernate ORM 6.4 or newer</description>

<dependencies>

<dependency>
<groupId>net.ttddyy</groupId>
<artifactId>datasource-proxy</artifactId>
<version>${datasource-proxy.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
<version>${jackson-module-jakarta-xmlbind-annotation}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.javamoney</groupId>
<artifactId>moneta</artifactId>
<version>${moneta.version}</version>
<type>pom</type>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>${hibernate.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>${ehcache.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jakarta-bind.api.version}</version>
</dependency>

<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>${hikari.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring-data.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<!-- Testing -->

<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.hypersistence.utils.hibernate.type</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<properties>
<jdk.version>11</jdk.version>
<jdk-test.version>17</jdk-test.version>
<maven.compiler.release>${jdk.version}</maven.compiler.release>
<maven.compiler.testRelease>${jdk-test.version}</maven.compiler.testRelease>

<hibernate.version>6.4.1.Final</hibernate.version>

<jackson-module-jakarta-xmlbind-annotation>2.15.3</jackson-module-jakarta-xmlbind-annotation>
<guava.version>32.1.3-jre</guava.version>
<moneta.version>1.4.2</moneta.version>

<ehcache.version>3.10.8</ehcache.version>
<jakarta-bind.api.version>4.0.1</jakarta-bind.api.version>

<hikari.version>5.0.1</hikari.version>
<aspectj.version>1.9.20.1</aspectj.version>
<spring.version>6.1.2</spring.version>
<spring-data.version>3.2.0</spring-data.version>

</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package io.hypersistence.utils.common;

import java.io.InputStream;
import java.net.URL;

/**
* <code>ClassLoaderUtils</code> - Class loading related utilities holder.
*
* @author Vlad Mihalcea
* @since 2.1.0
*/
public final class ClassLoaderUtils {

private ClassLoaderUtils() {
throw new UnsupportedOperationException("ClassLoaderUtils is not instantiable!");
}

/**
* Load the available ClassLoader
*
* @return ClassLoader
*/
public static ClassLoader getClassLoader() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
return (classLoader != null) ? classLoader : ClassLoaderUtils.class.getClassLoader();
}

/**
* Load the Class denoted by the given string representation
*
* @param className class string representation
* @param <T> class generic type
* @return Class
* @throws ClassNotFoundException if the class cannot be resolved
*/
@SuppressWarnings("unchecked")
public static <T> Class<T> loadClass(String className) throws ClassNotFoundException {
return (Class<T>) getClassLoader().loadClass(className);
}

/**
* Find if Class denoted by the given string representation is loadable
*
* @param className class string representation
* @return Class
*/
@SuppressWarnings("unchecked")
public static boolean findClass(String className) {
try {
return getClassLoader().loadClass(className) != null;
} catch (ClassNotFoundException e) {
return false;
} catch (NoClassDefFoundError e) {
return false;
}
}

/**
* Get the resource URL
*
* @param resourceName resource name
* @return resource URL
*/
public static URL getResource(String resourceName) {
return getClassLoader().getResource(resourceName);
}

/**
* Get the resource InputStream
*
* @param resourceName resource name
* @return resource InputStream
*/
public static InputStream getResourceAsStream(String resourceName) {
return getClassLoader().getResourceAsStream(resourceName);
}
}
Loading