Skip to content

Commit d8e2b3a

Browse files
committed
initialize
0 parents  commit d8e2b3a

File tree

154 files changed

+13876
-0
lines changed

Some content is hidden

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

154 files changed

+13876
-0
lines changed

pom.xml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
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>org.sonatype.oss</groupId>
5+
<artifactId>oss-parent</artifactId>
6+
<version>7</version>
7+
</parent>
8+
9+
<modelVersion>4.0.0</modelVersion>
10+
11+
<licenses>
12+
<license>
13+
<name>The Apache Software License, Version 2.0</name>
14+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
15+
</license>
16+
</licenses>
17+
18+
<artifactId>hibernate-types-52</artifactId>
19+
<version>55.5.1</version>
20+
<packaging>jar</packaging>
21+
22+
<name>hibernate-types-52</name>
23+
<description>Hibernate 5.2 extra Types.</description>
24+
25+
<properties>
26+
<jdk.version>1.8</jdk.version>
27+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
28+
29+
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
30+
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
31+
<sonar-maven-plugin.version>2.2</sonar-maven-plugin.version>
32+
<coveralls-maven-plugin.version>3.1.0</coveralls-maven-plugin.version>
33+
<jacoco-maven-plugin.version>0.7.5.201505241946</jacoco-maven-plugin.version>
34+
<maven-source-plugin.version>2.4</maven-source-plugin.version>
35+
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
36+
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
37+
<maven-release-plugin.version>2.5.2</maven-release-plugin.version>
38+
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
39+
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
40+
41+
<slf4j.version>1.7.25</slf4j.version>
42+
<logback.version>1.2.3</logback.version>
43+
44+
<junit.version>4.8.1</junit.version>
45+
<mockito.version>1.8.5</mockito.version>
46+
<datasource-proxy.version>1.3.3</datasource-proxy.version>
47+
48+
<hsqldb.version>2.2.8</hsqldb.version>
49+
50+
<oracle.version>19.3.0.0</oracle.version>
51+
<mssql.version>6.4.0.jre8</mssql.version>
52+
<hibernate.version>5.4.9.Final</hibernate.version>
53+
<postgresql.version>9.4-1202-jdbc41</postgresql.version>
54+
55+
<mysql.version>8.0.13</mysql.version>
56+
<jackson.version>2.9.10.1</jackson.version>
57+
<guava.version>27.1-jre</guava.version>
58+
</properties>
59+
60+
<dependencies>
61+
62+
<dependency>
63+
<groupId>org.slf4j</groupId>
64+
<artifactId>slf4j-api</artifactId>
65+
<version>${slf4j.version}</version>
66+
<scope>provided</scope>
67+
<optional>true</optional>
68+
</dependency>
69+
70+
<dependency>
71+
<groupId>org.hibernate</groupId>
72+
<artifactId>hibernate-core</artifactId>
73+
<version>${hibernate.version}</version>
74+
<scope>provided</scope>
75+
</dependency>
76+
77+
<dependency>
78+
<groupId>com.fasterxml.jackson.core</groupId>
79+
<artifactId>jackson-databind</artifactId>
80+
<version>${jackson.version}</version>
81+
<scope>provided</scope>
82+
<optional>true</optional>
83+
</dependency>
84+
85+
<dependency>
86+
<groupId>com.google.guava</groupId>
87+
<artifactId>guava</artifactId>
88+
<version>${guava.version}</version>
89+
<scope>provided</scope>
90+
<optional>true</optional>
91+
</dependency>
92+
93+
<dependency>
94+
<groupId>org.hibernate</groupId>
95+
<artifactId>hibernate-ehcache</artifactId>
96+
<version>${hibernate.version}</version>
97+
<scope>test</scope>
98+
</dependency>
99+
100+
<dependency>
101+
<groupId>org.postgresql</groupId>
102+
<artifactId>postgresql</artifactId>
103+
<version>${postgresql.version}</version>
104+
<scope>provided</scope>
105+
<optional>true</optional>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>junit</groupId>
110+
<artifactId>junit</artifactId>
111+
<version>${junit.version}</version>
112+
<scope>test</scope>
113+
</dependency>
114+
115+
<dependency>
116+
<groupId>net.ttddyy</groupId>
117+
<artifactId>datasource-proxy</artifactId>
118+
<version>${datasource-proxy.version}</version>
119+
<scope>test</scope>
120+
</dependency>
121+
122+
<dependency>
123+
<groupId>org.hsqldb</groupId>
124+
<artifactId>hsqldb</artifactId>
125+
<version>${hsqldb.version}</version>
126+
<scope>test</scope>
127+
</dependency>
128+
129+
<dependency>
130+
<groupId>mysql</groupId>
131+
<artifactId>mysql-connector-java</artifactId>
132+
<version>${mysql.version}</version>
133+
<scope>test</scope>
134+
</dependency>
135+
136+
<dependency>
137+
<groupId>com.oracle.ojdbc</groupId>
138+
<artifactId>ojdbc8</artifactId>
139+
<version>${oracle.version}</version>
140+
<scope>test</scope>
141+
</dependency>
142+
143+
<dependency>
144+
<groupId>com.microsoft.sqlserver</groupId>
145+
<artifactId>mssql-jdbc</artifactId>
146+
<version>${mssql.version}</version>
147+
<scope>test</scope>
148+
</dependency>
149+
150+
<dependency>
151+
<groupId>org.mockito</groupId>
152+
<artifactId>mockito-core</artifactId>
153+
<version>${mockito.version}</version>
154+
<scope>test</scope>
155+
</dependency>
156+
157+
</dependencies>
158+
159+
<build>
160+
<plugins>
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-compiler-plugin</artifactId>
164+
<version>${maven-compiler-plugin.version}</version>
165+
<configuration>
166+
<source>${jdk.version}</source>
167+
<target>${jdk.version}</target>
168+
<showDeprecation>true</showDeprecation>
169+
<showWarnings>true</showWarnings>
170+
<fork>true</fork>
171+
</configuration>
172+
</plugin>
173+
</plugins>
174+
</build>
175+
176+
</project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package com.vladmihalcea.hibernate.type;
2+
3+
import com.vladmihalcea.hibernate.type.util.Configuration;
4+
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
5+
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
6+
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
7+
8+
/**
9+
* Very convenient base class for implementing object types using Hibernate Java and SQL descriptors.
10+
*
11+
* @author Vlad Mihalcea
12+
*/
13+
public abstract class AbstractHibernateType<T> extends AbstractSingleColumnStandardBasicType<T> {
14+
15+
private final Configuration configuration;
16+
17+
/**
18+
* Initialization constructor taking the {@link SqlTypeDescriptor} and {@link JavaTypeDescriptor} objects,
19+
* and using the default {@link Configuration} object.
20+
*
21+
* @param sqlTypeDescriptor the {@link SqlTypeDescriptor} to be used
22+
* @param javaTypeDescriptor the {@link JavaTypeDescriptor} to be used
23+
*/
24+
protected AbstractHibernateType(
25+
SqlTypeDescriptor sqlTypeDescriptor,
26+
JavaTypeDescriptor<T> javaTypeDescriptor) {
27+
super(sqlTypeDescriptor, javaTypeDescriptor);
28+
this.configuration = Configuration.INSTANCE;
29+
}
30+
31+
/**
32+
* Initialization constructor taking the {@link SqlTypeDescriptor}, {@link JavaTypeDescriptor},
33+
* and {@link Configuration} objects.
34+
*
35+
* @param sqlTypeDescriptor the {@link SqlTypeDescriptor} to be used
36+
* @param javaTypeDescriptor the {@link JavaTypeDescriptor} to be used
37+
* @param configuration custom {@link Configuration} object.
38+
*/
39+
protected AbstractHibernateType(SqlTypeDescriptor sqlTypeDescriptor, JavaTypeDescriptor<T> javaTypeDescriptor, Configuration configuration) {
40+
super(sqlTypeDescriptor, javaTypeDescriptor);
41+
this.configuration = configuration;
42+
}
43+
44+
/**
45+
* Get the current {@link Configuration} object.
46+
* @return the current {@link Configuration} object.
47+
*/
48+
protected Configuration getConfiguration() {
49+
return configuration;
50+
}
51+
}

0 commit comments

Comments
 (0)