...
 
Commits (2)
<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">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate-parent</artifactId>
<version>2.9.9-SNAPSHOT</version>
</parent>
<artifactId>jackson-datatype-hibernate4</artifactId>
<name>Jackson-datatype-Hibernate4</name>
<artifactId>jackson-datatype-hibernate5</artifactId>
<name>Jackson-datatype-Hibernate5</name>
<packaging>bundle</packaging>
<description>Add-on module for Jackson (http://jackson.codehaus.org) to support
Hibernate (http://hibernate.org) version 4.x data types.
Hibernate (http://hibernate.org) version 5.x data types.
</description>
<url>https://github.com/FasterXML/jackson-datatype-hibernate</url>
<properties>
<!-- Generate PackageVersion.java into this directory. -->
<packageVersion.dir>com/fasterxml/jackson/datatype/hibernate4</packageVersion.dir>
<packageVersion.package>${project.groupId}.hibernate4</packageVersion.package>
<packageVersion.dir>com/fasterxml/jackson/datatype/hibernate5</packageVersion.dir>
<packageVersion.package>${project.groupId}.hibernate5</packageVersion.package>
<!-- Hibernate with JPA 2.0 -->
<hibernate.version>4.1.0.Final</hibernate.version>
<hibernate.version>5.2.17.Final</hibernate.version>
<surefire.version>2.12</surefire.version>
<osgi.export>${project.groupId}.hibernate4</osgi.export>
<osgi.export>${project.groupId}.hibernate5</osgi.export>
</properties>
<dependencies>
<!-- 18-Dec-2015, tatu: Since 5.0.1, we get exception for
missing class "javax.transaction.SystemException", without this:
-->
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<!-- what would be the best scope to use here? -->
<!-- what would be the best scope to use here? -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
......@@ -37,7 +45,14 @@ Hibernate (http://hibernate.org) version 4.x data types.
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>
<!-- and for some contributed tests Mockito -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
......@@ -71,7 +86,20 @@ Hibernate (http://hibernate.org) version 4.x data types.
</execution>
</executions>
</plugin>
<!-- 02-Mar-2017, tatu: Need to publish test jar for 5.2 test to work -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -70,17 +70,17 @@
<servlet-api.version>2.5</servlet-api.version>
<jsp-api.version>2.1</jsp-api.version>
<spring.framework.version>4.3.18.RELEASE</spring.framework.version>
<spring-data-jpa.version>1.11.13.RELEASE</spring-data-jpa.version>
<spring.framework.version>4.3.22.RELEASE</spring.framework.version>
<spring-data-jpa.version>1.11.18.RELEASE</spring-data-jpa.version>
<spring.security.version>4.1.5.RELEASE</spring.security.version>
<spring.security.oauth2.version>2.3.3.RELEASE</spring.security.oauth2.version>
<spring-security-jwt>1.0.8.RELEASE</spring-security-jwt>
<org.springframework.social-version>1.1.4.RELEASE</org.springframework.social-version>
<querydsl.version>4.1.4</querydsl.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<hibernate.version>5.2.11.Final</hibernate.version>
<hibernate.validator.version>5.2.5.Final</hibernate.validator.version>
<hsqldb.version>2.3.6</hsqldb.version>
<hsqldb.version>2.4.1</hsqldb.version>
<ehcache.version>2.7.4</ehcache.version>
<slf4j.version>1.7.25</slf4j.version>
......@@ -235,7 +235,7 @@
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate4</artifactId>
<artifactId>jackson-datatype-hibernate5</artifactId>
<version>2.9.9-SNAPSHOT</version>
</dependency>
......@@ -352,7 +352,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
......@@ -430,8 +430,8 @@
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-hibernate4</artifactId>
<version>${hazelcast.version}</version>
<artifactId>hazelcast-hibernate52</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
......@@ -528,7 +528,7 @@
</dependency>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<artifactId>liquibase-hibernate5</artifactId>
<version>${liquibase.version}</version>
<exclusions>
<exclusion>
......@@ -898,7 +898,7 @@
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<artifactId>liquibase-hibernate5</artifactId>
<version>3.6</version>
</dependency>
<dependency>
......
......@@ -35,7 +35,7 @@ public interface Taxonomy2Repository extends JpaRepository<Taxonomy2, Long> {
@Query("select distinct t.genus from Taxonomy2 t join t.cropTaxonomies ct where t.genus like ?1 and ct.crop = ?2")
List<String> autocompleteGenusByCrop(String term, Crop crop, Pageable page);
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1)")
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1")
List<String> autocompleteSpecies(String term, Pageable page);
@Query("select distinct t.species from Taxonomy2 t join t.cropTaxonomies ct where t.species like ?1 and ct.crop = ?2")
......@@ -44,10 +44,10 @@ public interface Taxonomy2Repository extends JpaRepository<Taxonomy2, Long> {
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1 and t.genus in (?2)")
List<String> autocompleteSpeciesByGenus(String term, List<String> genus, Pageable page);
@Query("select distinct t.taxonName from Taxonomy2 t where t.taxonName like ?1)")
@Query("select distinct t.taxonName from Taxonomy2 t where t.taxonName like ?1")
List<String> autocompleteTaxonomy(String term, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1)")
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1")
List<String> autocompleteSubtaxa(String string, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t join t.cropTaxonomies ct where t.subtaxa like ?1 and ct.crop = ?2")
......
......@@ -15,7 +15,7 @@
*/
package org.genesys2.spring.config;
import javax.transaction.Transactional;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.oauth.model.OAuthClient;
......
......@@ -167,7 +167,7 @@ public class DatabaseConfig {
System.err.println("JPA: " + key + " = " + jpaProperties.get(key));
}
jpaProperties.put("hibernate.ejb.interceptor", new EmptyInterceptor() {
jpaProperties.put("hibernate.session_factory.interceptor", new EmptyInterceptor() {
private static final long serialVersionUID = 412280557897728434L;
// NOTE We're using the auditTrailInterceptor() to fetch the lazy-initialized
......
......@@ -54,8 +54,8 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module.Feature;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module.Feature;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.ILock;
import com.hazelcast.core.IQueue;
......@@ -196,7 +196,7 @@ public class ElasticsearchConfig {
public GenesysEntityMapper() {
mapper = new ObjectMapper();
Hibernate4Module hibernateModule = new Hibernate4Module();
Hibernate5Module hibernateModule = new Hibernate5Module();
hibernateModule.enable(Feature.FORCE_LAZY_LOADING);
hibernateModule.enable(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS);
hibernateModule.enable(Feature.WRITE_MISSING_ENTITIES_AS_NULL);
......
......@@ -61,8 +61,8 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module.Feature;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module.Feature;
/**
* Spring MVC
......@@ -217,7 +217,7 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
final ObjectMapper mapper = new ObjectMapper();
Hibernate4Module hibernateModule = new Hibernate4Module();
Hibernate5Module hibernateModule = new Hibernate5Module();
hibernateModule.disable(Feature.FORCE_LAZY_LOADING);
hibernateModule.disable(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS);
mapper.registerModule(hibernateModule);
......
......@@ -18,6 +18,7 @@ package org.genesys2.spring.hazelcast;
import java.util.Properties;
import org.hibernate.boot.spi.SessionFactoryOptions;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.CollectionRegion;
......@@ -27,7 +28,6 @@ import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.cache.spi.TimestampsRegion;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cfg.Settings;
import org.springframework.stereotype.Component;
import com.hazelcast.hibernate.HazelcastCacheRegionFactory;
......@@ -59,8 +59,8 @@ public class HazelcastCacheRegionFactoryWrapper implements RegionFactory {
}
@Override
public void start(Settings settings, Properties properties) throws CacheException {
hazelcastCacheRegionFactory.start(settings, properties);
public void start(SessionFactoryOptions sessionFactoryOptions, Properties properties) throws CacheException {
hazelcastCacheRegionFactory.start(sessionFactoryOptions, properties);
}
@Override
......
......@@ -17,3 +17,5 @@ hibernate.cache.region_prefix=hibernate
hibernate.cache.region.factory_class=org.genesys2.spring.hazelcast.HazelcastCacheRegionFactoryWrapper
hibernate.cache.use_structured_entries=false
hibernate.generate_statistics=false
hibernate.id.new_generator_mappings=false
hibernate.discriminator.ignore_explicit_for_joined=true
......@@ -53,8 +53,8 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module.Feature;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module.Feature;
public final class ApplicationConfig {
......@@ -235,12 +235,12 @@ public final class ApplicationConfig {
final MappingJackson2HttpMessageConverter messageConverter = new MappingJackson2HttpMessageConverter();
final ObjectMapper mapper = new ObjectMapper();
Hibernate4Module hibernateModule = new Hibernate4Module();
Hibernate5Module hibernateModule = new Hibernate5Module();
hibernateModule.disable(Feature.FORCE_LAZY_LOADING);
hibernateModule.disable(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS);
mapper.registerModule(hibernateModule);
// serialization
mapper.disable(SerializationFeature.EAGER_SERIALIZER_FETCH);
// deserialization
......
......@@ -14,3 +14,5 @@ hibernate.cache.region_prefix=hibernate
#hibernate.cache.region.factory_class=org.hibernate.testing.cache.CachingRegionFactory
hibernate.cache.use_structured_entries=true
hibernate.generate_statistics=false
hibernate.id.new_generator_mappings=false
hibernate.discriminator.ignore_explicit_for_joined=true
\ No newline at end of file