Merge remote-tracking branch 'upstream/master' into wip/6.0_merge_29

This commit is contained in:
Andrea Boriero 2020-04-09 07:37:11 +01:00
commit 5c86c4a805
149 changed files with 392 additions and 233 deletions

View File

@ -23,7 +23,6 @@ buildscript {
} }
plugins { plugins {
id 'com.gradle.build-scan' version '2.4.2'
id 'me.champeau.buildscan-recipes' version '0.2.3' id 'me.champeau.buildscan-recipes' version '0.2.3'
id 'org.hibernate.build.xjc' version '2.0.1' apply false id 'org.hibernate.build.xjc' version '2.0.1' apply false
id 'org.hibernate.build.maven-repo-auth' version '3.0.2' apply false id 'org.hibernate.build.maven-repo-auth' version '3.0.2' apply false

View File

@ -51,10 +51,8 @@ ext {
sourceCompatibility = project.baselineJavaVersion sourceCompatibility = project.baselineJavaVersion
targetCompatibility = project.baselineJavaVersion targetCompatibility = project.baselineJavaVersion
afterEvaluate { if ( !project.description ) {
if ( !project.description ) { project.description = "The Hibernate ORM $project.name module"
project.description = "The Hibernate ORM $project.name module"
}
} }

View File

@ -7,6 +7,11 @@
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
// Disable Gradle module metadata publishing until we know what we want.
// https://docs.gradle.org/6.0.1/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
publishing { publishing {

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

22
gradlew vendored
View File

@ -1,5 +1,21 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
############################################################################## ##############################################################################
## ##
## Gradle start up script for UN*X ## Gradle start up script for UN*X
@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS="" DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if $cygwin ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`

18
gradlew.bat vendored
View File

@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS= set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome

View File

@ -5,10 +5,10 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
description = 'Integration for Agroal as a ConnectionProvider for Hibernate ORM' description = 'Integration for Agroal as a ConnectionProvider for Hibernate ORM'
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
dependencies { dependencies {
compile project( ':hibernate-core' ) compile project( ':hibernate-core' )
compile( libraries.agroal_api ) compile( libraries.agroal_api )

View File

@ -5,10 +5,10 @@
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/ */
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
description = 'Integration for c3p0 Connection pooling into Hibernate ORM' description = 'Integration for c3p0 Connection pooling into Hibernate ORM'
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
dependencies { dependencies {
compile project( ':hibernate-core' ) compile project( ':hibernate-core' )
compile( libraries.c3p0 ) compile( libraries.c3p0 )

View File

@ -10,12 +10,12 @@ plugins {
*/ */
import org.apache.tools.ant.filters.ReplaceTokens import org.apache.tools.ant.filters.ReplaceTokens
description = 'Hibernate\'s core ORM functionality'
apply from: rootProject.file( 'gradle/published-java-module.gradle' ) apply from: rootProject.file( 'gradle/published-java-module.gradle' )
apply plugin: Antlr4Plugin apply plugin: Antlr4Plugin
apply plugin: 'hibernate-matrix-testing' apply plugin: 'hibernate-matrix-testing'
description = 'Hibernate\'s core ORM functionality'
ext { ext {
jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" ) jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" )
} }

View File

@ -65,7 +65,7 @@ public abstract class AbstractEntityInsertAction extends EntityAction {
* entity state. * entity state.
* @return the entity state. * @return the entity state.
* *
* @see {@link #nullifyTransientReferencesIfNotAlready} * @see #nullifyTransientReferencesIfNotAlready
*/ */
public Object[] getState() { public Object[] getState() {
return state; return state;
@ -104,7 +104,7 @@ public abstract class AbstractEntityInsertAction extends EntityAction {
* called for a this object, so it can safely be called both when * called for a this object, so it can safely be called both when
* the entity is made "managed" and when this action is executed. * the entity is made "managed" and when this action is executed.
* *
* @see {@link #makeEntityManaged() } * @see #makeEntityManaged()
*/ */
protected final void nullifyTransientReferencesIfNotAlready() { protected final void nullifyTransientReferencesIfNotAlready() {
if ( ! areTransientReferencesNullified ) { if ( ! areTransientReferencesNullified ) {

View File

@ -16,20 +16,20 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Defines size for batch loading of collections or lazy entities. For example... * Defines size for batch loading of collections or lazy entities. For example...
* <blockquote><pre> * <blockquote><pre>{@code
* &#064;Entity * @Entity
* &#064;BatchSize(size=100) * @BatchSize(size=100)
* class Product { * class Product {
* ... * ...
* } * }
* </pre></blockquote> * }</pre></blockquote>
* will initialize up to 100 lazy Product entity proxies at a time. * will initialize up to 100 lazy Product entity proxies at a time.
* *
* <blockquote><pre> * <blockquote><pre>{@code
* &#064;OneToMany * @OneToMany
* &#064;BatchSize(size = 5) / * @BatchSize(size = 5) /
* Set<Product> getProducts() { ... }; * Set<Product> getProducts() { ... };
* </pre></blockquote> * }</pre></blockquote>
* will initialize up to 5 lazy collections of products at a time * will initialize up to 5 lazy collections of products at a time
* *
* @author Emmanuel Bernard * @author Emmanuel Bernard

View File

@ -34,7 +34,7 @@ public @interface Sort {
/** /**
* Specifies the comparator to use. Only valid when {@link #type} specifies {@link SortType#COMPARATOR}. * Specifies the comparator to use. Only valid when {@link #type} specifies {@link SortType#COMPARATOR}.
* *
* TODO find a way to use Class<Comparator> -> see HHH-8164 * TODO find a way to use {@code Class<Comparator>} -> see HHH-8164
*/ */
Class comparator() default void.class; Class comparator() default void.class;
} }

View File

@ -1761,7 +1761,7 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
* <p/> * <p/>
* See <tt>ANN-722</tt> and <tt>ANN-730</tt> * See <tt>ANN-722</tt> and <tt>ANN-730</tt>
* *
* @param orderedFkSecondPasses The list containing the <code>FkSecondPass<code> instances ready * @param orderedFkSecondPasses The list containing the <code>FkSecondPass</code> instances ready
* for processing. * for processing.
* @param isADependencyOf Our lookup data structure to determine dependencies between tables * @param isADependencyOf Our lookup data structure to determine dependencies between tables
* @param startTable Table name to start recursive algorithm. * @param startTable Table name to start recursive algorithm.

View File

@ -7,7 +7,7 @@
package org.hibernate.boot.model.source.spi; package org.hibernate.boot.model.source.spi;
/** /**
* Describes an {@link <any/>} mapping * Describes an {@code <any/>} mapping
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */

View File

@ -71,7 +71,7 @@ public class StandardServiceRegistryBuilder {
public static final String DEFAULT_CFG_RESOURCE_NAME = "hibernate.cfg.xml"; public static final String DEFAULT_CFG_RESOURCE_NAME = "hibernate.cfg.xml";
private final Map settings; private final Map settings;
private final List<StandardServiceInitiator> initiators = standardInitiatorList(); private final List<StandardServiceInitiator> initiators;
private final List<ProvidedService> providedServices = new ArrayList<>(); private final List<ProvidedService> providedServices = new ArrayList<>();
private boolean autoCloseRegistry = true; private boolean autoCloseRegistry = true;
@ -110,6 +110,24 @@ public class StandardServiceRegistryBuilder {
this.configLoader = new ConfigLoader( bootstrapServiceRegistry ); this.configLoader = new ConfigLoader( bootstrapServiceRegistry );
this.settings = settings; this.settings = settings;
this.aggregatedCfgXml = loadedConfig; this.aggregatedCfgXml = loadedConfig;
this.initiators = standardInitiatorList();
}
/**
* Intended for use exclusively from Quarkus boot-strapping, or extensions of
* this class which need to override the standard ServiceInitiator list.
* Consider this an SPI.
*/
protected StandardServiceRegistryBuilder(
BootstrapServiceRegistry bootstrapServiceRegistry,
Map settings,
LoadedConfig loadedConfig,
List<StandardServiceInitiator> initiators) {
this.bootstrapServiceRegistry = bootstrapServiceRegistry;
this.configLoader = new ConfigLoader( bootstrapServiceRegistry );
this.settings = settings;
this.aggregatedCfgXml = loadedConfig;
this.initiators = initiators;
} }
/** /**
@ -124,6 +142,7 @@ public class StandardServiceRegistryBuilder {
this.bootstrapServiceRegistry = bootstrapServiceRegistry; this.bootstrapServiceRegistry = bootstrapServiceRegistry;
this.configLoader = new ConfigLoader( bootstrapServiceRegistry ); this.configLoader = new ConfigLoader( bootstrapServiceRegistry );
this.aggregatedCfgXml = loadedConfigBaseline; this.aggregatedCfgXml = loadedConfigBaseline;
this.initiators = standardInitiatorList();
} }
public ConfigLoader getConfigLoader() { public ConfigLoader getConfigLoader() {

View File

@ -7,7 +7,7 @@
package org.hibernate.bytecode.enhance.spi; package org.hibernate.bytecode.enhance.spi;
/** /**
* Interface to be implemented by collection trackers that hold the expected size od collections, a simplified Map<String, int>. * Interface to be implemented by collection trackers that hold the expected size od collections, a simplified {@code Map<String, int>}.
* *
* @author <a href="mailto:lbarreiro@redhat.com">Luis Barreiro</a> * @author <a href="mailto:lbarreiro@redhat.com">Luis Barreiro</a>
*/ */

View File

@ -36,5 +36,8 @@ public interface BytecodeLazyAttributeInterceptor extends SessionAssociableInter
*/ */
void attributeInitialized(String name); void attributeInitialized(String name);
boolean isAttributeLoaded(String fieldName);
boolean hasAnyUninitializedAttributes();
} }

View File

@ -284,6 +284,23 @@ public class EnhancementAsProxyLazinessInterceptor extends AbstractLazyLoadInter
} }
} }
@Override
public boolean isAttributeLoaded(String fieldName) {
if ( initialized ) {
throw new UnsupportedOperationException( "Call to EnhancementAsProxyLazinessInterceptor#isAttributeLoaded on an interceptor which is marked as initialized" );
}
// Only fields from the identifier are loaded (until it's initialized)
return identifierAttributeNames.contains( fieldName );
}
@Override
public boolean hasAnyUninitializedAttributes() {
if ( initialized ) {
throw new UnsupportedOperationException( "Call to EnhancementAsProxyLazinessInterceptor#hasAnyUninitializedAttributes on an interceptor which is marked as initialized" );
}
return true;
}
@Override @Override
public Object getIdentifier() { public Object getIdentifier() {
return entityKey.getIdentifier(); return entityKey.getIdentifier();

View File

@ -181,6 +181,10 @@ public final class ByteBuddyState {
cache ); cache );
} }
public Unloaded<?> make(Function<ByteBuddy, DynamicType.Builder<?>> makeProxyFunction) {
return make( makeProxyFunction.apply( byteBuddy ) );
}
private Unloaded<?> make(DynamicType.Builder<?> builder) { private Unloaded<?> make(DynamicType.Builder<?> builder) {
return make( null, builder ); return make( null, builder );
} }

View File

@ -13,7 +13,7 @@ import java.util.StringTokenizer;
import javax.persistence.Index; import javax.persistence.Index;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class JPAIndexHolder { public class JPAIndexHolder {
private final String name; private final String name;

View File

@ -24,7 +24,7 @@ import org.hibernate.internal.util.LockModeConverter;
import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.internal.util.config.ConfigurationHelper;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class QueryHintDefinition { public class QueryHintDefinition {
private final String queryName; private final String queryName;

View File

@ -91,7 +91,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
} }
/** /**
* * @deprecated {@link #AbstractPersistentCollection(SharedSessionContractImplementor)} should be used instead. * @deprecated {@link #AbstractPersistentCollection(SharedSessionContractImplementor)} should be used instead.
*/ */
@Deprecated @Deprecated
protected AbstractPersistentCollection(SessionImplementor session) { protected AbstractPersistentCollection(SessionImplementor session) {

View File

@ -72,8 +72,8 @@ import java.util.regex.Pattern;
* <p> * <p>
* Note: This dialect is configured to create foreign keys with {@code on update cascade}. * Note: This dialect is configured to create foreign keys with {@code on update cascade}.
* *
* @author Andrew Clemons <andrew.clemons@sap.com> * @author <a href="mailto:andrew.clemons@sap.com">Andrew Clemons</a>
* @author Jonathan Bregler <jonathan.bregler@sap.com> * @author <a href="mailto:jonathan.bregler@sap.com">Jonathan Bregler</a>
*/ */
public abstract class AbstractHANADialect extends Dialect { public abstract class AbstractHANADialect extends Dialect {

View File

@ -62,7 +62,7 @@ package org.hibernate.dialect;
* For example, in Hibernate 3.2, typical entries in hibernate.properties would have the following * For example, in Hibernate 3.2, typical entries in hibernate.properties would have the following
* "name=value" pairs: * "name=value" pairs:
* <p/> * <p/>
* <table cols=3 border cellpadding=5 cellspacing=0> * <table cols=3 border="" cellpadding=5 cellspacing=0>
* <tr> * <tr>
* <th>Property Name</th> * <th>Property Name</th>
* <th>Property Value</th> * <th>Property Value</th>

View File

@ -2650,7 +2650,7 @@ public abstract class Dialect implements ConversionContext {
* Are subselects supported as the left-hand-side (LHS) of * Are subselects supported as the left-hand-side (LHS) of
* IN-predicates. * IN-predicates.
* <p/> * <p/>
* In other words, is syntax like "... <subquery> IN (1, 2, 3) ..." supported? * In other words, is syntax like {@code ... <subquery> IN (1, 2, 3) ...} supported?
* *
* @return True if subselects can appear as the LHS of an in-predicate; * @return True if subselects can appear as the LHS of an in-predicate;
* false otherwise. * false otherwise.

View File

@ -27,8 +27,8 @@ import org.hibernate.type.StandardBasicTypes;
* <p> * <p>
* Column tables are created by this dialect when using the auto-ddl feature. * Column tables are created by this dialect when using the auto-ddl feature.
* *
* @author Andrew Clemons <andrew.clemons@sap.com> * @author <a href="mailto:andrew.clemons@sap.com">Andrew Clemons</a>
* @author Jonathan Bregler <jonathan.bregler@sap.com> * @author <a href="mailto:jonathan.bregler@sap.com">Jonathan Bregler</a>
*/ */
public class HANAColumnStoreDialect extends AbstractHANADialect { public class HANAColumnStoreDialect extends AbstractHANADialect {

View File

@ -25,8 +25,8 @@ import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy;
* <p> * <p>
* Row tables are created by this dialect when using the auto-ddl feature. * Row tables are created by this dialect when using the auto-ddl feature.
* *
* @author Andrew Clemons <andrew.clemons@sap.com> * @author <a href="mailto:andrew.clemons@sap.com">Andrew Clemons</a>
* @author Jonathan Bregler <jonathan.bregler@sap.com> * @author <a href="mailto:jonathan.bregler@sap.com">Jonathan Bregler</a>
*/ */
public class HANARowStoreDialect extends AbstractHANADialect { public class HANARowStoreDialect extends AbstractHANADialect {

View File

@ -29,7 +29,7 @@ import static org.hibernate.query.CastType.BOOLEAN;
/** /**
* A dialect for Mimer SQL 11. * A dialect for Mimer SQL 11.
* *
* @author Fredrik lund <fredrik.alund@mimer.se> * @author <a href="mailto:fredrik.alund@mimer.se">Fredrik lund</a>
* @author Gavin King * @author Gavin King
*/ */
public class MimerSQLDialect extends Dialect { public class MimerSQLDialect extends Dialect {

View File

@ -224,7 +224,7 @@ public class TeradataDialect extends Dialect {
/** /**
* Does this dialect support the <tt>FOR UPDATE</tt> syntax? * Does this dialect support the <tt>FOR UPDATE</tt> syntax?
* *
* @return empty string ... Teradata does not support <tt>FOR UPDATE<tt> syntax * @return empty string ... Teradata does not support <tt>FOR UPDATE</tt> syntax
*/ */
@Override @Override
public String getForUpdateString() { public String getForUpdateString() {

View File

@ -36,9 +36,9 @@ import org.hibernate.pretty.MessageHelper;
* A base implementation of EntityEntry * A base implementation of EntityEntry
* *
* @author Gavin King * @author Gavin King
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
* @author Gunnar Morling * @author Gunnar Morling
* @author Sanne Grinovero <sanne@hibernate.org> * @author <a href="mailto:sanne@hibernate.org">Sanne Grinovero </a>
*/ */
public abstract class AbstractEntityEntry implements Serializable, EntityEntry { public abstract class AbstractEntityEntry implements Serializable, EntityEntry {
protected final Object id; protected final Object id;

View File

@ -11,7 +11,7 @@ import org.hibernate.engine.spi.EntityEntryExtraState;
/** /**
* Contains optional state from {@link org.hibernate.engine.spi.EntityEntry}. * Contains optional state from {@link org.hibernate.engine.spi.EntityEntry}.
* *
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class EntityEntryExtraStateHolder implements EntityEntryExtraState { public class EntityEntryExtraStateHolder implements EntityEntryExtraState {
private EntityEntryExtraState next; private EntityEntryExtraState next;

View File

@ -24,9 +24,9 @@ import org.hibernate.persister.entity.EntityPersister;
* immutable in terms of its internal state; the term immutable here refers to the entity it describes. * immutable in terms of its internal state; the term immutable here refers to the entity it describes.
* *
* @author Gavin King * @author Gavin King
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
* @author Gunnar Morling * @author Gunnar Morling
* @author Sanne Grinovero <sanne@hibernate.org> * @author <a href="mailto:sanne@hibernate.org">Sanne Grinovero </a>
* *
* @see org.hibernate.annotations.Immutable * @see org.hibernate.annotations.Immutable
*/ */

View File

@ -22,9 +22,9 @@ import org.hibernate.persister.entity.EntityPersister;
* An EntityEntry implementation for mutable entities. * An EntityEntry implementation for mutable entities.
* *
* @author Gavin King * @author Gavin King
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
* @author Gunnar Morling * @author Gunnar Morling
* @author Sanne Grinovero <sanne@hibernate.org> * @author <a href="mailto:sanne@hibernate.org">Sanne Grinovero </a>
*/ */
public final class MutableEntityEntry extends AbstractEntityEntry { public final class MutableEntityEntry extends AbstractEntityEntry {
/** /**

View File

@ -20,9 +20,9 @@ import org.hibernate.persister.entity.EntityPersister;
* therefore we need to take care of its impact on memory consumption. * therefore we need to take care of its impact on memory consumption.
* *
* @author Gavin King * @author Gavin King
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
* @author Gunnar Morling * @author Gunnar Morling
* @author Sanne Grinovero <sanne@hibernate.org> * @author <a href="mailto:sanne@hibernate.org">Sanne Grinovero </a>
*/ */
public interface EntityEntry { public interface EntityEntry {
LockMode getLockMode(); LockMode getLockMode();

View File

@ -10,7 +10,7 @@ package org.hibernate.engine.spi;
/** /**
* Navigation methods for extra state objects attached to {@link org.hibernate.engine.spi.EntityEntry}. * Navigation methods for extra state objects attached to {@link org.hibernate.engine.spi.EntityEntry}.
* *
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public interface EntityEntryExtraState { public interface EntityEntryExtraState {

View File

@ -70,7 +70,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
* API so that only some methods need to be overridden * API so that only some methods need to be overridden
* (Used by Hibernate Search). * (Used by Hibernate Search).
* *
* @author Sanne Grinovero <sanne@hibernate.org> (C) 2012 Red Hat Inc. * @author <a href="mailto:sanne@hibernate.org">Sanne Grinovero</a> (C) 2012 Red Hat Inc.
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class SessionDelegatorBaseImpl implements SessionImplementor { public class SessionDelegatorBaseImpl implements SessionImplementor {

View File

@ -73,7 +73,7 @@ import org.jboss.logging.Logger;
* The following method is intended to be used by a merge event listener (and other * The following method is intended to be used by a merge event listener (and other
* classes) in the same package to indicate whether the merge operation is being * classes) in the same package to indicate whether the merge operation is being
* performed on a merge entity already in the MergeContext: * performed on a merge entity already in the MergeContext:
* {@link MergeContext#setOperatedOn(Object mergeEntity, boolean isOperatedOn) * {@link MergeContext#setOperatedOn(Object mergeEntity, boolean isOperatedOn)}
* *
* @author Gail Badner * @author Gail Badner
*/ */
@ -149,7 +149,7 @@ public class MergeContext implements Map {
* Returns an unmodifiable set view of the merge-to-managed entity cross-references contained in this MergeContext. * Returns an unmodifiable set view of the merge-to-managed entity cross-references contained in this MergeContext.
* @return an unmodifiable set view of the merge-to-managed entity cross-references contained in this MergeContext * @return an unmodifiable set view of the merge-to-managed entity cross-references contained in this MergeContext
* *
* @see {@link Collections#unmodifiableSet(java.util.Set)} * @see Collections#unmodifiableSet(java.util.Set)
*/ */
public Set entrySet() { public Set entrySet() {
return Collections.unmodifiableSet( mergeToManagedEntityXref.entrySet() ); return Collections.unmodifiableSet( mergeToManagedEntityXref.entrySet() );
@ -180,7 +180,7 @@ public class MergeContext implements Map {
* Returns an unmodifiable set view of the merge entities contained in this MergeContext * Returns an unmodifiable set view of the merge entities contained in this MergeContext
* @return an unmodifiable set view of the merge entities contained in this MergeContext * @return an unmodifiable set view of the merge entities contained in this MergeContext
* *
* @see {@link Collections#unmodifiableSet(java.util.Set)} * @see Collections#unmodifiableSet(java.util.Set)
*/ */
public Set keySet() { public Set keySet() {
return Collections.unmodifiableSet( mergeToManagedEntityXref.keySet() ); return Collections.unmodifiableSet( mergeToManagedEntityXref.keySet() );
@ -319,7 +319,7 @@ public class MergeContext implements Map {
* Returns an unmodifiable Set view of managed entities contained in this MergeContext. * Returns an unmodifiable Set view of managed entities contained in this MergeContext.
* @return an unmodifiable Set view of managed entities contained in this MergeContext * @return an unmodifiable Set view of managed entities contained in this MergeContext
* *
* @see {@link Collections#unmodifiableSet(java.util.Set)} * @see Collections#unmodifiableSet(java.util.Set)
*/ */
public Collection values() { public Collection values() {
return Collections.unmodifiableSet( managedToMergeEntityXref.keySet() ); return Collections.unmodifiableSet( managedToMergeEntityXref.keySet() );
@ -367,7 +367,7 @@ public class MergeContext implements Map {
* *
* @return an unmodifiable map view of the managed-to-merge entity cross-references. * @return an unmodifiable map view of the managed-to-merge entity cross-references.
* *
* @see {@link Collections#unmodifiableMap(java.util.Map)} * @see Collections#unmodifiableMap(java.util.Map)
*/ */
public Map invertMap() { public Map invertMap() {
return Collections.unmodifiableMap( managedToMergeEntityXref ); return Collections.unmodifiableMap( managedToMergeEntityXref );

View File

@ -14,7 +14,7 @@ import org.hibernate.metamodel.model.domain.PersistentAttribute;
/** /**
* Hibernate extension to the JPA entity-graph AttributeNode contract. * Hibernate extension to the JPA entity-graph AttributeNode contract.
* *
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
* @author Steve Ebersole * @author Steve Ebersole
* @author Andrea Boriero * @author Andrea Boriero
*/ */

View File

@ -16,7 +16,7 @@ import org.hibernate.metamodel.model.domain.PersistentAttribute;
* *
* Acts as a "bridge" between JPA's {@link javax.persistence.EntityGraph} and {@link javax.persistence.Subgraph} * Acts as a "bridge" between JPA's {@link javax.persistence.EntityGraph} and {@link javax.persistence.Subgraph}
* *
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
* @author Steve Ebersole * @author Steve Ebersole
* @author Andrea Boriero * @author Andrea Boriero
*/ */

View File

@ -17,7 +17,7 @@ import org.hibernate.metamodel.model.domain.ManagedDomainType;
/** /**
* Integration version of the AttributeNode contract * Integration version of the AttributeNode contract
* *
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public interface AttributeNodeImplementor<J> extends AttributeNode<J>, GraphNodeImplementor<J> { public interface AttributeNodeImplementor<J> extends AttributeNode<J>, GraphNodeImplementor<J> {

View File

@ -20,7 +20,7 @@ import org.hibernate.metamodel.model.domain.PersistentAttribute;
/** /**
* Integration version of the Graph contract * Integration version of the Graph contract
* *
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
* @author Steve Ebersole * @author Steve Ebersole
* @author Andrea Boriero * @author Andrea Boriero
*/ */

View File

@ -12,7 +12,7 @@ import org.hibernate.graph.GraphNode;
* Integration version of the GraphNode contract * Integration version of the GraphNode contract
* *
* @author Steve Ebersole * @author Steve Ebersole
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public interface GraphNodeImplementor<J> extends GraphNode<J> { public interface GraphNodeImplementor<J> extends GraphNode<J> {
@Override @Override

View File

@ -13,7 +13,7 @@ import org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory;
import org.hibernate.service.spi.ServiceRegistryImplementor; import org.hibernate.service.spi.ServiceRegistryImplementor;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class MutableIdentifierGeneratorFactoryInitiator implements StandardServiceInitiator<MutableIdentifierGeneratorFactory> { public class MutableIdentifierGeneratorFactoryInitiator implements StandardServiceInitiator<MutableIdentifierGeneratorFactory> {
public static final MutableIdentifierGeneratorFactoryInitiator INSTANCE = new MutableIdentifierGeneratorFactoryInitiator(); public static final MutableIdentifierGeneratorFactoryInitiator INSTANCE = new MutableIdentifierGeneratorFactoryInitiator();

View File

@ -12,7 +12,7 @@ import org.hibernate.service.Service;
/** /**
* Let people register strategies * Let people register strategies
* *
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public interface MutableIdentifierGeneratorFactory extends IdentifierGeneratorFactory, Service { public interface MutableIdentifierGeneratorFactory extends IdentifierGeneratorFactory, Service {
public void register(String strategy, Class generatorClass); public void register(String strategy, Class generatorClass);

View File

@ -1810,7 +1810,7 @@ public interface CoreMessageLogger extends BasicLogger {
@Message(value = "Using @AttributeOverride or @AttributeOverrides in conjunction with entity inheritance is not supported: %s. The overriding definitions are ignored.", id = 499) @Message(value = "Using @AttributeOverride or @AttributeOverrides in conjunction with entity inheritance is not supported: %s. The overriding definitions are ignored.", id = 499)
void unsupportedAttributeOverrideWithEntityInheritance(String entityName); void unsupportedAttributeOverrideWithEntityInheritance(String entityName);
/** 6.0 message loggers /* 6.0 message loggers
@LogMessage(level = WARN) @LogMessage(level = WARN)
@Message(value = "The bytecode provider class [%s] could not be loaded", id = 500) @Message(value = "The bytecode provider class [%s] could not be loaded", id = 500)
void bytecodeProviderClassNotFound(String className); void bytecodeProviderClassNotFound(String className);

View File

@ -348,7 +348,7 @@ public final class StringHelper {
/** /**
* Collapses a name. Mainly intended for use with classnames, where an example might serve best to explain. * Collapses a name. Mainly intended for use with classnames, where an example might serve best to explain.
* Imagine you have a class named <samp>'org.hibernate.internal.util.StringHelper'</samp>; calling collapse on that * Imagine you have a class named <samp>'org.hibernate.internal.util.StringHelper'</samp>; calling collapse on that
* classname will result in <samp>'o.h.u.StringHelper'<samp>. * classname will result in <samp>'o.h.u.StringHelper'</samp>.
* *
* @param name The name to collapse. * @param name The name to collapse.
* *

View File

@ -283,14 +283,14 @@ public interface AvailableSettings {
/** /**
* Caching configuration should follow the following pattern * Caching configuration should follow the following pattern
* hibernate.ejb.classcache.<fully.qualified.Classname> usage[, region] * {@code hibernate.ejb.classcache.<fully.qualified.Classname> usage[, region]}
* where usage is the cache strategy used and region the cache region name * where usage is the cache strategy used and region the cache region name
*/ */
String CLASS_CACHE_PREFIX = "hibernate.ejb.classcache"; String CLASS_CACHE_PREFIX = "hibernate.ejb.classcache";
/** /**
* Caching configuration should follow the following pattern * Caching configuration should follow the following pattern
* hibernate.ejb.collectioncache.<fully.qualified.Classname>.<role> usage[, region] * {@code hibernate.ejb.collectioncache.<fully.qualified.Classname>.<role> usage[, region]}
* where usage is the cache strategy used and region the cache region name * where usage is the cache strategy used and region the cache region name
*/ */
String COLLECTION_CACHE_PREFIX = "hibernate.ejb.collectioncache"; String COLLECTION_CACHE_PREFIX = "hibernate.ejb.collectioncache";

View File

@ -20,6 +20,9 @@ import java.util.WeakHashMap;
import javax.persistence.spi.LoadState; import javax.persistence.spi.LoadState;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.bytecode.enhance.spi.interceptor.AbstractLazyLoadInterceptor;
import org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor;
import org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor;
import org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor; import org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor;
import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.engine.spi.PersistentAttributeInterceptable; import org.hibernate.engine.spi.PersistentAttributeInterceptable;
@ -94,13 +97,12 @@ public final class PersistenceUtilHelper {
@SuppressWarnings("SimplifiableIfStatement") @SuppressWarnings("SimplifiableIfStatement")
private static boolean isInitialized(PersistentAttributeInterceptable interceptable) { private static boolean isInitialized(PersistentAttributeInterceptable interceptable) {
final LazyAttributeLoadingInterceptor interceptor = extractInterceptor( interceptable ); final BytecodeLazyAttributeInterceptor interceptor = extractInterceptor( interceptable );
return interceptable == null || interceptor == null || !interceptor.hasAnyUninitializedAttributes(); return interceptable == null || interceptor == null || !interceptor.hasAnyUninitializedAttributes();
} }
private static LazyAttributeLoadingInterceptor extractInterceptor(PersistentAttributeInterceptable interceptable) { private static BytecodeLazyAttributeInterceptor extractInterceptor(PersistentAttributeInterceptable interceptable) {
return (LazyAttributeLoadingInterceptor) interceptable.$$_hibernate_getInterceptor(); return (BytecodeLazyAttributeInterceptor) interceptable.$$_hibernate_getInterceptor();
} }
/** /**
@ -130,7 +132,7 @@ public final class PersistenceUtilHelper {
// we are instrumenting but we can't assume we are the only ones // we are instrumenting but we can't assume we are the only ones
if ( entity instanceof PersistentAttributeInterceptable ) { if ( entity instanceof PersistentAttributeInterceptable ) {
final LazyAttributeLoadingInterceptor interceptor = extractInterceptor( (PersistentAttributeInterceptable) entity ); final BytecodeLazyAttributeInterceptor interceptor = extractInterceptor( (PersistentAttributeInterceptable) entity );
final boolean isInitialized = interceptor == null || interceptor.isAttributeLoaded( attributeName ); final boolean isInitialized = interceptor == null || interceptor.isAttributeLoaded( attributeName );
LoadState state; LoadState state;
if (isInitialized && interceptor != null) { if (isInitialized && interceptor != null) {

View File

@ -11,7 +11,7 @@ import java.util.Map;
/** /**
* Provide a set of IdentifierGenerator strategies allowing to override the Hibernate Core default ones * Provide a set of IdentifierGenerator strategies allowing to override the Hibernate Core default ones
* *
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public interface IdentifierGeneratorStrategyProvider { public interface IdentifierGeneratorStrategyProvider {
/** /**

View File

@ -57,7 +57,7 @@ import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
* <li>{@link #buildAttribute normal attributes}</li> * <li>{@link #buildAttribute normal attributes}</li>
* <li>{@link #buildIdAttribute id attributes}</li> * <li>{@link #buildIdAttribute id attributes}</li>
* <li>{@link #buildVersionAttribute version attributes}</li> * <li>{@link #buildVersionAttribute version attributes}</li>
* <ol> * </ol>
* *
* @author Steve Ebersole * @author Steve Ebersole
* @author Emmanuel Bernard * @author Emmanuel Bernard

View File

@ -21,7 +21,7 @@ import org.hibernate.service.Service;
* <li>the default provider as chosen by Hibernate Core (best choice most of the time)</li> * <li>the default provider as chosen by Hibernate Core (best choice most of the time)</li>
* </ol> * </ol>
* *
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public interface PersisterClassResolver extends Service { public interface PersisterClassResolver extends Service {

View File

@ -6,8 +6,6 @@
*/ */
package org.hibernate.proxy.pojo.bytebuddy; package org.hibernate.proxy.pojo.bytebuddy;
import static org.hibernate.internal.CoreLogging.messageLogger;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Type; import java.lang.reflect.Type;
@ -15,6 +13,7 @@ import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.function.Function;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState; import org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState;
@ -24,12 +23,16 @@ import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.ProxyConfiguration; import org.hibernate.proxy.ProxyConfiguration;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.NamingStrategy; import net.bytebuddy.NamingStrategy;
import net.bytebuddy.TypeCache; import net.bytebuddy.TypeCache;
import net.bytebuddy.description.modifier.Visibility; import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy; import net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy;
import net.bytebuddy.implementation.SuperMethodCall; import net.bytebuddy.implementation.SuperMethodCall;
import static org.hibernate.internal.CoreLogging.messageLogger;
public class ByteBuddyProxyHelper implements Serializable { public class ByteBuddyProxyHelper implements Serializable {
private static final CoreMessageLogger LOG = messageLogger( ByteBuddyProxyHelper.class ); private static final CoreMessageLogger LOG = messageLogger( ByteBuddyProxyHelper.class );
@ -51,7 +54,19 @@ public class ByteBuddyProxyHelper implements Serializable {
} }
key.addAll( Arrays.<Class<?>>asList( interfaces ) ); key.addAll( Arrays.<Class<?>>asList( interfaces ) );
return byteBuddyState.loadProxy( persistentClass, new TypeCache.SimpleKey(key), byteBuddy -> byteBuddy return byteBuddyState.loadProxy( persistentClass, new TypeCache.SimpleKey( key ), proxyBuilder( persistentClass, interfaces ) );
}
/**
* Do not remove: used by Quarkus
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public DynamicType.Unloaded<?> buildUnloadedProxy(final Class persistentClass, final Class[] interfaces) {
return byteBuddyState.make( proxyBuilder( persistentClass, interfaces ) );
}
private Function<ByteBuddy, DynamicType.Builder<?>> proxyBuilder(Class persistentClass, Class[] interfaces) {
return byteBuddy -> byteBuddy
.ignore( byteBuddyState.getProxyDefinitionHelpers().getGroovyGetMetaClassFilter() ) .ignore( byteBuddyState.getProxyDefinitionHelpers().getGroovyGetMetaClassFilter() )
.with( new NamingStrategy.SuffixingRandom( PROXY_NAMING_SUFFIX, new NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue( persistentClass.getName() ) ) ) .with( new NamingStrategy.SuffixingRandom( PROXY_NAMING_SUFFIX, new NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue( persistentClass.getName() ) ) )
.subclass( interfaces.length == 1 ? persistentClass : Object.class, ConstructorStrategy.Default.IMITATE_SUPER_CLASS_OPENING ) .subclass( interfaces.length == 1 ? persistentClass : Object.class, ConstructorStrategy.Default.IMITATE_SUPER_CLASS_OPENING )
@ -62,8 +77,7 @@ public class ByteBuddyProxyHelper implements Serializable {
.intercept( SuperMethodCall.INSTANCE ) .intercept( SuperMethodCall.INSTANCE )
.defineField( ProxyConfiguration.INTERCEPTOR_FIELD_NAME, ProxyConfiguration.Interceptor.class, Visibility.PRIVATE ) .defineField( ProxyConfiguration.INTERCEPTOR_FIELD_NAME, ProxyConfiguration.Interceptor.class, Visibility.PRIVATE )
.implement( ProxyConfiguration.class ) .implement( ProxyConfiguration.class )
.intercept( byteBuddyState.getProxyDefinitionHelpers().getInterceptorFieldAccessor() ) .intercept( byteBuddyState.getProxyDefinitionHelpers().getInterceptorFieldAccessor() );
);
} }
public HibernateProxy deserializeProxy(SerializableProxy serializableProxy) { public HibernateProxy deserializeProxy(SerializableProxy serializableProxy) {

View File

@ -73,7 +73,7 @@ public class QueryStatisticsImpl implements QueryStatistics {
/** /**
* Number of lines returned by all the executions of this query (from DB) * Number of lines returned by all the executions of this query (from DB)
* For now, {@link org.hibernate.Query#iterate()} * For now, {@link org.hibernate.Query#iterate()}
* and {@link org.hibernate.Query#scroll()()} do not fill this statistic * and {@link org.hibernate.Query#scroll()} do not fill this statistic
* *
* @return The number of rows cumulatively returned by the given query; iterate * @return The number of rows cumulatively returned by the given query; iterate
* and scroll queries do not effect this total as their number of returned rows * and scroll queries do not effect this total as their number of returned rows

View File

@ -36,7 +36,7 @@ import java.util.List;
* Code based on from: * Code based on from:
* https://github.com/hibernate/hibernate-orm/blob/159bc99a36d86988b61b88ba91eec82cac044e1c/hibernate-core/src/main/java/org/hibernate/tool/enhance/EnhancementTask.java * https://github.com/hibernate/hibernate-orm/blob/159bc99a36d86988b61b88ba91eec82cac044e1c/hibernate-core/src/main/java/org/hibernate/tool/enhance/EnhancementTask.java
* https://github.com/hibernate/hibernate-orm/blob/159bc99a36d86988b61b88ba91eec82cac044e1c/tooling/hibernate-enhance-maven-plugin/src/main/java/org/hibernate/orm/tooling/maven/MavenEnhancePlugin.java * https://github.com/hibernate/hibernate-orm/blob/159bc99a36d86988b61b88ba91eec82cac044e1c/tooling/hibernate-enhance-maven-plugin/src/main/java/org/hibernate/orm/tooling/maven/MavenEnhancePlugin.java
* * <pre>{@code
* <target name="enhance" depends="compile"> * <target name="enhance" depends="compile">
* <taskdef name="enhance" classname="org.hibernate.tool.enhance.EnhancementTask"> * <taskdef name="enhance" classname="org.hibernate.tool.enhance.EnhancementTask">
* <classpath refid="<some-ant-path-including-hibernate-core-jar>"/> * <classpath refid="<some-ant-path-including-hibernate-core-jar>"/>
@ -44,6 +44,7 @@ import java.util.List;
* </taskdef> * </taskdef>
* <enhance base="${base}" dir="${base}" failOnError="true" enableLazyInitialization="true" enableDirtyTracking="false" enableAssociationManagement="false" enableExtendedEnhancement="false" /> * <enhance base="${base}" dir="${base}" failOnError="true" enableLazyInitialization="true" enableDirtyTracking="false" enableAssociationManagement="false" enableExtendedEnhancement="false" />
* </target> * </target>
* }</pre>
* *
* @author Luis Barreiro * @author Luis Barreiro
* @author Taro App * @author Taro App

View File

@ -10,7 +10,7 @@ import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
public class Bell { public class Bell {

View File

@ -69,7 +69,7 @@ import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class PersisterClassProviderTest { public class PersisterClassProviderTest {
@Test @Test

View File

@ -21,7 +21,7 @@ import org.hibernate.jpa.boot.spi.Bootstrap;
import org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder; import org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class SessionFactoryObserverTest { public class SessionFactoryObserverTest {
@Test @Test

View File

@ -13,7 +13,7 @@ import javax.persistence.Id;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
public class Cable { public class Cable {

View File

@ -7,7 +7,7 @@
package org.hibernate.jpa.test.ejb3configuration.id; package org.hibernate.jpa.test.ejb3configuration.id;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class FunkyException extends RuntimeException { public class FunkyException extends RuntimeException {
} }

View File

@ -11,7 +11,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator; import org.hibernate.id.IdentifierGenerator;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class FunkyIdGenerator implements IdentifierGenerator { public class FunkyIdGenerator implements IdentifierGenerator {
public Object generate(SharedSessionContractImplementor session, Object object) throws HibernateException { public Object generate(SharedSessionContractImplementor session, Object object) throws HibernateException {

View File

@ -10,7 +10,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class FunkyIdentifierGeneratorProvider implements org.hibernate.jpa.spi.IdentifierGeneratorStrategyProvider { public class FunkyIdentifierGeneratorProvider implements org.hibernate.jpa.spi.IdentifierGeneratorStrategyProvider {
public Map<String, Class<?>> getStrategies() { public Map<String, Class<?>> getStrategies() {

View File

@ -21,7 +21,7 @@ import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class IdentifierGeneratorStrategyProviderTest { public class IdentifierGeneratorStrategyProviderTest {
@Test @Test

View File

@ -7,7 +7,7 @@
package org.hibernate.jpa.test.graphs.named.basic; package org.hibernate.jpa.test.graphs.named.basic;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class BasicAnnNamedEntityGraphTest extends AbstractNamedEntityGraphTest{ public class BasicAnnNamedEntityGraphTest extends AbstractNamedEntityGraphTest{
@Override @Override

View File

@ -7,7 +7,7 @@
package org.hibernate.jpa.test.graphs.named.basic; package org.hibernate.jpa.test.graphs.named.basic;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class BasicOrmNamedEntityGraphTest extends AbstractNamedEntityGraphTest{ public class BasicOrmNamedEntityGraphTest extends AbstractNamedEntityGraphTest{
@Override @Override

View File

@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue;
/** /**
* no need to run this on DB matrix * no need to run this on DB matrix
* *
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
@RequiresDialect(H2Dialect.class) @RequiresDialect(H2Dialect.class)
public class LockTimeoutPropertyTest extends BaseEntityManagerFunctionalTestCase { public class LockTimeoutPropertyTest extends BaseEntityManagerFunctionalTestCase {

View File

@ -18,7 +18,7 @@ import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
@TestForIssue( jiraKey = "HHH-6039, HHH-6100" ) @TestForIssue( jiraKey = "HHH-6039, HHH-6100" )
public class JpaEntityNameTest extends BaseEntityManagerFunctionalTestCase { public class JpaEntityNameTest extends BaseEntityManagerFunctionalTestCase {

View File

@ -7,7 +7,7 @@
package org.hibernate.jpa.test.xml; package org.hibernate.jpa.test.xml;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class Qualifier { public class Qualifier {
private Long qualifierId; private Long qualifierId;

View File

@ -12,7 +12,7 @@ import javax.persistence.Id;
/** /**
* Entity with assigned identity * Entity with assigned identity
* *
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
public class Hotel { public class Hotel {

View File

@ -30,7 +30,7 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public abstract class AbstractJPAIndexTest extends BaseNonConfigCoreFunctionalTestCase { public abstract class AbstractJPAIndexTest extends BaseNonConfigCoreFunctionalTestCase {
@Override @Override

View File

@ -24,7 +24,7 @@ import javax.persistence.Table;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
@Entity @Entity
@Table(indexes = { @Table(indexes = {

View File

@ -10,7 +10,7 @@ import java.io.Serializable;
import javax.persistence.Embeddable; import javax.persistence.Embeddable;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
@Embeddable @Embeddable
public class Dealer implements Serializable { public class Dealer implements Serializable {

View File

@ -15,7 +15,7 @@ import javax.persistence.JoinTable;
import javax.persistence.ManyToMany; import javax.persistence.ManyToMany;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
@Entity @Entity
public class Importer { public class Importer {

View File

@ -7,7 +7,7 @@
package org.hibernate.test.annotations.index.jpa; package org.hibernate.test.annotations.index.jpa;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class IndexTest extends AbstractJPAIndexTest { public class IndexTest extends AbstractJPAIndexTest {
@Override @Override

View File

@ -8,7 +8,7 @@ package org.hibernate.test.annotations.index.jpa;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
public class OrmXmlIndexTest extends AbstractJPAIndexTest { public class OrmXmlIndexTest extends AbstractJPAIndexTest {
@Override @Override

View File

@ -10,7 +10,7 @@ import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass; import javax.persistence.MappedSuperclass;
/** /**
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com> * @author <a href="mailto:bernhardt.manuel@gmail.com">Manuel Bernhardt</a>
*/ */
@MappedSuperclass @MappedSuperclass
public class Building { public class Building {

View File

@ -14,7 +14,7 @@ import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com> * @author <a href="mailto:bernhardt.manuel@gmail.com">Manuel Bernhardt</a>
*/ */
@Entity @Entity
@Table(uniqueConstraints = {@UniqueConstraint(name = "uniqueWithInherited", columnNames = {"room_id", "cost"} )}) @Table(uniqueConstraints = {@UniqueConstraint(name = "uniqueWithInherited", columnNames = {"room_id", "cost"} )})

View File

@ -11,7 +11,7 @@ import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
/** /**
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com> * @author <a href="mailto:bernhardt.manuel@gmail.com">Manuel Bernhardt</a>
*/ */
@Entity @Entity
public class Room { public class Room {

View File

@ -18,7 +18,7 @@ import static org.hibernate.testing.junit4.ExtraAssertions.assertTyping;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
/** /**
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com> * @author <a href="mailto:bernhardt.manuel@gmail.com">Manuel Bernhardt</a>
* @author Brett Meyer * @author Brett Meyer
*/ */
public class UniqueConstraintTest extends BaseCoreFunctionalTestCase { public class UniqueConstraintTest extends BaseCoreFunctionalTestCase {

View File

@ -9,6 +9,8 @@ package org.hibernate.test.bytecode.enhancement.lazy.proxy;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.spi.LoadState;
import javax.persistence.spi.PersistenceProvider;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
@ -16,6 +18,7 @@ import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.SessionFactoryBuilder; import org.hibernate.boot.SessionFactoryBuilder;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.AvailableSettings;
import org.hibernate.jpa.internal.util.PersistenceUtilHelper;
import org.hibernate.testing.TestForIssue; import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner; import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
@ -37,6 +40,9 @@ import static org.junit.Assert.assertTrue;
@RunWith(BytecodeEnhancerRunner.class) @RunWith(BytecodeEnhancerRunner.class)
@EnhancementOptions(lazyLoading = true,inlineDirtyChecking = true) @EnhancementOptions(lazyLoading = true,inlineDirtyChecking = true)
public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extends BaseNonConfigCoreFunctionalTestCase { public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extends BaseNonConfigCoreFunctionalTestCase {
private final PersistenceUtilHelper.MetadataCache metadataCache = new PersistenceUtilHelper.MetadataCache();
@Override @Override
protected void configureStandardServiceRegistryBuilder(StandardServiceRegistryBuilder ssrb) { protected void configureStandardServiceRegistryBuilder(StandardServiceRegistryBuilder ssrb) {
super.configureStandardServiceRegistryBuilder( ssrb ); super.configureStandardServiceRegistryBuilder( ssrb );
@ -74,8 +80,10 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
Animal animal = session.load( Animal.class, "animal" ); Animal animal = session.load( Animal.class, "animal" );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "sex", metadataCache ) );
assertEquals( "female", animal.getSex() ); assertEquals( "female", animal.getSex() );
assertTrue( Hibernate.isInitialized( animal ) ); assertTrue( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "sex", metadataCache ) );
assertEquals( 3, animal.getAge() ); assertEquals( 3, animal.getAge() );
animal.setSex( "other" ); animal.setSex( "other" );
} }
@ -85,6 +93,7 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
Animal animal = session.get( Animal.class, "animal" ); Animal animal = session.get( Animal.class, "animal" );
assertTrue( Hibernate.isInitialized( animal ) ); assertTrue( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "name", metadataCache ) );
assertEquals( "other", animal.getSex() ); assertEquals( "other", animal.getSex() );
assertEquals( 3, animal.getAge() ); assertEquals( 3, animal.getAge() );
assertEquals( "green", animal.getColor() ); assertEquals( "green", animal.getColor() );
@ -109,10 +118,12 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
Animal animal = session.load( Animal.class, "animal" ); Animal animal = session.load( Animal.class, "animal" );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "sex", metadataCache ) );
animal.setSex( "other" ); animal.setSex( "other" );
// Setting the attribute value should not initialize animal // Setting the attribute value should not initialize animal
// with dirty-checking and dynamic-update. // with dirty-checking and dynamic-update.
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "sex", metadataCache ) );
} }
); );
@ -157,8 +168,10 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
final Animal animal = session.load( Animal.class, "animal" ); final Animal animal = session.load( Animal.class, "animal" );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "age", metadataCache ) );
session.merge( animalInitialized ); session.merge( animalInitialized );
assertTrue( Hibernate.isInitialized( animal ) ); assertTrue( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "age", metadataCache ) );
assertEquals( 4, animal.getAge() ); assertEquals( 4, animal.getAge() );
assertEquals( "other", animal.getSex() ); assertEquals( "other", animal.getSex() );
} }
@ -239,6 +252,8 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
final Animal animal = session.load( Animal.class, "animal" ); final Animal animal = session.load( Animal.class, "animal" );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "age", metadataCache ) );
assertFalse( Hibernate.isInitialized( animal ) ); //checking again against side effects of using PersistenceUtilHelper
return animal; return animal;
} }
); );
@ -247,8 +262,11 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
final Animal animal = session.load( Animal.class, "animal" ); final Animal animal = session.load( Animal.class, "animal" );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "age", metadataCache ) );
session.merge( animalUninitialized ); session.merge( animalUninitialized );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "age", metadataCache ) );
assertFalse( Hibernate.isInitialized( animal ) );
} }
); );
@ -279,6 +297,8 @@ public class ProxyInitializeAndUpdateInlineDirtyTrackingDynamicUpdateTest extend
session -> { session -> {
final Animal animal = session.load( Animal.class, "animal" ); final Animal animal = session.load( Animal.class, "animal" );
assertFalse( Hibernate.isInitialized( animal ) ); assertFalse( Hibernate.isInitialized( animal ) );
assertEquals( LoadState.NOT_LOADED , PersistenceUtilHelper.isLoadedWithoutReference( animal, "age", metadataCache ) );
assertFalse( Hibernate.isInitialized( animal ) );
return animal; return animal;
} }
); );

View File

@ -10,7 +10,7 @@ import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
public class Gate { public class Gate {

View File

@ -7,7 +7,7 @@
package org.hibernate.test.cfg.persister; package org.hibernate.test.cfg.persister;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class GoofyException extends RuntimeException { public class GoofyException extends RuntimeException {
private Class<?> value; private Class<?> value;

View File

@ -67,7 +67,7 @@ import org.hibernate.type.VersionType;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class GoofyPersisterClassProvider implements PersisterClassResolver { public class GoofyPersisterClassProvider implements PersisterClassResolver {
@Override @Override

View File

@ -9,7 +9,7 @@ package org.hibernate.test.cfg.persister;
import javax.persistence.Entity; import javax.persistence.Entity;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
public class Palmtree extends Tree { public class Palmtree extends Tree {

View File

@ -22,7 +22,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class PersisterClassProviderTest extends BaseUnitTestCase { public class PersisterClassProviderTest extends BaseUnitTestCase {
@Test @Test

View File

@ -15,7 +15,7 @@ import org.hibernate.annotations.Persister;
import org.hibernate.persister.entity.SingleTableEntityPersister; import org.hibernate.persister.entity.SingleTableEntityPersister;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
@Persister( impl = SingleTableEntityPersister.class) @Persister( impl = SingleTableEntityPersister.class)

View File

@ -10,7 +10,7 @@ import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
public class Tree { public class Tree {

View File

@ -13,7 +13,7 @@ import org.hibernate.annotations.Persister;
import org.hibernate.persister.entity.SingleTableEntityPersister; import org.hibernate.persister.entity.SingleTableEntityPersister;
/** /**
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
@Entity @Entity
@Persister( impl = SingleTableEntityPersister.class) @Persister( impl = SingleTableEntityPersister.class)

View File

@ -19,7 +19,7 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
/** /**
@author Strong Liu <stliu@redhat.com> @author <a href="mailto:stliu@redhat.com">Strong Liu</a>
*/ */
@RequiresDialect( MySQLDialect.class ) @RequiresDialect( MySQLDialect.class )
public class MySQLRoundFunctionTest extends BaseCoreFunctionalTestCase { public class MySQLRoundFunctionTest extends BaseCoreFunctionalTestCase {

View File

@ -10,7 +10,7 @@ import java.util.Date;
/** /**
* *
* @author Strong Liu <stliu@redhat.com> * @author <a href="mailto:stliu@redhat.com">Strong Liu</a>
* *
*/ */
public class Product { public class Product {

View File

@ -29,7 +29,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
/** /**
* @author Piotr Krauzowicz <p.krauzowicz@visiona.pl> * @author <a href="mailto:p.krauzowicz@visiona.pl">Piotr Krauzowicz</a>
* @author Gail Badner * @author Gail Badner
*/ */
@SkipForDialect(value = MySQL5Dialect.class, comment = "BLOB/TEXT column 'id' used in key specification without a key length") @SkipForDialect(value = MySQL5Dialect.class, comment = "BLOB/TEXT column 'id' used in key specification without a key length")

View File

@ -26,7 +26,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
/** /**
* @author Piotr Krauzowicz <p.krauzowicz@visiona.pl> * @author <a href="mailto:p.krauzowicz@visiona.pl">Piotr Krauzowicz</a>
* @author Gail Badner * @author Gail Badner
*/ */
public class CharacterArrayIdTest extends BaseCoreFunctionalTestCase { public class CharacterArrayIdTest extends BaseCoreFunctionalTestCase {

View File

@ -30,7 +30,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
/** /**
* @author Piotr Krauzowicz <p.krauzowicz@visiona.pl> * @author <a href="mailto:p.krauzowicz@visiona.pl">Piotr Krauzowicz</a>
* @author Gail Badner * @author Gail Badner
*/ */
@SkipForDialect(value = MySQL5Dialect.class, comment = "BLOB/TEXT column 'id' used in key specification without a key length") @SkipForDialect(value = MySQL5Dialect.class, comment = "BLOB/TEXT column 'id' used in key specification without a key length")

View File

@ -26,7 +26,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
/** /**
* @author Piotr Krauzowicz <p.krauzowicz@visiona.pl> * @author <a href="mailto:p.krauzowicz@visiona.pl">Piotr Krauzowicz</a>
* @author Gail Badner * @author Gail Badner
*/ */
public class PrimitiveCharacterArrayIdTest extends BaseCoreFunctionalTestCase { public class PrimitiveCharacterArrayIdTest extends BaseCoreFunctionalTestCase {

View File

@ -7,7 +7,7 @@
package org.hibernate.test.pagination; package org.hibernate.test.pagination;
/** /**
* @author Piotr Findeisen <piotr.findeisen@gmail.com> * @author <a href="mailto:piotr.findeisen@gmail.com">Piotr Findeisen</a>
*/ */
public class DataMetaPoint { public class DataMetaPoint {
private long id; private long id;

View File

@ -7,7 +7,10 @@
package org.hibernate.test.pagination; package org.hibernate.test.pagination;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;
@ -19,13 +22,16 @@ import org.hibernate.Session;
import org.hibernate.testing.DialectChecks; import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import static java.lang.String.format;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/** /**
* @author Gavin King * @author Gavin King
@ -100,6 +106,41 @@ public class PaginationTest extends BaseNonConfigCoreFunctionalTestCase {
); );
} }
/**
* @author <a href="mailto:piotr.findeisen@gmail.com">Piotr Findeisen</a>
*/
@Test
@TestForIssue( jiraKey = "HHH-951" )
@RequiresDialectFeature(
value = DialectChecks.SupportLimitCheck.class,
comment = "Dialect does not support limit"
)
public void testLimitWithExpreesionAndFetchJoin() {
Session session = openSession();
session.beginTransaction();
String hql = "SELECT b, 1 FROM DataMetaPoint b inner join fetch b.dataPoint dp";
session.createQuery(hql)
.setMaxResults(3)
// This should not fail
.list();
HQLQueryPlan queryPlan = new HQLQueryPlan( hql, false, Collections.EMPTY_MAP, sessionFactory());
String sqlQuery = queryPlan.getTranslators()[0]
.collectSqlStrings().get(0);
session.getTransaction().commit();
session.close();
Matcher matcher = Pattern.compile(
"(?is)\\b(?<column>\\w+\\.\\w+)\\s+as\\s+(?<alias>\\w+)\\b.*\\k<column>\\s+as\\s+\\k<alias>")
.matcher(sqlQuery);
if (matcher.find()) {
fail(format("Column %s mapped to alias %s twice in generated SQL: %s", matcher.group("column"),
matcher.group("alias"), sqlQuery));
}
}
@Test @Test
@RequiresDialectFeature( @RequiresDialectFeature(
value = DialectChecks.SupportLimitAndOffsetCheck.class, value = DialectChecks.SupportLimitAndOffsetCheck.class,

View File

@ -31,7 +31,7 @@ import static org.junit.Assert.assertSame;
/** /**
* @author Artem V. Navrotskiy * @author Artem V. Navrotskiy
* @author Emmanuel Bernard <emmanuel@hibernate.org> * @author <a href="mailto:emmanuel@hibernate.org">Emmanuel Bernard</a>
*/ */
public class ClassLoaderServiceImplTest { public class ClassLoaderServiceImplTest {
/** /**

View File

@ -12,8 +12,8 @@ import java.util.Currency;
/** /**
* Represents a monetary amount as value and currency. * Represents a monetary amount as value and currency.
* *
* @author Gavin King <gavin@hibernate.org> * @author <a href="mailto:gavin@hibernate.org">Gavin King</a>
* @author Christian Bauer <christian@hibernate.org> * @author <a href="mailto:christian@hibernate.org">Christian Bauer</a>
*/ */
public class MonetaryAmount implements Serializable { public class MonetaryAmount implements Serializable {

View File

@ -22,7 +22,7 @@ import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
/** /**
* @author Strong Liu <stliu@hibernate.org> * @author <a href="mailto:stliu@hibernate.org">Strong Liu</a>
*/ */
@SkipForDialect(value = H2Dialect.class, comment = "H2 doesn't support this sql syntax") @SkipForDialect(value = H2Dialect.class, comment = "H2 doesn't support this sql syntax")
@SkipForDialect(value = SQLServerDialect.class, comment = "mssql doesn't support multiple columns in the 'where' clause of a 'where in' query") @SkipForDialect(value = SQLServerDialect.class, comment = "mssql doesn't support multiple columns in the 'where' clause of a 'where in' query")

View File

@ -9,7 +9,7 @@ package org.hibernate.test.unionsubclass.alias;
/** /**
* *
* @author Strong Liu <stliu@redhat.com> * @author <a href="mailto:stliu@redhat.com">Strong Liu</a>
*/ */
public class CarBuyer extends Customer { public class CarBuyer extends Customer {
private String sellerName; private String sellerName;

Some files were not shown because too many files have changed in this diff Show More