HHH-10664 - Prep 6.0 feature branch - merge hibernate-java8 into hibernate-core

This commit is contained in:
Steve Ebersole 2016-03-31 12:27:52 -05:00
parent 8ddd61b061
commit fa0db89f7f
34 changed files with 28 additions and 183 deletions

View File

@ -49,6 +49,15 @@ public class BasicTypeRegistry implements Serializable {
register( CharacterNCharType.INSTANCE );
register( UrlType.INSTANCE );
register( DurationType.INSTANCE );
register( InstantType.INSTANCE );
register( LocalDateTimeType.INSTANCE );
register( LocalDateType.INSTANCE );
register( LocalTimeType.INSTANCE );
register( OffsetDateTimeType.INSTANCE );
register( OffsetTimeType.INSTANCE );
register( ZonedDateTimeType.INSTANCE );
register( DateType.INSTANCE );
register( TimeType.INSTANCE );
register( TimestampType.INSTANCE );

View File

@ -50,6 +50,14 @@ public class JavaTypeDescriptorRegistry {
addDescriptorInternal( PrimitiveByteArrayTypeDescriptor.INSTANCE );
addDescriptorInternal( PrimitiveCharacterArrayTypeDescriptor.INSTANCE );
addDescriptorInternal( DurationJavaDescriptor.INSTANCE );
addDescriptorInternal( InstantJavaDescriptor.INSTANCE );
addDescriptorInternal( LocalDateJavaDescriptor.INSTANCE );
addDescriptorInternal( LocalDateTimeJavaDescriptor.INSTANCE );
addDescriptorInternal( OffsetDateTimeJavaDescriptor.INSTANCE );
addDescriptorInternal( OffsetTimeJavaDescriptor.INSTANCE );
addDescriptorInternal( ZonedDateTimeJavaDescriptor.INSTANCE );
addDescriptorInternal( CalendarTypeDescriptor.INSTANCE );
addDescriptorInternal( DateTypeDescriptor.INSTANCE );
descriptorsByClass.put( java.sql.Date.class, JdbcDateTypeDescriptor.INSTANCE );

View File

@ -6,20 +6,19 @@
*/
package org.hibernate.test.type;
import java.time.LocalDate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDate;
import org.hibernate.Session;
import org.hibernate.resource.transaction.spi.TransactionStatus;
import org.junit.Before;
import org.junit.Test;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

View File

@ -6,23 +6,22 @@
*/
package org.hibernate.test.type;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.resource.transaction.spi.TransactionStatus;
import org.hibernate.type.OffsetDateTimeType;
import org.junit.Test;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

View File

@ -6,22 +6,21 @@
*/
package org.hibernate.test.type;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.resource.transaction.spi.TransactionStatus;
import org.hibernate.type.ZonedDateTimeType;
import org.junit.Test;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

View File

@ -1,19 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
dependencies {
compile( project(':hibernate-core') )
testCompile( project(':hibernate-testing') )
}
mavenPom {
name = 'Java8-specific Hibernate O/RM functionality'
description = 'Support for Java8-specific features - mainly Java8 Date/Time (JSR 310)'
}
def osgiDescription() {
return mavenPom.description
}

View File

@ -1,48 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.type;
import org.hibernate.boot.model.TypeContributions;
import org.hibernate.boot.model.TypeContributor;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.type.descriptor.java.DurationJavaDescriptor;
import org.hibernate.type.descriptor.java.InstantJavaDescriptor;
import org.hibernate.type.descriptor.java.JavaTypeDescriptorRegistry;
import org.hibernate.type.descriptor.java.LocalDateJavaDescriptor;
import org.hibernate.type.descriptor.java.LocalDateTimeJavaDescriptor;
import org.hibernate.type.descriptor.java.OffsetDateTimeJavaDescriptor;
import org.hibernate.type.descriptor.java.OffsetTimeJavaDescriptor;
import org.hibernate.type.descriptor.java.ZonedDateTimeJavaDescriptor;
/**
* TypeContributor for adding Java8 Date/Time specific Type implementations
*
* @author Steve Ebersole
*/
public class Java8DateTimeTypeContributor implements TypeContributor {
@Override
public void contribute(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
// register the Java type descriptors
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( DurationJavaDescriptor.INSTANCE );
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( InstantJavaDescriptor.INSTANCE );
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( LocalDateJavaDescriptor.INSTANCE );
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( LocalDateTimeJavaDescriptor.INSTANCE );
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( OffsetDateTimeJavaDescriptor.INSTANCE );
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( OffsetTimeJavaDescriptor.INSTANCE );
JavaTypeDescriptorRegistry.INSTANCE.addDescriptor( ZonedDateTimeJavaDescriptor.INSTANCE );
// register the Hibernate type mappings
typeContributions.contributeType( DurationType.INSTANCE );
typeContributions.contributeType( InstantType.INSTANCE );
typeContributions.contributeType( LocalDateTimeType.INSTANCE );
typeContributions.contributeType( LocalDateType.INSTANCE );
typeContributions.contributeType( LocalTimeType.INSTANCE );
typeContributions.contributeType( OffsetDateTimeType.INSTANCE );
typeContributions.contributeType( OffsetTimeType.INSTANCE );
typeContributions.contributeType( ZonedDateTimeType.INSTANCE );
}
}

View File

@ -1,13 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
#
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
#
org.hibernate.type.Java8DateTimeTypeContributor

View File

@ -1,26 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
#
hibernate.dialect @db.dialect@
hibernate.connection.driver_class @jdbc.driver@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
hibernate.connection.pool_size 5
hibernate.show_sql false
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
javax.persistence.validation.mode=NONE
hibernate.service.allow_crawling=false
hibernate.session.events.log=true

View File

@ -1,57 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
#
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
#log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L (hibernateLoadPlanWalkPath->%X{hibernateLoadPlanWalkPath}) - %m%n
#log4j.appender.stdout-mdc=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout-mdc.Target=System.out
#log4j.appender.stdout-mdc.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout-mdc.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L (walk path -> %X{hibernateLoadPlanWalkPath}) - %m%n
log4j.appender.unclosedSessionFactoryFile=org.apache.log4j.FileAppender
log4j.appender.unclosedSessionFactoryFile.append=true
log4j.appender.unclosedSessionFactoryFile.file=target/tmp/log/UnclosedSessionFactoryWarnings.log
log4j.appender.unclosedSessionFactoryFile.layout=org.apache.log4j.PatternLayout
log4j.appender.unclosedSessionFactoryFile.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=info, stdout
#log4j.logger.org.hibernate.loader.plan=trace, stdout-mdc
#log4j.additivity.org.hibernate.loader.plan=false
#log4j.logger.org.hibernate.persister.walking=trace, stdout-mdc
#log4j.additivity.org.hibernate.persister.walking=false
log4j.logger.org.hibernate.tool.hbm2ddl=trace
log4j.logger.org.hibernate.testing.cache=debug
# SQL Logging - HHH-6833
log4j.logger.org.hibernate.SQL=debug
log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace
log4j.logger.org.hibernate.type.descriptor.sql.BasicExtractor=trace
log4j.logger.org.hibernate.hql.internal.ast=debug
log4j.logger.org.hibernate.sql.ordering.antlr=debug
log4j.logger.org.hibernate.loader.plan2.build.internal.LoadPlanImpl=debug
log4j.logger.org.hibernate.loader.plan2.build.spi.LoadPlanTreePrinter=debug
log4j.logger.org.hibernate.loader.plan2.exec.spi.EntityLoadQueryDetails=debug
log4j.logger.org.hibernate.engine.internal.StatisticalLoggingSessionEventListener=info
log4j.logger.org.hibernate.boot.model.source.internal.hbm.ModelBinder=debug
### When entity copy merge functionality is enabled using:
### hibernate.event.merge.entity_copy_observer=log, the following will
### provide information about merged entity copies.
### log4j.logger.org.hibernate.event.internal.EntityCopyAllowedLoggedObserver=debug
log4j.logger.org.hibernate.testing.junit4.TestClassMetadata=info, unclosedSessionFactoryFile

View File

@ -114,10 +114,6 @@ distributions {
from parent.project( 'hibernate-core' ).configurations.provided.files { dep -> dep.name == 'javassist' }
}
into('lib/java8') {
from parent.project( 'hibernate-java8' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
}
into( 'lib/jpa' ) {
from parent.project( 'hibernate-entitymanager' ).configurations.archives.allArtifacts.files.filter{ file -> !file.name.endsWith('-sources.jar') }
}

View File

@ -14,8 +14,6 @@ include 'hibernate-entitymanager'
include 'hibernate-envers'
include 'hibernate-spatial'
include 'hibernate-java8'
include 'hibernate-osgi'
include 'hibernate-c3p0'