From 3df0fcefa40b2f1a6c273c7a37002b87ed65562c Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Sat, 4 Jan 2020 15:20:09 -0500 Subject: [PATCH 01/10] HHH-13802 fix javadoc warnings --- hibernate-core/src/main/antlr/order-by.g | 4 +- .../CustomEntityDirtinessStrategy.java | 2 +- .../src/main/java/org/hibernate/SQLQuery.java | 6 +-- .../hibernate/action/spi/package-info.java | 2 +- .../org/hibernate/annotations/Filter.java | 2 +- .../hibernate/annotations/FlushModeType.java | 2 - .../org/hibernate/boot/MetadataBuilder.java | 2 +- .../archive/scan/spi/AbstractScannerImpl.java | 2 +- .../boot/model/naming/Identifier.java | 2 +- .../boot/model/source/spi/FilterSource.java | 4 +- .../boot/model/source/spi/Orderable.java | 2 +- .../hibernate/boot/registry/package-info.java | 14 +++--- .../registry/selector/spi/package-info.java | 2 +- .../boot/spi/MetadataBuildingContext.java | 2 +- .../boot/spi/MetadataImplementor.java | 2 +- .../cache/spi/access/NaturalIdDataAccess.java | 2 +- .../org/hibernate/cfg/NamingStrategy.java | 2 +- .../org/hibernate/cfg/PropertyHolder.java | 2 +- .../JPAOverriddenAnnotationReader.java | 2 +- .../org/hibernate/dialect/DB2Dialect.java | 2 +- .../java/org/hibernate/dialect/Dialect.java | 8 ++-- .../hibernate/dialect/Oracle8iDialect.java | 13 +++--- .../engine/jdbc/SerializableBlobProxy.java | 2 +- .../engine/jdbc/env/spi/JdbcEnvironment.java | 2 +- .../org/hibernate/engine/spi/ActionQueue.java | 4 +- .../hibernate/engine/spi/BatchFetchQueue.java | 2 +- .../engine/spi/PersistenceContext.java | 43 +++++++++---------- .../spi/SharedSessionContractImplementor.java | 2 +- .../event/service/spi/EventListenerGroup.java | 2 +- .../spi/ExpandingCollectionQuerySpace.java | 2 +- .../spi/ResultSetProcessingContext.java | 2 +- .../spi/ScrollableResultSetProcessor.java | 7 +-- .../model/domain/EmbeddedDomainType.java | 3 +- .../entity/AbstractEntityPersister.java | 2 +- .../entity/JoinedSubclassEntityPersister.java | 4 +- .../proxy/AbstractLazyInitializer.java | 2 +- .../query/spi/QueryParameterListBinding.java | 3 +- .../spi/DdlTransactionIsolator.java | 2 +- .../SessionFactoryServiceRegistryFactory.java | 1 - .../ordering/antlr/OrderByTranslation.java | 2 +- .../java/org/hibernate/stat/Statistics.java | 8 ++-- .../extract/spi/DatabaseInformation.java | 4 +- .../hibernate/tuple/IdentifierProperty.java | 2 - .../main/java/org/hibernate/type/Type.java | 4 +- .../type/descriptor/sql/LobTypeMappings.java | 4 +- .../sql/NationalizedTypeMappings.java | 2 +- .../hibernate/type/spi/TypeConfiguration.java | 2 +- .../test/annotations/cascade/CascadeTest.java | 4 +- 48 files changed, 97 insertions(+), 101 deletions(-) diff --git a/hibernate-core/src/main/antlr/order-by.g b/hibernate-core/src/main/antlr/order-by.g index aababad481..8d7a4a5e26 100644 --- a/hibernate-core/src/main/antlr/order-by.g +++ b/hibernate-core/src/main/antlr/order-by.g @@ -127,7 +127,7 @@ tokens /** * Process the given node as a function. * - * @param The node representing the function invocation (including parameters as subtree components). + * @param ast The node representing the function invocation (including parameters as subtree components). * * @return The processed node. */ @@ -149,7 +149,7 @@ tokens /** * Allow post processing of each sort specification * - * @param The grammar-built sort specification subtree. + * @param sortSpec The grammar-built sort specification subtree. * * @return The processed sort specification subtree. */ diff --git a/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java b/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java index a9ddcf9b79..3ee645c21d 100644 --- a/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/CustomEntityDirtinessStrategy.java @@ -41,7 +41,7 @@ public interface CustomEntityDirtinessStrategy { * @param persister The persister corresponding to the given entity * @param session The session from which this check originates. * - * @return {@code true} indicates the entity is dirty; {@link false} indicates the entity is not dirty. + * @return {@code true} indicates the entity is dirty; {@code false} indicates the entity is not dirty. */ public boolean isDirty(Object entity, EntityPersister persister, Session session); diff --git a/hibernate-core/src/main/java/org/hibernate/SQLQuery.java b/hibernate-core/src/main/java/org/hibernate/SQLQuery.java index a4e0a868a6..8b7cd59dfa 100755 --- a/hibernate-core/src/main/java/org/hibernate/SQLQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/SQLQuery.java @@ -49,7 +49,7 @@ * {@link #addFetch} and {@link #addScalar} methods * * - * + * * @author Gavin King * @author Steve Ebersole * @@ -105,7 +105,7 @@ public interface SQLQuery extends Query, SynchronizeableQuery { SQLQuery addScalar(String columnAlias, Type type); /** - * Add a new root return mapping, returning a {@link NativeQuery.RootReturn} to allow further definition. + * Add a new root return mapping, returning a {@link SQLQuery.RootReturn} to allow further definition. * * @param tableAlias The SQL table alias to map to this entity * @param entityName The name of the entity. @@ -117,7 +117,7 @@ public interface SQLQuery extends Query, SynchronizeableQuery { RootReturn addRoot(String tableAlias, String entityName); /** - * Add a new root return mapping, returning a {@link NativeQuery.RootReturn} to allow further definition. + * Add a new root return mapping, returning a {@link SQLQuery.RootReturn} to allow further definition. * * @param tableAlias The SQL table alias to map to this entity * @param entityType The java type of the entity. diff --git a/hibernate-core/src/main/java/org/hibernate/action/spi/package-info.java b/hibernate-core/src/main/java/org/hibernate/action/spi/package-info.java index b5cdf1fb62..7af5a2aab4 100644 --- a/hibernate-core/src/main/java/org/hibernate/action/spi/package-info.java +++ b/hibernate-core/src/main/java/org/hibernate/action/spi/package-info.java @@ -7,6 +7,6 @@ /** * Defines SPI hooks into the {@link org.hibernate.engine.spi.ActionQueue}. Mainly for registering custom - * {@link AfterTransactionCompletionProcess} and {@link BeforeTransactionCompletionProcess} hooks. + * {@link org.hibernate.action.spi.AfterTransactionCompletionProcess} and {@link org.hibernate.action.spi.BeforeTransactionCompletionProcess} hooks. */ package org.hibernate.action.spi; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Filter.java b/hibernate-core/src/main/java/org/hibernate/annotations/Filter.java index 1e20bf8f5a..811d53db19 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Filter.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/Filter.java @@ -40,7 +40,7 @@ /** * If true, automatically determine all points within the condition fragment that an alias should be injected. * Otherwise, injection will only replace instances of explicit "{alias}" instances or - * @SqlFragmentAlias descriptors. + * {@link SqlFragmentAlias} descriptors. */ boolean deduceAliasInjectionPoints() default true; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/FlushModeType.java b/hibernate-core/src/main/java/org/hibernate/annotations/FlushModeType.java index 0f092abdde..ae39fb2f7f 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/FlushModeType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/FlushModeType.java @@ -25,8 +25,6 @@ public enum FlushModeType { */ COMMIT, /** - * Corresponds to {@link org.hibernate.FlushMode#NEVER}. - * * @deprecated use MANUAL, will be removed in a subsequent release */ @Deprecated diff --git a/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java index 111c6ad804..ec54db3dbd 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java @@ -98,7 +98,7 @@ public interface MetadataBuilder { * Specify the second-level cache mode to be used. This is the cache mode in terms of whether or * not to cache. *

- * Its default is defined by the {@coce javax.persistence.sharedCache.mode} setting if using + * Its default is defined by the {@code javax.persistence.sharedCache.mode} setting if using * property-based configuration. * * @param cacheMode The cache mode. diff --git a/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/AbstractScannerImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/AbstractScannerImpl.java index eab823a51e..8d7423c180 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/AbstractScannerImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/archive/scan/spi/AbstractScannerImpl.java @@ -79,7 +79,7 @@ private ArchiveDescriptor buildArchiveDescriptor( * * JPA allows for to be specific * @param url - * @return + * @return The resolved non-root URL */ protected URL resolveNonRootUrl(URL url) { return null; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java index fafcd35635..35c925eeb5 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java @@ -88,7 +88,7 @@ public static Identifier toIdentifier(String text, boolean quote) { * * @param name * - * @return + * @return {@code true} if the given identifier text is considered quoted; {@code false} otherwise. */ public static boolean isQuoted(String name) { return ( name.startsWith( "`" ) && name.endsWith( "`" ) ) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java index 77d2316477..459b002c1e 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java @@ -9,7 +9,7 @@ import java.util.Map; /** - * Defines the source of filter information. May have an associated {@link FilterDefinitionSource}. + * Defines the source of filter information. May have an associated {@link org.hibernate.engine.spi.FilterDefinition}. * Relates to both {@code } and {@link org.hibernate.annotations.Filter @Filter} * * @author Steve Ebersole @@ -28,7 +28,7 @@ public interface FilterSource { * * @return The condition defined on the filter. * - * @see {@link FilterDefinitionSource#getCondition()} + * @see org.hibernate.boot.model.source.internal.hbm.FilterSourceImpl#getCondition() */ public String getCondition(); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/Orderable.java b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/Orderable.java index a5c96851e0..67c1333a07 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/Orderable.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/Orderable.java @@ -26,7 +26,7 @@ public interface Orderable { * If the ordering element is not specified, ordering by * the primary key of the associated entity is assumed * - * {@see javax.persistence.OrderBy#value()} + * @see javax.persistence.OrderBy#value() * * @return The {@code ORDER BY} fragment used during loading this plural attribute from DB. */ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/registry/package-info.java b/hibernate-core/src/main/java/org/hibernate/boot/registry/package-info.java index aca854db51..75c16fbce2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/registry/package-info.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/registry/package-info.java @@ -13,14 +13,14 @@ * "override" services from parent registries. It also allows granular building of registries as services * become available. * - * {@link BootstrapServiceRegistry} is the base service registry, intended to be built via - * {@link BootstrapServiceRegistryBuilder} if you need customization. For non-customized - * {@link BootstrapServiceRegistry} usage, the {@link BootstrapServiceRegistryBuilder} and - * {@link BootstrapServiceRegistry} can be bypassed altogether. + * {@link org.hibernate.boot.registry.BootstrapServiceRegistry} is the base service registry, intended to be built via + * {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder} if you need customization. For non-customized + * {@link org.hibernate.boot.registry.BootstrapServiceRegistry} usage, the {@link org.hibernate.boot.registry.BootstrapServiceRegistryBuilder} and + * {@link org.hibernate.boot.registry.BootstrapServiceRegistry} can be bypassed altogether. * - * Usually the next level in a standard registry set up is the {@link StandardServiceRegistry}, intended to be built - * by the {@link StandardServiceRegistryBuilder} if you need customization. The builder optionally takes the - * {@link BootstrapServiceRegistry} to use as a base; if none is provided a default one is generated assuming sensible + * Usually the next level in a standard registry set up is the {@link org.hibernate.boot.registry.StandardServiceRegistry}, intended to be built + * by the {@link org.hibernate.boot.registry.StandardServiceRegistryBuilder} if you need customization. The builder optionally takes the + * {@link org.hibernate.boot.registry.BootstrapServiceRegistry} to use as a base; if none is provided a default one is generated assuming sensible * defaults in Java SE and EE environments, particularly in respect to Class loading. */ package org.hibernate.boot.registry; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/spi/package-info.java b/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/spi/package-info.java index 1c464c32f1..587349b009 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/spi/package-info.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/registry/selector/spi/package-info.java @@ -6,6 +6,6 @@ */ /** - * Defines actual contract used for strategy selection : {@link StrategySelector}. + * Defines actual contract used for strategy selection : {@link org.hibernate.boot.registry.selector.spi.StrategySelector}. */ package org.hibernate.boot.registry.selector.spi; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataBuildingContext.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataBuildingContext.java index 12fcc57d93..e9f23eea5b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataBuildingContext.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataBuildingContext.java @@ -54,7 +54,7 @@ public interface MetadataBuildingContext { /** * Not sure how I feel about this exposed here * - * @return + * @return The ObjectNameNormalizer */ ObjectNameNormalizer getObjectNameNormalizer(); } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java index 0bd1a400c3..ddc6af6fab 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java @@ -33,7 +33,7 @@ public interface MetadataImplementor extends Metadata, Mapping { /** * Access to the options used to build this Metadata * - * @return + * @return Access to the MetadataBuildingOptions */ MetadataBuildingOptions getMetadataBuildingOptions(); diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java index bec175ad1c..b63e09c4d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java @@ -16,7 +16,7 @@ *

  • INSERTS : {@link #insert} -> {@link #afterInsert}
  • *
  • UPDATES : {@link #lockItem} -> {@link #remove} -> {@link #update} -> {@link #afterUpdate}
  • *
  • DELETES : {@link #lockItem} -> {@link #remove} -> {@link #unlockItem}
  • - *
  • LOADS : {@link @putFromLoad}
  • + *
  • LOADS : {@link #putFromLoad}
  • * * Note the special case of UPDATES above. Because the cache key itself has changed here we need to remove the * old entry as well as diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java index 2c17069bd2..21bb287dbc 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java @@ -21,7 +21,7 @@ * @author Gavin King * @author Emmanuel Bernard * - * @deprecated A {@link org.hibernate.cfg.naming.NamingStrategyDelegator} should be used instead. + * @deprecated {@link org.hibernate.boot.model.naming.ImplicitNamingStrategy} and {@link org.hibernate.boot.model.naming.PhysicalNamingStrategy} should be used instead. */ @Deprecated public interface NamingStrategy { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java index e01aba7b7d..b0a530a3a5 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java @@ -104,7 +104,7 @@ default ForeignKey getOverriddenForeignKey(String propertyName) { * Determine the AttributeConverter to use for the given property. * * @param property - * @return + * @return The ConverterDescriptor */ ConverterDescriptor resolveAttributeConverterDescriptor(XProperty property); } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java index fe429ccfcf..1383767eaf 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java @@ -250,7 +250,7 @@ private enum PropertyType { private AccessibleObject mirroredAttribute; /** - * @deprecated Use {@link JPAMetadataProvider(AnnotatedElement, XMLContext, BootstrapContext)} instead. + * @deprecated Use {@link #JPAOverriddenAnnotationReader(AnnotatedElement, XMLContext, BootstrapContext)} instead. */ public JPAOverriddenAnnotationReader( AnnotatedElement el, diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java index 49e7abf9f7..3ff66a3812 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java @@ -545,7 +545,7 @@ public LimitHandler getLimitHandler() { * if expression has not been explicitly specified. * @param nullPrecedence Nulls precedence. Default value: {@link NullPrecedence#NONE}. * - * @return + * @return SQL string. */ @Override public String renderOrderByElement(String expression, String collation, String order, NullPrecedence nullPrecedence) { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index 0c9563775b..996cbfce22 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -1674,7 +1674,7 @@ public String getCurrentTimestampSQLFunctionName() { * @return The Dialect's preferred SQLExceptionConverter, or null to * indicate that the default {@link SQLExceptionConverter} should be used. * - * @see {@link #buildSQLExceptionConversionDelegate()} + * @see #buildSQLExceptionConversionDelegate() * @deprecated {@link #buildSQLExceptionConversionDelegate()} should be * overridden instead. */ @@ -1687,11 +1687,11 @@ public SQLExceptionConverter buildSQLExceptionConverter() { * Build an instance of a {@link SQLExceptionConversionDelegate} for * interpreting dialect-specific error or SQLState codes. *

    - * When {@link #buildSQLExceptionConverter} returns null, the default + * When {@link #buildSQLExceptionConverter} returns null, the default * {@link SQLExceptionConverter} is used to interpret SQLState and * error codes. If this method is overridden to return a non-null value, * the default {@link SQLExceptionConverter} will use the returned - * {@link SQLExceptionConversionDelegate} in addition to the following + * {@link SQLExceptionConversionDelegate} in addition to the following * standard delegates: *

      *
    1. a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
    2. @@ -2877,7 +2877,7 @@ public CallableStatementSupport getCallableStatementSupport() { /** * By default interpret this based on DatabaseMetaData. * - * @return + * @return The NameQualifierSupport. */ public NameQualifierSupport getNameQualifierSupport() { return null; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java index e304bb6a68..b6580d5feb 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java @@ -653,7 +653,7 @@ public boolean isCurrentTimestampSelectStringCallable() { public boolean supportsEmptyInList() { return false; } - + @Override public boolean supportsExistsInSelect() { return false; @@ -663,7 +663,7 @@ public boolean supportsExistsInSelect() { public int getInExpressionCountLimit() { return PARAM_LIST_SIZE_LIMIT; } - + @Override public boolean forceLobAsLastValue() { return true; @@ -672,7 +672,8 @@ public boolean forceLobAsLastValue() { /** * For Oracle, the FOR UPDATE clause cannot be applied when using ORDER BY, DISTINCT or views. * @param parameters - * @return + * @return {@code true} indicates that the dialect requests that locking be applied by subsequent select; + * {@code false} (the default) indicates that locking should be applied to the main SQL statement.. @see Oracle FOR UPDATE restrictions */ @Override @@ -697,12 +698,12 @@ public boolean useFollowOnLocking(QueryParameters parameters) { return true; } } - + @Override public String getNotExpression( String expression ) { return "not (" + expression + ")"; } - + @Override public String getQueryHintString(String sql, String hints) { String statementType = statementType(sql); @@ -724,7 +725,7 @@ public String getQueryHintString(String sql, String hints) { return sql; } - + @Override public int getMaxAliasLength() { // Oracle's max identifier length is 30, but Hibernate needs to add "uniqueing info" so we account for that, diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java index 465a9ffa78..748b2e753b 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/SerializableBlobProxy.java @@ -31,7 +31,7 @@ public class SerializableBlobProxy implements InvocationHandler, Serializable { * Builds a serializable {@link Blob} wrapper around the given {@link Blob}. * * @param blob The {@link Blob} to be wrapped. - * @see + * @see #generateProxy(java.sql.Blob) */ private SerializableBlobProxy(Blob blob) { this.blob = blob; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java index b918ffcf8c..ec94471af1 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/spi/JdbcEnvironment.java @@ -71,7 +71,7 @@ public interface JdbcEnvironment extends Service { /** * Obtain the level of support for qualified names. * - * @return + * @return The NameQualifierSupport. */ NameQualifierSupport getNameQualifierSupport(); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java index 6272656aff..435a6aa952 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java @@ -1102,11 +1102,11 @@ boolean hasAnyChildEntityNames(BatchIdentifier batchIdentifier) { /** * Check if the this {@link BatchIdentifier} has a parent or grand parent - * matching the given {@link BatchIdentifier reference. + * matching the given {@link BatchIdentifier} reference. * * @param batchIdentifier {@link BatchIdentifier} reference * - * @return This {@link BatchIdentifier} has a parent matching the given {@link BatchIdentifier reference + * @return This {@link BatchIdentifier} has a parent matching the given {@link BatchIdentifier} reference */ boolean hasParent(BatchIdentifier batchIdentifier) { return ( diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java index 5b4e287617..cbc596796e 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java @@ -40,7 +40,7 @@ public class BatchFetchQueue { /** * A map of {@link SubselectFetch subselect-fetch descriptors} keyed by the - * {@link EntityKey) against which the descriptor is registered. + * {@link EntityKey} against which the descriptor is registered. */ private Map subselectsByEntityKey; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java index b90ff597b3..07b70b6e06 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java @@ -33,7 +33,7 @@ * *

      * Often referred to as the "first level cache". - * + * * @author Gavin King * @author Steve Ebersole */ @@ -250,7 +250,7 @@ EntityEntry addEntity( final boolean disableVersionIncrement); /** - * Generates an appropriate EntityEntry instance and adds it + * Generates an appropriate EntityEntry instance and adds it * to the event source's internal caches. */ EntityEntry addEntry( @@ -286,7 +286,7 @@ EntityEntry addEntry( /** * If a deleted entity instance is re-saved, and it has a proxy, we need to - * reset the identifier of the proxy + * reset the identifier of the proxy */ void reassociateProxy(Object value, Serializable id) throws MappingException; @@ -478,7 +478,7 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, */ Object removeProxy(EntityKey key); - /** + /** * Retrieve the set of EntityKeys representing nullifiable references * @deprecated Use {@link #containsNullifiableEntityKey(Supplier)} or {@link #registerNullifiableEntityKey(EntityKey)} or {@link #isNullifiableEntityKeysEmpty()} */ @@ -496,8 +496,6 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, /** * Provides access to the entity/EntityEntry combos associated with the persistence context in a manner that * is safe from reentrant access. Specifically, it is safe from additions/removals while iterating. - * - * @return */ Map.Entry[] reentrantSafeEntityEntries(); @@ -574,7 +572,7 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, void afterLoad(); /** - * Is in a two-phase load? + * Is in a two-phase load? */ boolean isLoadFinished(); /** @@ -631,12 +629,12 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, * To determine the read-only/modifiable setting for a particular entity * or proxy: * @see PersistenceContext#isReadOnly(Object) - * @see org.hibernate.Session#isReadOnly(Object) + * @see org.hibernate.Session#isReadOnly(Object) * * @return true, loaded entities/proxies will be made read-only by default; * false, loaded entities/proxies will be made modifiable by default. * - * @see org.hibernate.Session#isDefaultReadOnly() + * @see org.hibernate.Session#isDefaultReadOnly() */ boolean isDefaultReadOnly(); @@ -799,7 +797,6 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, /** * A read-only iterator on all entities managed by this persistence context - * @return */ Iterator managedEntitiesIterator(); @@ -811,10 +808,10 @@ interface NaturalIdHelper { /** * Given an array of "full entity state", extract the portions that represent the natural id - * + * * @param state The attribute state array * @param persister The persister representing the entity type. - * + * * @return The extracted natural id values */ Object[] extractNaturalIdValues(Object[] state, EntityPersister persister); @@ -848,7 +845,7 @@ void cacheNaturalIdCrossReferenceFromLoad( * @param persister The persister representing the entity type. * @param id The primary key value * @param state Generally the "full entity state array", though could also be the natural id values array - * @param previousState Generally the "full entity state array", though could also be the natural id values array. + * @param previousState Generally the "full entity state array", though could also be the natural id values array. * Specifically represents the previous values on update, and so is only used with {@link CachedNaturalIdValueSource#UPDATE} * @param source Enumeration representing how these values are coming into cache. */ @@ -861,11 +858,11 @@ void manageLocalNaturalIdCrossReference( /** * Cleans up local cross-reference entries. - * + * * @param persister The persister representing the entity type. * @param id The primary key value * @param state Generally the "full entity state array", though could also be the natural id values array - * + * * @return The local cached natural id values (could be different from given values). */ Object[] removeLocalNaturalIdCrossReference(EntityPersister persister, Serializable id, Object[] state); @@ -876,7 +873,7 @@ void manageLocalNaturalIdCrossReference( * @param persister The persister representing the entity type. * @param id The primary key value * @param state Generally the "full entity state array", though could also be the natural id values array - * @param previousState Generally the "full entity state array", though could also be the natural id values array. + * @param previousState Generally the "full entity state array", though could also be the natural id values array. * Specifically represents the previous values on update, and so is only used with {@link CachedNaturalIdValueSource#UPDATE} * @param source Enumeration representing how these values are coming into cache. */ @@ -901,7 +898,7 @@ void manageSharedNaturalIdCrossReference( * * @param persister The persister representing the entity type. * @param pk The primary key value - * + * * @return The cross-referenced natural-id values, or {@code null} */ Object[] findCachedNaturalId(EntityPersister persister, Serializable pk); @@ -914,9 +911,9 @@ void manageSharedNaturalIdCrossReference( * @param persister The persister representing the entity type. * @param naturalIdValues The natural id value(s) * - * @return The corresponding cross-referenced primary key, + * @return The corresponding cross-referenced primary key, * {@link PersistenceContext.NaturalIdHelper#INVALID_NATURAL_ID_REFERENCE}, - * or {@code null}. + * or {@code null}. */ Serializable findCachedNaturalIdResolution(EntityPersister persister, Object[] naturalIdValues); @@ -924,14 +921,14 @@ void manageSharedNaturalIdCrossReference( * Find all the locally cached primary key cross-reference entries for the given persister. * * @param persister The persister representing the entity type. - * + * * @return The primary keys */ Collection getCachedPkResolutions(EntityPersister persister); /** * Part of the "load synchronization process". Responsible for maintaining cross-reference entries - * when natural-id values were found to have changed. Also responsible for tracking the old values + * when natural-id values were found to have changed. Also responsible for tracking the old values * as no longer valid until the next flush because otherwise going to the database would just re-pull * the old values as valid. In this last responsibility, {@link #cleanupFromSynchronizations} is * the inverse process called after flush to clean up those entries. @@ -939,7 +936,7 @@ void manageSharedNaturalIdCrossReference( * @param persister The persister representing the entity type. * @param pk The primary key * @param entity The entity instance - * + * * @see #cleanupFromSynchronizations */ void handleSynchronization(EntityPersister persister, Serializable pk, Object entity); @@ -962,7 +959,7 @@ void manageSharedNaturalIdCrossReference( /** * Access to the natural-id helper for this persistence context - * + * * @return This persistence context's natural-id helper */ NaturalIdHelper getNaturalIdHelper(); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java index 95812b3987..8f9aa1259d 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java @@ -194,7 +194,7 @@ default long getTimestamp() { * Check if an active Transaction is necessary for the update operation to be executed. * If an active Transaction is necessary but it is not then a TransactionRequiredException is raised. * - * @param exceptionMessage, the message to use for the TransactionRequiredException + * @param exceptionMessage the message to use for the TransactionRequiredException */ default void checkTransactionNeededForUpdateOperation(String exceptionMessage) { if ( !isTransactionInProgress() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerGroup.java b/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerGroup.java index 213f6acb64..2b0779299f 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/event/service/spi/EventListenerGroup.java @@ -40,7 +40,7 @@ public interface EventListenerGroup extends Serializable { /** * @deprecated this is not the most efficient way for iterating the event listeners. * See {@link #fireEventOnEachListener(Object, BiConsumer)} and its overloaded variants for better alternatives. - * @return + * @return The Iterable. */ @Deprecated public Iterable listeners(); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/ExpandingCollectionQuerySpace.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/ExpandingCollectionQuerySpace.java index ce4938f416..de7e5c528f 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/ExpandingCollectionQuerySpace.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/ExpandingCollectionQuerySpace.java @@ -29,7 +29,7 @@ public interface ExpandingCollectionQuerySpace extends CollectionQuerySpace, Exp * @param join The element or index join to add. * * @throws java.lang.IllegalArgumentException if {@code join} is an instance of - * {@link org.hibernate.loader.plan.spi.JoinDefinedByMetadata} and {@code join.getJoinedPropertyName() + * {@link org.hibernate.loader.plan.spi.JoinDefinedByMetadata} and {@code join.getJoinedPropertyName()} * is neither {@code "elements"} and {@code "indices"}. * @throws java.lang.IllegalStateException if there is already an existing join with the same joined property name. */ diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ResultSetProcessingContext.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ResultSetProcessingContext.java index fa16cca2bd..38f24c84f7 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ResultSetProcessingContext.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ResultSetProcessingContext.java @@ -49,7 +49,7 @@ interface EntityReferenceProcessingState { /** * - * @return + * @return Whether there is no identifier for this entity reference */ boolean isMissingIdentifier(); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ScrollableResultSetProcessor.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ScrollableResultSetProcessor.java index a594c576f4..701333542e 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ScrollableResultSetProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/process/spi/ScrollableResultSetProcessor.java @@ -10,6 +10,7 @@ import org.hibernate.engine.spi.QueryParameters; import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; /** * Contract for processing JDBC ResultSets a single logical row at a time. These are intended for use by @@ -25,7 +26,7 @@ public interface ScrollableResultSetProcessor { /** * Give a ResultSet, extract just a single result row. * - * Copy of {@link org.hibernate.loader.Loader#loadSingleRow(java.sql.ResultSet, org.hibernate.engine.spi.SessionImplementor, org.hibernate.engine.spi.QueryParameters, boolean)} + * Copy of {@link org.hibernate.loader.Loader#loadSingleRow(ResultSet, SharedSessionContractImplementor, QueryParameters, boolean)} * but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in * false...) * @@ -47,7 +48,7 @@ public Object extractSingleRow( * properly ordered to account for any to-many fetches. Multiple ResultSet rows are read into a single query * result "row". * - * Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsForward(java.sql.ResultSet, org.hibernate.engine.spi.SessionImplementor, org.hibernate.engine.spi.QueryParameters, boolean)} + * Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsForward(ResultSet, SharedSessionContractImplementor, QueryParameters, boolean)} * but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in * false...) * @@ -67,7 +68,7 @@ public Object extractLogicalRowForward( /** * Like {@link #extractLogicalRowForward} but here moving through the ResultSet in reverse. * - * Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsReverse(java.sql.ResultSet, org.hibernate.engine.spi.SessionImplementor, org.hibernate.engine.spi.QueryParameters, boolean, boolean)} + * Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsReverse(ResultSet, SharedSessionContractImplementor, QueryParameters, boolean, boolean)} * but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in * false...). * diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/EmbeddedDomainType.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/EmbeddedDomainType.java index 7baaa1ed78..fcbcea034d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/EmbeddedDomainType.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/EmbeddedDomainType.java @@ -7,9 +7,10 @@ package org.hibernate.metamodel.model.domain; import javax.persistence.metamodel.EmbeddableType; +import javax.persistence.metamodel.EntityType; /** - * Hibernate extension to the JPA {@link } contract. + * Hibernate extension to the JPA {@link EntityType} contract. * * @apiNote Notice that this describes {@link javax.persistence.Embedded}, not * {@link javax.persistence.Embeddable} - like {@link CollectionDomainType}, it includes diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index 66a0f7298e..dd45839ad5 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -2548,7 +2548,7 @@ protected UniqueEntityLoader createEntityLoader( * * @param lockMode The lock mode to apply to the thing being loaded. * - * @return + * @return The UniqueEntityLoader. * * @throws MappingException */ diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java index 6930d7ffea..6fc0a3b095 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java @@ -350,7 +350,7 @@ else if ( persistentClass.isDiscriminatorValueNotNull() ) { * For the Client entity: * naturalOrderTableNames -> PERSON, CLIENT; this reflects the sequence in which the tableNames are * added to the meta-data when the annotated entities are processed. - * However, in some instances, for example when generating joins, the CLIENT table needs to be + * However, in some instances, for example when generating joins, the CLIENT table needs to be * the first table as it will the driving table. * tableNames -> CLIENT, PERSON */ @@ -623,7 +623,7 @@ else if ( sc.isDiscriminatorValueNotNull() ) { * * @param persistentClass * @param factory - * @return + * @return subclassNamesBySubclassTable */ private String[][] buildSubclassNamesBySubclassTableMapping(PersistentClass persistentClass, SessionFactoryImplementor factory) { // this value represents the number of subclasses (and not the class itself) diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java b/hibernate-core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java index 917f620412..29a2ef2a89 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java @@ -432,7 +432,7 @@ protected String getSessionFactoryUuid() { * This method should only be called during deserialization, before associating * the proxy with a session. * - * @param readOnlyBeforeAttachedToSession, the read-only/modifiable setting to use when + * @param readOnlyBeforeAttachedToSession the read-only/modifiable setting to use when * associated with a session; null indicates that the default should be used. * @param sessionFactoryUuid the session factory uuid, to be used if {@code allowLoadOutsideTransaction} is {@code true}. * @param allowLoadOutsideTransaction whether the proxy can load data even diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryParameterListBinding.java b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryParameterListBinding.java index 75bcd535d4..8368b6df9b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryParameterListBinding.java +++ b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryParameterListBinding.java @@ -10,12 +10,13 @@ import javax.persistence.TemporalType; import org.hibernate.Incubating; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.query.internal.QueryParameterBindingsImpl; import org.hibernate.type.Type; /** * Represents a "parameter list" binding: aka the binding of a collection of values for a single - * query parameter. At some point these need to be "expanded"; see {@link QueryParameterBindingsImpl#expandListValuedParameters(String)} + * query parameter. At some point these need to be "expanded"; see {@link QueryParameterBindingsImpl#expandListValuedParameters(String, SharedSessionContractImplementor)} * for details. * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/DdlTransactionIsolator.java b/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/DdlTransactionIsolator.java index c5b32acc88..e9b69dfad3 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/DdlTransactionIsolator.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/DdlTransactionIsolator.java @@ -38,7 +38,7 @@ public interface DdlTransactionIsolator { * Connection will be isolated (transactionally) from any * transaction in effect prior to the call to {@link #prepare}. * - * @return + * @return The Connection. */ Connection getIsolatedConnection(); diff --git a/hibernate-core/src/main/java/org/hibernate/service/spi/SessionFactoryServiceRegistryFactory.java b/hibernate-core/src/main/java/org/hibernate/service/spi/SessionFactoryServiceRegistryFactory.java index 93255868c5..2e088fb316 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/spi/SessionFactoryServiceRegistryFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/service/spi/SessionFactoryServiceRegistryFactory.java @@ -25,7 +25,6 @@ public interface SessionFactoryServiceRegistryFactory extends Service { * for grabbing a reference for later use. However, care should be taken when invoking on * the session factory until after it has been fully initialized. * @param sessionFactoryOptions The build options. - * @param sessionFactoryOptions The build options. * * @return The registry */ diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/OrderByTranslation.java b/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/OrderByTranslation.java index 70f4953a08..c34707903f 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/OrderByTranslation.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/OrderByTranslation.java @@ -7,7 +7,7 @@ package org.hibernate.sql.ordering.antlr; /** - * Represents the result of an order-by translation by {@link @OrderByTranslator} + * Represents the result of an order-by translation by {@link OrderByFragmentTranslator} * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/stat/Statistics.java b/hibernate-core/src/main/java/org/hibernate/stat/Statistics.java index 93aedd7d37..5c9cf24011 100755 --- a/hibernate-core/src/main/java/org/hibernate/stat/Statistics.java +++ b/hibernate-core/src/main/java/org/hibernate/stat/Statistics.java @@ -12,7 +12,7 @@ * Exposes statistics for a particular {@link org.hibernate.SessionFactory}. Beware of milliseconds metrics, they * are dependent of the JVM precision: you may then encounter a 10 ms approximation depending on you OS platform. * Please refer to the JVM documentation for more information. - * + * * @author Emmanuel Bernard */ @MXBean @@ -42,7 +42,7 @@ public interface Statistics { /** * find entity statistics per name - * + * * @param entityName entity name * @return EntityStatistics object */ @@ -50,7 +50,7 @@ public interface Statistics { /** * Get collection statistics per role - * + * * @param role collection role * @return CollectionStatistics */ @@ -366,7 +366,7 @@ public interface Statistics { * @return NaturalIdCacheStatistics * * @deprecated (since 5.3) Use {@link #getNaturalIdStatistics} or - * {@link @getDomainDataRegionStatistics} instead depending on need + * {@link #getDomainDataRegionStatistics} instead depending on need */ @Deprecated NaturalIdCacheStatistics getNaturalIdCacheStatistics(String regionName); diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java index cd72909a60..090cd960d8 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java @@ -61,9 +61,9 @@ public interface DatabaseInformation { TableInformation getTableInformation(QualifiedTableName tableName); /** - * Obtain reference to all the {@link TableInformation) for a given {@link Namespace} + * Obtain reference to all the {@link TableInformation} for a given {@link Namespace} * - * @param namespace The {@link Namespace} which contains the {@link TableInformation) + * @param namespace The {@link Namespace} which contains the {@link TableInformation} * * @return a {@link NameSpaceTablesInformation} */ diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java b/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java index bf0828ad3c..fe2d28e4f4 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java @@ -30,8 +30,6 @@ public class IdentifierProperty extends AbstractAttribute implements IdentifierA * * @param name The name of the property representing the identifier within * its owning entity. - * @param node The node name to use for XML-based representation of this - * property. * @param type The Hibernate Type for the identifier property. * @param embedded Is this an embedded identifier. * @param unsavedValue The value which, if found as the value on the identifier diff --git a/hibernate-core/src/main/java/org/hibernate/type/Type.java b/hibernate-core/src/main/java/org/hibernate/type/Type.java index 0008c0cc7e..06d45aeff5 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/Type.java +++ b/hibernate-core/src/main/java/org/hibernate/type/Type.java @@ -117,7 +117,7 @@ public interface Type extends Serializable { * NOTE: The number of elements in this array matches the return from {@link #getColumnSpan}. * * @param mapping The mapping object :/ - * @todo Would be much much better to have this aware of Dialect once the service/metamodel split is done + * TODO: Would be much much better to have this aware of Dialect once the service/metamodel split is done * * @return The dictated sizes. * @@ -132,7 +132,7 @@ public interface Type extends Serializable { * NOTE: The number of elements in this array matches the return from {@link #getColumnSpan}. * * @param mapping The mapping object :/ - * @todo Would be much much better to have this aware of Dialect once the service/metamodel split is done + * TODO: Would be much much better to have this aware of Dialect once the service/metamodel split is done * * @return The default sizes. * diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java index d68a7099bd..c246654c9f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java @@ -31,7 +31,7 @@ private LobTypeMappings() { /** * * @param jdbcTypeCode - * @return + * @return true if corresponding Lob code exists; false otherwise. * @deprecated use {@link #isMappedToKnownLobCode(int)} */ @Deprecated @@ -42,7 +42,7 @@ public boolean hasCorrespondingLobCode(final int jdbcTypeCode) { /** * * @param jdbcTypeCode - * @return + * @return corresponding Lob code * @deprecated use {@link #getLobCodeTypeMapping(int)} */ @Deprecated diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java index 9dd7c21ffa..d17b5952ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java @@ -50,7 +50,7 @@ public static int toNationalizedTypeCode(final int jdbcCode) { /** * @deprecated use {@link #toNationalizedTypeCode(int)} * @param jdbcCode - * @return + * @return corresponding nationalized code */ @Deprecated public int getCorrespondingNationalizedCode(int jdbcCode) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java b/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java index 5427c8f587..b73199b8cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java +++ b/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java @@ -142,7 +142,7 @@ public Map> getJdbcToHibernateTypeContributionMap() { * bound here. See {@link Scope} for more details regarding the stages * a TypeConfiguration goes through * - * @return + * @return The MetadataBuildingContext */ public MetadataBuildingContext getMetadataBuildingContext() { return scope.getMetadataBuildingContext(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java index 8e01ba206d..8a309b685f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/CascadeTest.java @@ -23,7 +23,7 @@ /** * Check some of the individual cascade styles * - * @todo do something for refresh + * TODO: do something for refresh * * @author Emmanuel Bernard */ @@ -149,7 +149,7 @@ public void testDetach() { s = openSession(); tx = s.beginTransaction(); s.delete( s.get( Mouth.class, mouth.id ) ); - + tx.commit(); s.close(); } From 2663f8718ec179f19da4fcc6cc3d94d397c22e2f Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Sun, 5 Jan 2020 12:48:24 -0500 Subject: [PATCH 02/10] HHH-13802 revert back @todo --- hibernate-core/src/main/java/org/hibernate/type/Type.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/type/Type.java b/hibernate-core/src/main/java/org/hibernate/type/Type.java index 06d45aeff5..0008c0cc7e 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/Type.java +++ b/hibernate-core/src/main/java/org/hibernate/type/Type.java @@ -117,7 +117,7 @@ public interface Type extends Serializable { * NOTE: The number of elements in this array matches the return from {@link #getColumnSpan}. * * @param mapping The mapping object :/ - * TODO: Would be much much better to have this aware of Dialect once the service/metamodel split is done + * @todo Would be much much better to have this aware of Dialect once the service/metamodel split is done * * @return The dictated sizes. * @@ -132,7 +132,7 @@ public interface Type extends Serializable { * NOTE: The number of elements in this array matches the return from {@link #getColumnSpan}. * * @param mapping The mapping object :/ - * TODO: Would be much much better to have this aware of Dialect once the service/metamodel split is done + * @todo Would be much much better to have this aware of Dialect once the service/metamodel split is done * * @return The default sizes. * From bd472581a4df0310ad597abbce5ccb566690e043 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Sun, 5 Jan 2020 19:02:08 -0500 Subject: [PATCH 03/10] HHH-13802 add support of the various new tags so their warning won't show up --- gradle/published-java-module.gradle | 1 + hibernate-core/hibernate-core.gradle | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/published-java-module.gradle b/gradle/published-java-module.gradle index ac9043be27..03b715baa5 100644 --- a/gradle/published-java-module.gradle +++ b/gradle/published-java-module.gradle @@ -98,6 +98,7 @@ javadoc { 'http://docs.jboss.org/cdi/api/2.0/', 'https://javaee.github.io/javaee-spec/javadocs/' ] + tags = [ "apiNote", 'implSpec', 'implNote', 'todo' ] if ( JavaVersion.current().isJava11Compatible() ) { //The need to set `--source 1.8` applies to all JVMs after 11, and also to 11 diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index 7096cd9bc8..f34338efc6 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -260,4 +260,3 @@ task testJavassist(type: Test) { check.dependsOn testJavassist testJavassist.mustRunAfter test - From 49fe4f649408dbe51013dc95d048a53aa1d6a8d0 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Thu, 28 Nov 2019 20:13:48 -0500 Subject: [PATCH 04/10] HHH-13726 Extract 'prepareEventListeners' method out of SessionFactoryImpl --- .../InFlightMetadataCollectorImpl.java | 9 ++++ .../hibernate/boot/internal/MetadataImpl.java | 50 ++++++++++++++++++- .../boot/spi/AbstractDelegatingMetadata.java | 8 ++- .../boot/spi/MetadataImplementor.java | 5 +- .../internal/SessionFactoryImpl.java | 43 +--------------- 5 files changed, 69 insertions(+), 46 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java index a8c97c3eaa..4a39a48957 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java @@ -79,6 +79,7 @@ import org.hibernate.engine.spi.FilterDefinition; import org.hibernate.engine.spi.NamedQueryDefinition; import org.hibernate.engine.spi.NamedSQLQueryDefinition; +import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.id.IdentifierGenerator; import org.hibernate.id.factory.IdentifierGeneratorFactory; import org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory; @@ -247,6 +248,14 @@ public Set getMappedSuperclassMappingsCopy() { return new HashSet<>( mappedSuperClasses.values() ); } + @Override + public void initSessionFactory(SessionFactoryImplementor sessionFactory) { + throw new UnsupportedOperationException( + "You should not be building a SessionFactory from an in-flight metadata collector; and of course " + + "we should better segment this in the API :)" + ); + } + @Override public IdentifierGeneratorFactory getIdentifierGeneratorFactory() { return identifierGeneratorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java index eaa0cd5119..d3b966adaa 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataImpl.java @@ -15,6 +15,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; +import java.util.regex.Pattern; import org.hibernate.HibernateException; import org.hibernate.MappingException; @@ -33,10 +34,14 @@ import org.hibernate.cfg.annotations.NamedProcedureCallDefinition; import org.hibernate.dialect.function.SQLFunction; import org.hibernate.engine.ResultSetMappingDefinition; +import org.hibernate.engine.config.spi.ConfigurationService; import org.hibernate.engine.spi.FilterDefinition; import org.hibernate.engine.spi.NamedQueryDefinition; import org.hibernate.engine.spi.NamedSQLQueryDefinition; -import org.hibernate.id.factory.IdentifierGeneratorFactory; +import org.hibernate.engine.spi.SessionFactoryImplementor; +import org.hibernate.event.service.spi.EventListenerGroup; +import org.hibernate.event.service.spi.EventListenerRegistry; +import org.hibernate.event.spi.EventType; import org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory; import org.hibernate.internal.SessionFactoryImpl; import org.hibernate.mapping.Collection; @@ -47,6 +52,7 @@ import org.hibernate.mapping.Table; import org.hibernate.procedure.ProcedureCallMemento; import org.hibernate.query.spi.NamedQueryRepository; +import org.hibernate.service.spi.ServiceRegistryImplementor; import org.hibernate.type.Type; import org.hibernate.type.TypeResolver; import org.hibernate.type.spi.TypeConfiguration; @@ -59,6 +65,8 @@ * @author Gail Badner */ public class MetadataImpl implements MetadataImplementor, Serializable { + private static final Pattern LISTENER_SEPARATION_PATTERN = Pattern.compile( " ," ); + private final UUID uuid; private final MetadataBuildingOptions metadataBuildingOptions; private final BootstrapContext bootstrapContext; @@ -355,6 +363,46 @@ public Set getMappedSuperclassMappingsCopy() { : new HashSet<>( mappedSuperclassMap.values() ); } + @Override + public void initSessionFactory(SessionFactoryImplementor sessionFactory) { + final ServiceRegistryImplementor sessionFactoryServiceRegistry = sessionFactory.getServiceRegistry(); + + assert sessionFactoryServiceRegistry != null; + + final EventListenerRegistry eventListenerRegistry = sessionFactoryServiceRegistry.getService( EventListenerRegistry.class ); + final ConfigurationService cfgService = sessionFactoryServiceRegistry.getService( ConfigurationService.class ); + final ClassLoaderService classLoaderService = sessionFactoryServiceRegistry.getService( ClassLoaderService.class ); + + eventListenerRegistry.prepare( this ); + + for ( Map.Entry entry : ( (Map) cfgService.getSettings() ).entrySet() ) { + if ( !String.class.isInstance( entry.getKey() ) ) { + continue; + } + final String propertyName = (String) entry.getKey(); + if ( !propertyName.startsWith( org.hibernate.jpa.AvailableSettings.EVENT_LISTENER_PREFIX ) ) { + continue; + } + final String eventTypeName = propertyName.substring( + org.hibernate.jpa.AvailableSettings.EVENT_LISTENER_PREFIX.length() + 1 + ); + final EventType eventType = EventType.resolveEventTypeByName( eventTypeName ); + final EventListenerGroup eventListenerGroup = eventListenerRegistry.getEventListenerGroup( eventType ); + for ( String listenerImpl : LISTENER_SEPARATION_PATTERN.split( ( (String) entry.getValue() ) ) ) { + eventListenerGroup.appendListener( instantiate( listenerImpl, classLoaderService ) ); + } + } + } + + private Object instantiate(String listenerImpl, ClassLoaderService classLoaderService) { + try { + return classLoaderService.classForName( listenerImpl ).newInstance(); + } + catch (Exception e) { + throw new HibernateException( "Could not instantiate requested listener [" + listenerImpl + "]", e ); + } + } + @Override public org.hibernate.type.Type getIdentifierType(String entityName) throws MappingException { final PersistentClass pc = entityBindingMap.get( entityName ); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java index 5fdbc749f0..7dba57d0d3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingMetadata.java @@ -17,7 +17,6 @@ import org.hibernate.boot.model.IdentifierGeneratorDefinition; import org.hibernate.boot.model.TypeDefinition; import org.hibernate.boot.model.relational.Database; -import org.hibernate.cache.cfg.internal.DomainDataRegionConfigImpl; import org.hibernate.cfg.annotations.NamedEntityGraphDefinition; import org.hibernate.cfg.annotations.NamedProcedureCallDefinition; import org.hibernate.dialect.function.SQLFunction; @@ -25,6 +24,7 @@ import org.hibernate.engine.spi.FilterDefinition; import org.hibernate.engine.spi.NamedQueryDefinition; import org.hibernate.engine.spi.NamedSQLQueryDefinition; +import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.id.factory.IdentifierGeneratorFactory; import org.hibernate.internal.SessionFactoryImpl; import org.hibernate.mapping.FetchProfile; @@ -240,4 +240,10 @@ public void validate() throws MappingException { public Set getMappedSuperclassMappingsCopy() { return delegate.getMappedSuperclassMappingsCopy(); } + + @Override + public void initSessionFactory(SessionFactoryImplementor sessionFactory) { + delegate.initSessionFactory( sessionFactory ); + } + } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java index ddc6af6fab..22d58fd6ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/MetadataImplementor.java @@ -6,13 +6,12 @@ */ package org.hibernate.boot.spi; -import java.util.Collection; import java.util.Set; import org.hibernate.MappingException; import org.hibernate.boot.Metadata; -import org.hibernate.cache.cfg.internal.DomainDataRegionConfigImpl; import org.hibernate.engine.spi.Mapping; +import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.internal.SessionFactoryImpl; import org.hibernate.mapping.MappedSuperclass; import org.hibernate.query.spi.NamedQueryRepository; @@ -59,4 +58,6 @@ public interface MetadataImplementor extends Metadata, Mapping { void validate() throws MappingException; Set getMappedSuperclassMappingsCopy(); + + void initSessionFactory(SessionFactoryImplementor sessionFactoryImplementor); } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index 3baeba0b7d..4eb8540b45 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -11,7 +11,6 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.sql.Connection; -import java.sql.SQLException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -20,7 +19,6 @@ import java.util.Set; import java.util.TimeZone; import java.util.function.Supplier; -import java.util.regex.Pattern; import javax.naming.Reference; import javax.naming.StringRefAddr; import javax.persistence.EntityGraph; @@ -31,7 +29,6 @@ import javax.persistence.Query; import javax.persistence.SynchronizationType; import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.spi.PersistenceUnitTransactionType; import org.hibernate.ConnectionAcquisitionMode; import org.hibernate.ConnectionReleaseMode; @@ -82,7 +79,6 @@ import org.hibernate.engine.spi.NamedSQLQueryDefinition; import org.hibernate.engine.spi.NamedSQLQueryDefinitionBuilder; import org.hibernate.engine.spi.SessionBuilderImplementor; -import org.hibernate.engine.spi.SessionEventListenerManager; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionOwner; import org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform; @@ -136,7 +132,6 @@ import static org.hibernate.metamodel.internal.JpaMetaModelPopulationSetting.determineJpaMetaModelPopulationSetting; - /** * Concrete implementation of the SessionFactory interface. Has the following * responsibilities @@ -159,7 +154,6 @@ */ public final class SessionFactoryImpl implements SessionFactoryImplementor { private static final CoreMessageLogger LOG = CoreLogging.messageLogger( SessionFactoryImpl.class ); - private static final Pattern LISTENER_SEPARATION_PATTERN = Pattern.compile( " ," ); private final String name; private final String uuid; @@ -214,7 +208,7 @@ public SessionFactoryImpl( .getService( SessionFactoryServiceRegistryFactory.class ) .buildServiceRegistry( this, options ); - prepareEventListeners( metadata ); + metadata.initSessionFactory( this ); final CfgXmlAccessService cfgXmlAccessService = serviceRegistry.getService( CfgXmlAccessService.class ); @@ -410,41 +404,6 @@ private SessionBuilder buildTemporarySessionOpenOptions() { .connectionHandlingMode( PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT ); } - private void prepareEventListeners(MetadataImplementor metadata) { - final EventListenerRegistry eventListenerRegistry = serviceRegistry.getService( EventListenerRegistry.class ); - final ConfigurationService cfgService = serviceRegistry.getService( ConfigurationService.class ); - final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class ); - - eventListenerRegistry.prepare( metadata ); - - for ( Map.Entry entry : ( (Map) cfgService.getSettings() ).entrySet() ) { - if ( !String.class.isInstance( entry.getKey() ) ) { - continue; - } - final String propertyName = (String) entry.getKey(); - if ( !propertyName.startsWith( org.hibernate.jpa.AvailableSettings.EVENT_LISTENER_PREFIX ) ) { - continue; - } - final String eventTypeName = propertyName.substring( - org.hibernate.jpa.AvailableSettings.EVENT_LISTENER_PREFIX.length() + 1 - ); - final EventType eventType = EventType.resolveEventTypeByName( eventTypeName ); - final EventListenerGroup eventListenerGroup = eventListenerRegistry.getEventListenerGroup( eventType ); - for ( String listenerImpl : LISTENER_SEPARATION_PATTERN.split( ( (String) entry.getValue() ) ) ) { - eventListenerGroup.appendListener( instantiate( listenerImpl, classLoaderService ) ); - } - } - } - - private Object instantiate(String listenerImpl, ClassLoaderService classLoaderService) { - try { - return classLoaderService.classForName( listenerImpl ).newInstance(); - } - catch (Exception e) { - throw new HibernateException( "Could not instantiate requested listener [" + listenerImpl + "]", e ); - } - } - private void applyCfgXmlValues(LoadedConfig aggregatedConfig, SessionFactoryServiceRegistry serviceRegistry) { final JaccService jaccService = serviceRegistry.getService( JaccService.class ); if ( jaccService.getContextId() != null ) { From 00e9db2b8bc396ce5013903bf4b4611fbb3e451d Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Sat, 21 Dec 2019 17:10:38 -0500 Subject: [PATCH 05/10] HHH-11958 Make EntityManager.find() support QueryHints.HINT_READONLY --- .../engine/spi/LoadQueryInfluencers.java | 16 ++++++- .../internal/DefaultLoadEventListener.java | 3 +- .../org/hibernate/event/spi/LoadEvent.java | 36 ++++++++++----- .../org/hibernate/internal/SessionImpl.java | 24 +++++++--- .../java/org/hibernate/loader/Loader.java | 25 ++++++++++- .../loader/entity/AbstractEntityLoader.java | 23 +++++++--- .../loader/entity/BatchingEntityLoader.java | 27 ++++++++++-- .../DynamicBatchingEntityLoaderBuilder.java | 18 ++++++-- .../hibernate/loader/entity/EntityLoader.java | 6 ++- .../LegacyBatchingEntityLoaderBuilder.java | 8 +++- .../PaddedBatchingEntityLoaderBuilder.java | 7 ++- .../loader/entity/UniqueEntityLoader.java | 13 ++++++ .../AbstractLoadPlanBasedEntityLoader.java | 34 ++++++++++++-- .../entity/plan/BatchingEntityLoader.java | 2 +- .../LegacyBatchingEntityLoaderBuilder.java | 8 +++- .../entity/AbstractEntityPersister.java | 11 ++++- .../persister/entity/EntityPersister.java | 12 ++++- .../persister/entity/NamedQueryLoader.java | 17 ++++++- .../hibernate/jpa/test/EntityManagerTest.java | 44 +++++++++++++++++++ .../PersisterClassProviderTest.java | 4 +- 20 files changed, 289 insertions(+), 49 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/LoadQueryInfluencers.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/LoadQueryInfluencers.java index a644f35588..44ee0e534f 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/LoadQueryInfluencers.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/LoadQueryInfluencers.java @@ -52,12 +52,19 @@ public class LoadQueryInfluencers implements Serializable { private final EffectiveEntityGraph effectiveEntityGraph = new EffectiveEntityGraph(); + private Boolean readOnly; + public LoadQueryInfluencers() { - this( null ); + this( null, null ); } public LoadQueryInfluencers(SessionFactoryImplementor sessionFactory) { + this(sessionFactory, null); + } + + public LoadQueryInfluencers(SessionFactoryImplementor sessionFactory, Boolean readOnly) { this.sessionFactory = sessionFactory; + this.readOnly = readOnly; } public SessionFactoryImplementor getSessionFactory() { @@ -282,4 +289,11 @@ public void setLoadGraph(final EntityGraph loadGraph) { effectiveEntityGraph.applyGraph( (RootGraphImplementor) loadGraph, GraphSemantic.LOAD ); } + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } } diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java index a5d7d53b17..48af0592cf 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java @@ -570,7 +570,8 @@ protected Object loadFromDatasource( event.getEntityId(), event.getInstanceToLoad(), event.getLockOptions(), - event.getSession() + event.getSession(), + event.getReadOnly() ); final StatisticsImplementor statistics = event.getSession().getFactory().getStatistics(); diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/LoadEvent.java b/hibernate-core/src/main/java/org/hibernate/event/spi/LoadEvent.java index bd33e60824..b011a919ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/LoadEvent.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/LoadEvent.java @@ -46,23 +46,24 @@ public LockOptions setScope(boolean scope) { private boolean isAssociationFetch; private Object result; private PostLoadEvent postLoadEvent; + private Boolean readOnly; - public LoadEvent(Serializable entityId, Object instanceToLoad, EventSource source) { - this( entityId, null, instanceToLoad, DEFAULT_LOCK_OPTIONS, false, source ); + public LoadEvent(Serializable entityId, Object instanceToLoad, EventSource source, Boolean readOnly) { + this( entityId, null, instanceToLoad, DEFAULT_LOCK_OPTIONS, false, source, readOnly ); } - public LoadEvent(Serializable entityId, String entityClassName, LockMode lockMode, EventSource source) { - this( entityId, entityClassName, null, lockMode, false, source ); + public LoadEvent(Serializable entityId, String entityClassName, LockMode lockMode, EventSource source, Boolean readOnly) { + this( entityId, entityClassName, null, lockMode, false, source, readOnly ); } - public LoadEvent(Serializable entityId, String entityClassName, LockOptions lockOptions, EventSource source) { - this( entityId, entityClassName, null, lockOptions, false, source ); + public LoadEvent(Serializable entityId, String entityClassName, LockOptions lockOptions, EventSource source, Boolean readOnly) { + this( entityId, entityClassName, null, lockOptions, false, source, readOnly ); } - public LoadEvent(Serializable entityId, String entityClassName, boolean isAssociationFetch, EventSource source) { - this( entityId, entityClassName, null, DEFAULT_LOCK_OPTIONS, isAssociationFetch, source ); + public LoadEvent(Serializable entityId, String entityClassName, boolean isAssociationFetch, EventSource source, Boolean readOnly) { + this( entityId, entityClassName, null, DEFAULT_LOCK_OPTIONS, isAssociationFetch, source, readOnly ); } - + public boolean isAssociationFetch() { return isAssociationFetch; } @@ -73,10 +74,11 @@ private LoadEvent( Object instanceToLoad, LockMode lockMode, boolean isAssociationFetch, - EventSource source) { + EventSource source, + Boolean readOnly) { this( entityId, entityClassName, instanceToLoad, lockMode == DEFAULT_LOCK_MODE ? DEFAULT_LOCK_OPTIONS : new LockOptions().setLockMode( lockMode ), - isAssociationFetch, source ); + isAssociationFetch, source, readOnly ); } private LoadEvent( @@ -85,7 +87,8 @@ private LoadEvent( Object instanceToLoad, LockOptions lockOptions, boolean isAssociationFetch, - EventSource source) { + EventSource source, + Boolean readOnly) { super( source ); @@ -106,6 +109,7 @@ else if ( lockOptions.getLockMode() == null ) { this.lockOptions = lockOptions; this.isAssociationFetch = isAssociationFetch; this.postLoadEvent = new PostLoadEvent( source ); + this.readOnly = readOnly; } public Serializable getEntityId() { @@ -190,4 +194,12 @@ public PostLoadEvent getPostLoadEvent() { public void setPostLoadEvent(PostLoadEvent postLoadEvent) { this.postLoadEvent = postLoadEvent; } + + public Boolean getReadOnly() { + return readOnly; + } + + public void setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + } } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index ebd4613804..0ce662253d 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -928,7 +928,7 @@ public void load(Object object, Serializable id) throws HibernateException { LoadEvent event = loadEvent; loadEvent = null; if ( event == null ) { - event = new LoadEvent( id, object, this ); + event = new LoadEvent( id, object, this, getReadOnlyFromLoadQueryInfluencers() ); } else { event.setEntityClassName( null ); @@ -1059,7 +1059,7 @@ public final Object internalLoad( */ private LoadEvent recycleEventInstance(final LoadEvent event, final Serializable id, final String entityName) { if ( event == null ) { - return new LoadEvent( id, entityName, true, this ); + return new LoadEvent( id, entityName, true, this, getReadOnlyFromLoadQueryInfluencers() ); } else { event.setEntityClassName( entityName ); @@ -2748,12 +2748,12 @@ protected T perform(Supplier executor) { @SuppressWarnings("unchecked") protected T doGetReference(Serializable id) { if ( this.lockOptions != null ) { - LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), lockOptions, SessionImpl.this ); + LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), lockOptions, SessionImpl.this, getReadOnlyFromLoadQueryInfluencers() ); fireLoad( event, LoadEventListener.LOAD ); return (T) event.getResult(); } - LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), false, SessionImpl.this ); + LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), false, SessionImpl.this, getReadOnlyFromLoadQueryInfluencers() ); boolean success = false; try { fireLoad( event, LoadEventListener.LOAD ); @@ -2784,12 +2784,12 @@ public Optional loadOptional(Serializable id) { @SuppressWarnings("unchecked") protected final T doLoad(Serializable id) { if ( this.lockOptions != null ) { - LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), lockOptions, SessionImpl.this ); + LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), lockOptions, SessionImpl.this, getReadOnlyFromLoadQueryInfluencers() ); fireLoad( event, LoadEventListener.GET ); return (T) event.getResult(); } - LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), false, SessionImpl.this ); + LoadEvent event = new LoadEvent( id, entityPersister.getEntityName(), false, SessionImpl.this, getReadOnlyFromLoadQueryInfluencers() ); boolean success = false; try { fireLoad( event, LoadEventListener.GET ); @@ -3311,7 +3311,8 @@ public T find(Class entityClass, Object primaryKey, LockModeType lockMode try { getLoadQueryInfluencers().getEffectiveEntityGraph().applyConfiguredGraph( properties ); - + Boolean readOnly = properties == null ? null : (Boolean) properties.get( QueryHints.HINT_READONLY ); + getLoadQueryInfluencers().setReadOnly( readOnly ); final IdentifierLoadAccess loadAccess = byId( entityClass ); loadAccess.with( determineAppropriateLocalCacheMode( properties ) ); @@ -3366,6 +3367,7 @@ public T find(Class entityClass, Object primaryKey, LockModeType lockMode } finally { getLoadQueryInfluencers().getEffectiveEntityGraph().clear(); + getLoadQueryInfluencers().setReadOnly( null ); } } @@ -3786,4 +3788,12 @@ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound ( (FilterImpl) loadQueryInfluencers.getEnabledFilter( filterName ) ).afterDeserialize( getFactory() ); } } + + private Boolean getReadOnlyFromLoadQueryInfluencers() { + Boolean readOnly = null; + if ( loadQueryInfluencers != null ) { + readOnly = loadQueryInfluencers.getReadOnly(); + } + return readOnly; + } } diff --git a/hibernate-core/src/main/java/org/hibernate/loader/Loader.java b/hibernate-core/src/main/java/org/hibernate/loader/Loader.java index e568529c3b..90db371a9d 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/Loader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/Loader.java @@ -2389,7 +2389,8 @@ protected final List loadEntity( final String optionalEntityName, final Serializable optionalIdentifier, final EntityPersister persister, - LockOptions lockOptions) throws HibernateException { + final LockOptions lockOptions, + final Boolean readOnly) throws HibernateException { if ( LOG.isDebugEnabled() ) { LOG.debugf( "Loading entity: %s", MessageHelper.infoString( persister, id, identifierType, getFactory() ) ); } @@ -2403,6 +2404,9 @@ protected final List loadEntity( qp.setOptionalEntityName( optionalEntityName ); qp.setOptionalId( optionalIdentifier ); qp.setLockOptions( lockOptions ); + if ( readOnly != null ) { + qp.setReadOnly( readOnly ); + } result = doQueryAndInitializeNonLazyCollections( session, qp, false ); } catch (SQLException sqle) { @@ -2477,6 +2481,22 @@ public final List loadEntityBatch( final Serializable optionalId, final EntityPersister persister, LockOptions lockOptions) throws HibernateException { + return loadEntityBatch( session, ids, idType, optionalObject, optionalEntityName, optionalId, persister, lockOptions, null ); + } + + /** + * Called by wrappers that batch load entities + */ + public final List loadEntityBatch( + final SharedSessionContractImplementor session, + final Serializable[] ids, + final Type idType, + final Object optionalObject, + final String optionalEntityName, + final Serializable optionalId, + final EntityPersister persister, + final LockOptions lockOptions, + final Boolean readOnly) throws HibernateException { if ( LOG.isDebugEnabled() ) { LOG.debugf( "Batch loading entity: %s", MessageHelper.infoString( persister, ids, getFactory() ) ); } @@ -2492,6 +2512,9 @@ public final List loadEntityBatch( qp.setOptionalEntityName( optionalEntityName ); qp.setOptionalId( optionalId ); qp.setLockOptions( lockOptions ); + if ( readOnly != null ) { + qp.setReadOnly( readOnly ); + } result = doQueryAndInitializeNonLazyCollections( session, qp, false ); } catch (SQLException sqle) { diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/AbstractEntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/AbstractEntityLoader.java index 85519412d8..37bf52308f 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/AbstractEntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/AbstractEntityLoader.java @@ -8,8 +8,6 @@ import java.io.Serializable; import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Collections; import java.util.List; import org.hibernate.HibernateException; @@ -46,12 +44,23 @@ public AbstractEntityLoader( @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session) { // this form is deprecated! - return load( id, optionalObject, session, LockOptions.NONE ); + return load( id, optionalObject, session, LockOptions.NONE, null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, Boolean readOnly) { + // this form is deprecated! + return load( id, optionalObject, session, LockOptions.NONE, readOnly ); } @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { - return load( session, id, optionalObject, id, lockOptions ); + return load( id, optionalObject, session, lockOptions, null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly) { + return load( session, id, optionalObject, id, lockOptions, readOnly ); } protected Object load( @@ -59,7 +68,8 @@ protected Object load( Object id, Object optionalObject, Serializable optionalId, - LockOptions lockOptions) { + LockOptions lockOptions, + Boolean readOnly) { List list = loadEntity( session, @@ -69,7 +79,8 @@ protected Object load( entityName, optionalId, persister, - lockOptions + lockOptions, + readOnly ); if ( list.size()==1 ) { diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/BatchingEntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/BatchingEntityLoader.java index fd4573d85a..bb53b14ea6 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/BatchingEntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/BatchingEntityLoader.java @@ -11,6 +11,7 @@ import java.util.Arrays; import java.util.List; +import org.hibernate.HibernateException; import org.hibernate.LockOptions; import org.hibernate.engine.internal.BatchFetchQueueHelper; import org.hibernate.engine.spi.QueryParameters; @@ -50,11 +51,27 @@ public Object load(Serializable id, Object optionalObject, SharedSessionContract return load( id, optionalObject, session, LockOptions.NONE ); } + @Override + public Object load( + Serializable id, + Object optionalObject, + SharedSessionContractImplementor session, + LockOptions lockOptions, + Boolean readOnly) { + return load( id, optionalObject, session, lockOptions, readOnly ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, Boolean readOnly) { + return load( id, optionalObject, session, LockOptions.NONE, readOnly ); + } + protected QueryParameters buildQueryParameters( Serializable id, Serializable[] ids, Object optionalObject, - LockOptions lockOptions) { + LockOptions lockOptions, + Boolean readOnly) { Type[] types = new Type[ids.length]; Arrays.fill( types, persister().getIdentifierType() ); @@ -65,6 +82,9 @@ protected QueryParameters buildQueryParameters( qp.setOptionalEntityName( persister().getEntityName() ); qp.setOptionalId( id ); qp.setLockOptions( lockOptions ); + if ( readOnly != null ) { + qp.setReadOnly( readOnly ); + } return qp; } @@ -88,12 +108,13 @@ protected Object doBatchLoad( SharedSessionContractImplementor session, Serializable[] ids, Object optionalObject, - LockOptions lockOptions) { + LockOptions lockOptions, + Boolean readOnly) { if ( log.isDebugEnabled() ) { log.debugf( "Batch loading entity: %s", MessageHelper.infoString( persister, ids, session.getFactory() ) ); } - QueryParameters qp = buildQueryParameters( id, ids, optionalObject, lockOptions ); + QueryParameters qp = buildQueryParameters( id, ids, optionalObject, lockOptions, readOnly ); try { final List results = loaderToUse.doQueryAndInitializeNonLazyCollections( session, qp, false ); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/DynamicBatchingEntityLoaderBuilder.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/DynamicBatchingEntityLoaderBuilder.java index 7f1c91df2e..9ca9fe373b 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/DynamicBatchingEntityLoaderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/DynamicBatchingEntityLoaderBuilder.java @@ -105,7 +105,8 @@ private List performOrderedMultiLoad( id, persister.getMappedClass().getName(), lockOptions, - (EventSource) session + (EventSource) session, + null ); Object managedEntity = null; @@ -231,7 +232,8 @@ protected List performUnorderedMultiLoad( id, persister.getMappedClass().getName(), lockOptions, - (EventSource) session + (EventSource) session, + null ); Object managedEntity = null; @@ -397,6 +399,16 @@ public Object load( Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { + return load (id, optionalObject, session, lockOptions, null ); + } + + @Override + public Object load( + Serializable id, + Object optionalObject, + SharedSessionContractImplementor session, + LockOptions lockOptions, + Boolean readOnly) { final Serializable[] batch = session.getPersistenceContextInternal() .getBatchFetchQueue() .getEntityBatch( persister(), id, maxBatchSize, persister().getEntityMode() ); @@ -419,7 +431,7 @@ public Object load( log.debugf( "Batch loading entity: %s", MessageHelper.infoString( persister(), idsToLoad, session.getFactory() ) ); } - QueryParameters qp = buildQueryParameters( id, idsToLoad, optionalObject, lockOptions ); + QueryParameters qp = buildQueryParameters( id, idsToLoad, optionalObject, lockOptions, readOnly ); List results = dynamicLoader.doEntityBatchFetch( session, qp, idsToLoad ); // The EntityKey for any entity that is not found will remain in the batch. diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityLoader.java index aadba8dc41..4039bfe3b4 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/EntityLoader.java @@ -141,7 +141,11 @@ public EntityLoader( } public Object loadByUniqueKey(SharedSessionContractImplementor session, Object key) { - return load( session, key, null, null, LockOptions.NONE ); + return loadByUniqueKey( session, key, null ); + } + + public Object loadByUniqueKey(SharedSessionContractImplementor session, Object key, Boolean readOnly) { + return load( session, key, null, null, LockOptions.NONE, readOnly ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/LegacyBatchingEntityLoaderBuilder.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/LegacyBatchingEntityLoaderBuilder.java index fb6865e2fb..35f8038d03 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/LegacyBatchingEntityLoaderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/LegacyBatchingEntityLoaderBuilder.java @@ -81,6 +81,11 @@ public LegacyBatchingEntityLoader( @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { + return load( id, optionalObject, session, lockOptions, null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly) { final Serializable[] batch = session.getPersistenceContextInternal() .getBatchFetchQueue() .getEntityBatch( persister(), id, batchSizes[0], persister().getEntityMode() ); @@ -99,7 +104,8 @@ public Object load(Serializable id, Object optionalObject, SharedSessionContract persister().getEntityName(), id, persister(), - lockOptions + lockOptions, + readOnly ); // The EntityKey for any entity that is not found will remain in the batch. // Explicitly remove the EntityKeys for entities that were not found to diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/PaddedBatchingEntityLoaderBuilder.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/PaddedBatchingEntityLoaderBuilder.java index 019b79f362..9c605d9fd0 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/PaddedBatchingEntityLoaderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/PaddedBatchingEntityLoaderBuilder.java @@ -91,6 +91,11 @@ public PaddedBatchingEntityLoader( @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { + return load( id, optionalObject, session, lockOptions, null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly) { final Serializable[] batch = session.getPersistenceContextInternal() .getBatchFetchQueue() .getEntityBatch( persister(), id, batchSizes[0], persister().getEntityMode() ); @@ -123,7 +128,7 @@ public Object load(Serializable id, Object optionalObject, SharedSessionContract idsToLoad[i] = id; } - return doBatchLoad( id, loaders[indexToUse], session, idsToLoad, optionalObject, lockOptions ); + return doBatchLoad( id, loaders[indexToUse], session, idsToLoad, optionalObject, lockOptions, readOnly ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/UniqueEntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/UniqueEntityLoader.java index 42683930c9..9763703486 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/UniqueEntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/UniqueEntityLoader.java @@ -29,6 +29,10 @@ public interface UniqueEntityLoader { @Deprecated Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session) throws HibernateException; + default Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, Boolean readOnly) throws HibernateException { + return load( id, optionalObject, session ); + } + /** * Load an entity instance by id. If optionalObject is supplied (non-null, * the entity state is loaded into that object instance instead of instantiating a new one. @@ -47,4 +51,13 @@ Object load( Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions); + + default Object load( + Serializable id, + Object optionalObject, + SharedSessionContractImplementor session, + LockOptions lockOptions, + Boolean readOnly) { + return load( id, optionalObject, session, lockOptions ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/AbstractLoadPlanBasedEntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/AbstractLoadPlanBasedEntityLoader.java index 4944779dca..099e3b348d 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/AbstractLoadPlanBasedEntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/AbstractLoadPlanBasedEntityLoader.java @@ -139,8 +139,20 @@ public final List loadEntityBatch( final String optionalEntityName, final Serializable optionalId, final EntityPersister persister, - LockOptions lockOptions) throws HibernateException { + final LockOptions lockOptions) throws HibernateException { + return loadEntityBatch( session, ids, idType, optionalObject, optionalEntityName, optionalId, persister, lockOptions, null ); + } + public final List loadEntityBatch( + final SharedSessionContractImplementor session, + final Serializable[] ids, + final Type idType, + final Object optionalObject, + final String optionalEntityName, + final Serializable optionalId, + final EntityPersister persister, + final LockOptions lockOptions, + final Boolean readOnly) throws HibernateException { if ( log.isDebugEnabled() ) { log.debugf( "Batch loading entity: %s", MessageHelper.infoString( persister, ids, getFactory() ) ); } @@ -153,7 +165,9 @@ public final List loadEntityBatch( qp.setPositionalParameterTypes( types ); qp.setPositionalParameterValues( ids ); qp.setLockOptions( lockOptions ); - + if ( readOnly != null ) { + qp.setReadOnly( readOnly ); + } result = executeLoad( session, qp, @@ -178,11 +192,21 @@ public final List loadEntityBatch( @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session) throws HibernateException { - return load( id, optionalObject, session, LockOptions.NONE ); + return load( id, optionalObject, session, (Boolean) null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, Boolean readOnly) throws HibernateException { + return load( id, optionalObject, session, LockOptions.NONE, readOnly ); } @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { + return load( id, optionalObject, session, lockOptions, null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly) { final Object result; try { @@ -193,7 +217,9 @@ public Object load(Serializable id, Object optionalObject, SharedSessionContract qp.setOptionalEntityName( entityPersister.getEntityName() ); qp.setOptionalId( id ); qp.setLockOptions( lockOptions ); - + if ( readOnly != null ) { + qp.setReadOnly( readOnly ); + } final List results = executeLoad( session, qp, diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/BatchingEntityLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/BatchingEntityLoader.java index 2aaa1842b7..b115d5735e 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/BatchingEntityLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/BatchingEntityLoader.java @@ -49,7 +49,7 @@ public EntityPersister persister() { @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session) { - return load( id, optionalObject, session, LockOptions.NONE ); + return load( id, optionalObject, session, LockOptions.NONE, null ); } protected QueryParameters buildQueryParameters( diff --git a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java index cbe923f7ea..b80cb6f576 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/entity/plan/LegacyBatchingEntityLoaderBuilder.java @@ -94,6 +94,11 @@ protected LegacyBatchingEntityLoader( @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { + return load( id, optionalObject, session, lockOptions, null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly) { final Serializable[] batch = session.getPersistenceContextInternal() .getBatchFetchQueue() .getEntityBatch( persister(), id, batchSizes[0], persister().getEntityMode() ); @@ -112,7 +117,8 @@ public Object load(Serializable id, Object optionalObject, SharedSessionContract persister().getEntityName(), id, persister(), - lockOptions + lockOptions, + readOnly ); // The EntityKey for any entity that is not found will remain in the batch. // Explicitly remove the EntityKeys for entities that were not found to diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index dd45839ad5..ce1953c3dd 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -4370,13 +4370,22 @@ public Object load(Serializable id, Object optionalObject, LockMode lockMode, Sh */ public Object load(Serializable id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session) throws HibernateException { + return doLoad( id, optionalObject, lockOptions, session, null ); + } + public Object load(Serializable id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session, Boolean readOnly) + throws HibernateException { + return doLoad( id, optionalObject, lockOptions, session, readOnly ); + } + + private Object doLoad(Serializable id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session, Boolean readOnly) + throws HibernateException { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Fetching entity: {0}", MessageHelper.infoString( this, id, getFactory() ) ); } final UniqueEntityLoader loader = getAppropriateLoader( lockOptions, session ); - return loader.load( id, optionalObject, session, lockOptions ); + return loader.load( id, optionalObject, session, lockOptions, readOnly ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java index 9e45d5410b..e214bb8c4f 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java @@ -376,12 +376,22 @@ Serializable loadEntityIdByNaturalId( Object load(Serializable id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session) throws HibernateException; + default Object load(Serializable id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session, Boolean readOnly) + throws HibernateException { + return load( id, optionalObject, lockMode, session ); + } + /** * Load an instance of the persistent class. */ Object load(Serializable id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session) throws HibernateException; + default Object load(Serializable id, Object optionalObject, LockOptions lockOptions, SharedSessionContractImplementor session, Boolean readOnly) + throws HibernateException { + return load( id, optionalObject, lockOptions, session ); + } + /** * Performs a load of multiple entities (of this type) by identifier simultaneously. * @@ -546,7 +556,7 @@ void update( * Does this class have a natural id cache */ boolean hasNaturalIdCache(); - + /** * Get the NaturalId cache (optional operation) */ diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/NamedQueryLoader.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/NamedQueryLoader.java index ead92404b4..a8c69f40cc 100755 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/NamedQueryLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/NamedQueryLoader.java @@ -48,15 +48,25 @@ public NamedQueryLoader(String queryName, EntityPersister persister) { @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions) { + return load( id, optionalObject, session, (Boolean) null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly) { if ( lockOptions != null ) { LOG.debug( "Ignoring lock-options passed to named query loader" ); } - return load( id, optionalObject, session ); + return load( id, optionalObject, session, readOnly ); } @Override public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session) { - LOG.debugf( "Loading entity: %s using named query: %s", persister.getEntityName(), queryName ); + return load( id, optionalObject, session, (Boolean) null ); + } + + @Override + public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, Boolean readOnly) { + LOG.debugf("Loading entity: %s using named query: %s", persister.getEntityName(), queryName); // IMPL NOTE: essentially we perform the named query (which loads the entity into the PC), and then // do an internal lookup of the entity from the PC. @@ -73,6 +83,9 @@ public Object load(Serializable id, Object optionalObject, SharedSessionContract query.setOptionalEntityName( persister.getEntityName() ); query.setOptionalObject( optionalObject ); query.setFlushMode( FlushMode.MANUAL ); + if ( readOnly != null ) { + query.setReadOnly( readOnly ); + } query.list(); // now look up the object we are really interested in! diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/EntityManagerTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/EntityManagerTest.java index 13d0bebd86..6bc16d9565 100755 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/EntityManagerTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/EntityManagerTest.java @@ -30,6 +30,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.jpa.AvailableSettings; import org.hibernate.jpa.HibernateEntityManagerFactory; +import org.hibernate.jpa.QueryHints; import org.hibernate.stat.Statistics; import org.hibernate.testing.TestForIssue; import org.junit.Test; @@ -488,6 +489,49 @@ public void testEntityNotFoundException() throws Exception { } } + @Test + @TestForIssue( jiraKey = "HHH-11958" ) + public void testReadonlyHibernateQueryHint() { + + EntityManager em = getOrCreateEntityManager(); + em.getTransaction().begin(); + Wallet w = new Wallet(); + w.setBrand("Lacoste"); + w.setModel("Minimic"); + w.setSerial("0324"); + em.persist(w); + try { + em.getTransaction().commit(); + } finally { + em.close(); + } + + em = getOrCreateEntityManager(); + Map hints = new HashMap<>(); + hints.put(QueryHints.HINT_READONLY, true); + + em.getTransaction().begin(); + + Wallet fetchedWallet = em.find(Wallet.class, w.getSerial(), hints); + fetchedWallet.setBrand("Givenchy"); + + try { + em.getTransaction().commit(); + } finally { + em.close(); + } + + em = getOrCreateEntityManager(); + em.getTransaction().begin(); + fetchedWallet = em.find(Wallet.class, w.getSerial()); + try { + em.getTransaction().commit(); + assertEquals("Lacoste", fetchedWallet.getBrand()); + } finally { + em.close(); + } + } + private static class MyObject { public int value; } diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/PersisterClassProviderTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/PersisterClassProviderTest.java index 98bd45c81f..c9324eeb88 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/PersisterClassProviderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/ejb3configuration/PersisterClassProviderTest.java @@ -264,7 +264,7 @@ public int getVersionProperty() { public boolean hasNaturalIdentifier() { return false; } - + @Override public int[] getNaturalIdentifierProperties() { return new int[0]; @@ -280,7 +280,7 @@ public Serializable loadEntityIdByNaturalId(Object[] naturalIdValues, LockOption SharedSessionContractImplementor session) { return null; } - + @Override public boolean hasNaturalIdCache() { return false; From 674b1dfd271a940b91038a7e5f72a3f381697e75 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Thu, 26 Dec 2019 16:21:55 -0500 Subject: [PATCH 06/10] HHH-13800 Fix typos in Javadoc --- .../org/hibernate/BasicQueryContract.java | 4 +- .../src/main/java/org/hibernate/Criteria.java | 8 +- .../main/java/org/hibernate/Hibernate.java | 2 +- .../java/org/hibernate/MappingException.java | 2 +- .../src/main/java/org/hibernate/Query.java | 2 +- .../java/org/hibernate/SessionFactory.java | 2 +- .../org/hibernate/SessionFactoryObserver.java | 2 +- .../org/hibernate/StaleStateException.java | 2 +- .../hibernate/UnknownEntityTypeException.java | 2 +- .../action/internal/EntityUpdateAction.java | 30 +- .../UnresolvedEntityInsertActions.java | 2 +- .../annotations/CacheConcurrencyStrategy.java | 2 +- .../annotations/DiscriminatorOptions.java | 2 +- .../org/hibernate/annotations/ManyToAny.java | 2 +- .../hibernate/annotations/OptimisticLock.java | 2 +- .../org/hibernate/annotations/QueryHints.java | 8 +- .../java/org/hibernate/boot/Metadata.java | 6 +- .../org/hibernate/boot/MetadataBuilder.java | 4 +- .../org/hibernate/boot/MetadataSources.java | 2 +- .../hibernate/boot/SessionFactoryBuilder.java | 2 +- .../boot/archive/internal/ArchiveHelper.java | 4 +- .../boot/model/naming/DatabaseIdentifier.java | 2 +- .../boot/model/naming/Identifier.java | 2 +- .../model/naming/ObjectNameNormalizer.java | 2 +- .../model/process/spi/ManagedResources.java | 2 +- .../boot/model/relational/QualifiedName.java | 2 +- .../boot/model/source/spi/FilterSource.java | 2 +- .../source/spi/MetadataSourceProcessor.java | 2 +- .../boot/spi/NaturalIdUniqueKeyBinder.java | 2 +- .../boot/spi/SessionFactoryOptions.java | 2 +- .../enhance/spi/EnhancementContext.java | 2 +- .../enhance/spi/EnhancerConstants.java | 4 +- .../interceptor/LazyAttributeDescriptor.java | 2 +- .../bytecode/spi/ClassTransformer.java | 2 +- ...oCacheRegionFactoryAvailableException.java | 2 +- .../cache/cfg/spi/DomainDataRegionConfig.java | 2 +- .../internal/CacheKeyImplementation.java | 2 +- .../spi/access/CachedDomainDataAccess.java | 2 +- .../cache/spi/access/EntityDataAccess.java | 6 +- .../cache/spi/access/NaturalIdDataAccess.java | 12 +- .../hibernate/cache/spi/entry/CacheEntry.java | 2 +- .../spi/support/AbstractReadWriteAccess.java | 2 +- .../hibernate/cfg/AbstractPropertyHolder.java | 4 +- .../org/hibernate/cfg/AnnotatedClassType.java | 4 +- .../org/hibernate/cfg/AnnotationBinder.java | 4 +- .../org/hibernate/cfg/AvailableSettings.java | 18 +- .../hibernate/cfg/ClassPropertyHolder.java | 2 +- .../org/hibernate/cfg/Ejb3JoinColumn.java | 4 +- .../java/org/hibernate/cfg/Environment.java | 12 +- .../java/org/hibernate/cfg/FkSecondPass.java | 2 +- .../hibernate/cfg/ImprovedNamingStrategy.java | 2 +- .../org/hibernate/cfg/NamingStrategy.java | 2 +- .../org/hibernate/cfg/OneToOneSecondPass.java | 10 +- .../org/hibernate/cfg/PropertyHolder.java | 2 +- .../hibernate/cfg/PropertyHolderBuilder.java | 4 +- .../hibernate/cfg/PropertyInferredData.java | 4 +- .../cfg/annotations/EntityBinder.java | 4 +- .../cfg/annotations/SimpleValueBinder.java | 4 +- .../JPAOverriddenAnnotationReader.java | 2 +- .../annotations/reflection/XMLContext.java | 6 +- .../BeanValidationEventListener.java | 2 +- .../collection/internal/PersistentBag.java | 2 +- .../internal/ThreadLocalSessionContext.java | 2 +- .../AbstractEmptinessExpression.java | 2 +- .../org/hibernate/criterion/Criterion.java | 12 +- .../criterion/EnhancedProjection.java | 2 +- .../java/org/hibernate/criterion/Example.java | 10 +- .../org/hibernate/criterion/Projection.java | 2 +- .../org/hibernate/criterion/Restrictions.java | 8 +- .../org/hibernate/dialect/Cache71Dialect.java | 2 +- .../java/org/hibernate/dialect/Dialect.java | 18 +- .../org/hibernate/dialect/Ingres9Dialect.java | 2 +- .../org/hibernate/dialect/IngresDialect.java | 2 +- .../hibernate/dialect/MimerSQLDialect.java | 4 +- .../hibernate/dialect/Oracle10gDialect.java | 2 +- .../hibernate/dialect/Oracle8iDialect.java | 4 +- .../org/hibernate/dialect/Oracle9Dialect.java | 2 +- .../dialect/PostgreSQL81Dialect.java | 12 +- .../hibernate/dialect/RDMSOS2200Dialect.java | 4 +- .../ResultColumnReferenceStrategy.java | 118 ++-- .../hibernate/dialect/TeradataDialect.java | 546 +++++++++--------- .../AbstractAnsiTrimEmulationFunction.java | 6 +- .../function/AvgWithArgumentCastFunction.java | 2 +- .../dialect/function/ConvertFunction.java | 2 +- .../dialect/lock/SelectLockingStrategy.java | 2 +- .../dialect/lock/UpdateLockingStrategy.java | 2 +- .../pagination/SQLServer2005LimitHandler.java | 2 +- .../engine/internal/ImmutableEntityEntry.java | 2 +- .../engine/internal/JoinSequence.java | 4 +- .../DatasourceConnectionProviderImpl.java | 4 +- .../hibernate/engine/profile/Association.java | 2 +- .../org/hibernate/engine/profile/Fetch.java | 2 +- .../engine/query/spi/HQLQueryPlan.java | 2 +- .../engine/query/spi/ParameterParser.java | 2 +- .../org/hibernate/engine/spi/ActionQueue.java | 2 +- .../hibernate/engine/spi/BatchFetchQueue.java | 10 +- .../hibernate/engine/spi/CascadingAction.java | 6 +- .../engine/spi/CascadingActions.java | 2 +- .../engine/spi/ExceptionConverter.java | 8 +- .../engine/spi/NamedQueryDefinition.java | 2 +- .../engine/spi/NamedSQLQueryDefinition.java | 4 +- .../engine/spi/PersistenceContext.java | 24 +- .../engine/spi/SessionDelegatorBaseImpl.java | 2 +- .../engine/spi/SessionFactoryImplementor.java | 2 +- .../spi/SharedSessionContractImplementor.java | 2 +- .../engine/spi/UnsavedValueStrategy.java | 2 +- .../transaction/spi/TransactionObserver.java | 2 +- .../internal/AbstractSaveEventListener.java | 4 +- ...aultInitializeCollectionEventListener.java | 2 +- .../EntityCopyAllowedLoggedObserver.java | 2 +- .../event/internal/MergeContext.java | 2 +- .../AbstractPreDatabaseOperationEvent.java | 4 +- .../org/hibernate/event/spi/DeleteEvent.java | 6 +- .../event/spi/PostInsertEventListener.java | 4 +- .../hibernate/event/spi/PreDeleteEvent.java | 2 +- .../hibernate/hql/internal/ast/HqlToken.java | 2 +- .../ast/ParameterTranslationsImpl.java | 2 +- .../hql/internal/ast/QueryTranslatorImpl.java | 4 +- .../hql/internal/ast/tree/DotNode.java | 2 +- .../internal/ast/tree/FromElementType.java | 2 +- .../internal/ast/tree/ImpliedFromElement.java | 2 +- .../hql/internal/ast/tree/SelectClause.java | 4 +- .../internal/ast/tree/UnaryOperatorNode.java | 4 +- .../hql/internal/ast/util/ASTUtil.java | 4 +- .../hql/internal/classic/FromParser.java | 2 +- .../internal/classic/QueryTranslatorImpl.java | 4 +- .../id/IdentifierGeneratorHelper.java | 4 +- .../id/MultipleHiLoPerTableGenerator.java | 2 +- .../id/PersistentIdentifierGenerator.java | 2 +- .../enhanced/InitialValueAwareOptimizer.java | 2 +- .../hibernate/id/enhanced/TableGenerator.java | 2 +- .../factory/IdentifierGeneratorFactory.java | 2 +- .../id/insert/IdentifierGeneratingInsert.java | 44 +- .../AbstractSharedSessionContract.java | 2 +- .../hibernate/internal/util/BytesHelper.java | 7 +- .../hibernate/internal/util/Cloneable.java | 6 +- .../hibernate/internal/util/ConfigHelper.java | 2 +- .../internal/util/ReflectHelper.java | 4 +- .../hibernate/internal/util/StringHelper.java | 2 +- .../internal/util/collections/Stack.java | 2 +- .../util/config/ConfigurationHelper.java | 2 +- .../hibernate/internal/util/xml/Origin.java | 2 +- .../internal/util/xml/XMLHelper.java | 2 +- .../BatchedTooManyRowsAffectedException.java | 56 +- .../java/org/hibernate/jdbc/WorkExecutor.java | 4 +- .../org/hibernate/jpa/AvailableSettings.java | 2 +- .../hibernate/jpa/HibernateEntityManager.java | 2 +- .../jpa/internal/util/XmlHelper.java | 2 +- .../hibernate/loader/CollectionAliases.java | 2 +- .../loader/GeneratedCollectionAliases.java | 2 +- .../java/org/hibernate/loader/JoinWalker.java | 10 +- .../collection/BasicCollectionLoader.java | 2 +- .../loader/collection/OneToManyLoader.java | 2 +- .../criteria/CriteriaQueryTranslator.java | 2 +- .../custom/ColumnCollectionAliases.java | 4 +- .../hibernate/loader/custom/CustomLoader.java | 2 +- .../loader/custom/EntityFetchReturn.java | 64 +- .../hibernate/loader/custom/FetchReturn.java | 108 ++-- .../loader/custom/sql/SQLQueryParser.java | 28 +- .../plan/build/spi/QuerySpaceTreePrinter.java | 8 +- .../BasicCollectionLoadQueryDetails.java | 2 +- .../BatchingLoadQueryDetailsFactory.java | 8 +- .../exec/internal/EntityLoadQueryDetails.java | 2 +- .../org/hibernate/mapping/Constraint.java | 8 +- .../org/hibernate/mapping/FetchProfile.java | 2 +- .../java/org/hibernate/mapping/Subclass.java | 10 +- .../java/org/hibernate/mapping/Table.java | 2 +- .../metamodel/internal/MetadataContext.java | 6 +- .../DynamicFilterParameterSpecification.java | 4 +- .../org/hibernate/param/ParameterBinder.java | 2 +- .../param/ParameterSpecification.java | 2 +- .../PositionalParameterSpecification.java | 2 +- ...VersionTypeSeedParameterSpecification.java | 2 +- .../collection/CollectionPersister.java | 22 +- .../entity/AbstractEntityPersister.java | 6 +- .../persister/entity/EntityPersister.java | 2 +- .../entity/SingleTableEntityPersister.java | 4 +- .../entity/UnionSubclassEntityPersister.java | 2 +- .../spi/UnknownPersisterException.java | 4 +- .../procedure/ParameterRegistration.java | 2 +- .../access/spi/EnhancedSetterImpl.java | 2 +- .../org/hibernate/proxy/LazyInitializer.java | 14 +- .../criteria/internal/ParameterContainer.java | 2 +- .../expression/BinaryArithmeticOperation.java | 8 +- .../SubqueryComparisonModifierExpression.java | 2 +- .../internal/predicate/NullnessPredicate.java | 2 +- .../internal/predicate/TruthValue.java | 2 +- .../resource/jdbc/LogicalConnection.java | 2 +- .../spi/TransactionCoordinatorOwner.java | 2 +- .../service/UnknownServiceException.java | 2 +- .../internal/ServiceDependencyException.java | 2 +- .../org/hibernate/service/spi/Manageable.java | 2 +- .../service/spi/OptionallyManageable.java | 2 +- .../org/hibernate/service/spi/Wrapped.java | 2 +- .../org/hibernate/sql/OracleJoinFragment.java | 2 +- .../java/org/hibernate/sql/SelectValues.java | 2 +- .../sql/ordering/antlr/NodeSupport.java | 2 +- ...eprecatedNaturalIdCacheStatisticsImpl.java | 6 +- .../internal/NaturalIdStatisticsImpl.java | 6 +- .../SingleLineSqlCommandExtractor.java | 2 +- .../extract/spi/DatabaseInformation.java | 2 +- .../spi/SequenceInformationExtractor.java | 2 +- ...iasToBeanConstructorResultTransformer.java | 148 ++--- .../transform/CacheableResultTransformer.java | 4 +- .../transform/ToListResultTransformer.java | 72 +-- .../org/hibernate/transform/Transformers.java | 66 +-- .../java/org/hibernate/tuple/Tuplizer.java | 4 +- .../tuple/component/ComponentTuplizer.java | 6 +- .../tuple/entity/EntityTuplizer.java | 10 +- .../tuple/entity/EntityTuplizerFactory.java | 2 +- .../tuple/entity/PojoEntityTuplizer.java | 2 +- .../java/org/hibernate/type/ArrayType.java | 12 +- .../main/java/org/hibernate/type/BagType.java | 2 +- .../org/hibernate/type/CollectionType.java | 8 +- .../org/hibernate/type/ComponentType.java | 4 +- .../hibernate/type/CustomCollectionType.java | 4 +- .../hibernate/type/EmbeddedComponentType.java | 2 +- .../java/org/hibernate/type/EntityType.java | 14 +- .../org/hibernate/type/IdentifierBagType.java | 2 +- .../java/org/hibernate/type/ListType.java | 2 +- .../main/java/org/hibernate/type/MapType.java | 2 +- .../org/hibernate/type/OrderedMapType.java | 2 +- .../org/hibernate/type/OrderedSetType.java | 2 +- .../type/SerializationException.java | 2 +- .../main/java/org/hibernate/type/SetType.java | 4 +- .../org/hibernate/type/SortedMapType.java | 2 +- .../org/hibernate/type/SortedSetType.java | 2 +- .../main/java/org/hibernate/type/Type.java | 2 +- .../java/org/hibernate/type/TypeFactory.java | 2 +- .../java/org/hibernate/type/TypeResolver.java | 2 +- .../AttributeConverterMutabilityPlanImpl.java | 2 +- .../type/descriptor/java/DataHelper.java | 4 +- .../hibernate/usertype/CompositeUserType.java | 4 +- .../hibernate/usertype/LoggableUserType.java | 2 +- .../usertype/UserCollectionType.java | 2 +- .../java/org/hibernate/usertype/UserType.java | 4 +- 236 files changed, 1057 insertions(+), 1058 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/BasicQueryContract.java b/hibernate-core/src/main/java/org/hibernate/BasicQueryContract.java index 9042ec5af1..a8fa7dc031 100644 --- a/hibernate-core/src/main/java/org/hibernate/BasicQueryContract.java +++ b/hibernate-core/src/main/java/org/hibernate/BasicQueryContract.java @@ -83,7 +83,7 @@ default BasicQueryContract setFlushMode(FlushMode flushMode) { T setCacheMode(CacheMode cacheMode); /** - * Are the results of this query eligible for second level query caching? This is different that second level + * Are the results of this query eligible for second level query caching? This is different than second level * caching of any returned entities and collections. * * NOTE: the query being "eligible" for caching does not necessarily mean its results will be cached. Second level @@ -156,7 +156,7 @@ default BasicQueryContract setFlushMode(FlushMode flushMode) { /** * Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC - * query via {@link java.sql.Statement#setFetchSize(int)}. As defined b y JDBC, this value is a hint to the + * query via {@link java.sql.Statement#setFetchSize(int)}. As defined by JDBC, this value is a hint to the * driver to indicate how many rows to fetch from the database when more rows are needed. * * NOTE : JDBC expressly defines this value as a hint. It may or may not have any effect on the actual diff --git a/hibernate-core/src/main/java/org/hibernate/Criteria.java b/hibernate-core/src/main/java/org/hibernate/Criteria.java index 3487995ccc..014694b876 100644 --- a/hibernate-core/src/main/java/org/hibernate/Criteria.java +++ b/hibernate-core/src/main/java/org/hibernate/Criteria.java @@ -334,7 +334,7 @@ public interface Criteria extends CriteriaSpecification { * @param withClause The criteria to be added to the join condition (ON clause) * * @return the created "sub criteria" - * + * * @throws HibernateException Indicates a problem creating the sub criteria */ public Criteria createCriteria(String associationPath, String alias, JoinType joinType, Criterion withClause) throws HibernateException; @@ -490,13 +490,13 @@ public interface Criteria extends CriteriaSpecification { */ public Criteria setComment(String comment); - + /** * Add a DB query hint to the SQL. These differ from JPA's {@link javax.persistence.QueryHint}, which is specific * to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the * vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will * determine concatenation and placement. - * + * * @param hint The database specific query hint to add. * @return this (for method chaining) */ @@ -550,7 +550,7 @@ public interface Criteria extends CriteriaSpecification { * query results. * * @throws HibernateException Indicates a problem either translating the criteria to SQL, - * exeucting the SQL or processing the SQL results. + * executing the SQL or processing the SQL results. */ public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException; diff --git a/hibernate-core/src/main/java/org/hibernate/Hibernate.java b/hibernate-core/src/main/java/org/hibernate/Hibernate.java index a08cee7acc..ff12828e3e 100644 --- a/hibernate-core/src/main/java/org/hibernate/Hibernate.java +++ b/hibernate-core/src/main/java/org/hibernate/Hibernate.java @@ -47,7 +47,7 @@ private Hibernate() { /** * Force initialization of a proxy or persistent collection. *

      - * Note: This only ensures intialization of a proxy object or collection; + * Note: This only ensures initialization of a proxy object or collection; * it is not guaranteed that the elements INSIDE the collection will be initialized/materialized. * * @param proxy a persistable object, proxy, persistent collection or null diff --git a/hibernate-core/src/main/java/org/hibernate/MappingException.java b/hibernate-core/src/main/java/org/hibernate/MappingException.java index e45b8fbc50..ceb7ed9a5d 100644 --- a/hibernate-core/src/main/java/org/hibernate/MappingException.java +++ b/hibernate-core/src/main/java/org/hibernate/MappingException.java @@ -7,7 +7,7 @@ package org.hibernate; /** - * An exception that occurs while reading mapping sources (xml/annotations),usually as a result of something + * An exception that occurs while reading mapping sources (xml/annotations), usually as a result of something * screwy in the O-R mappings. * * @author Gavin King diff --git a/hibernate-core/src/main/java/org/hibernate/Query.java b/hibernate-core/src/main/java/org/hibernate/Query.java index 5fbf556736..adf1729354 100644 --- a/hibernate-core/src/main/java/org/hibernate/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/Query.java @@ -240,7 +240,7 @@ default Query setHibernateFlushMode(FlushMode flushMode) { Query setCacheMode(CacheMode cacheMode); /** - * Are the results of this query eligible for second level query caching? This is different that second level + * Are the results of this query eligible for second level query caching? This is different than second level * caching of any returned entities and collections. * * NOTE: the query being "eligible" for caching does not necessarily mean its results will be cached. Second level diff --git a/hibernate-core/src/main/java/org/hibernate/SessionFactory.java b/hibernate-core/src/main/java/org/hibernate/SessionFactory.java index 4c8a15975a..93d5632595 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionFactory.java @@ -104,7 +104,7 @@ public interface SessionFactory extends EntityManagerFactory, HibernateEntityMan StatelessSession openStatelessSession(Connection connection); /** - * Retrieve the statistics fopr this factory. + * Retrieve the statistics for this factory. * * @return The statistics. */ diff --git a/hibernate-core/src/main/java/org/hibernate/SessionFactoryObserver.java b/hibernate-core/src/main/java/org/hibernate/SessionFactoryObserver.java index d4aaf98831..776f41b96b 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionFactoryObserver.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionFactoryObserver.java @@ -24,7 +24,7 @@ default void sessionFactoryCreated(SessionFactory factory) { } /** - * Callback to indicate that the given factory is about close. The passed factory reference should be usable + * Callback to indicate that the given factory is about to close. The passed factory reference should be usable * since it is only about to close. *

      * NOTE : defined as default to allow for existing SessionFactoryObserver impls to work diff --git a/hibernate-core/src/main/java/org/hibernate/StaleStateException.java b/hibernate-core/src/main/java/org/hibernate/StaleStateException.java index 8a44fab2d2..85d8c91bfd 100755 --- a/hibernate-core/src/main/java/org/hibernate/StaleStateException.java +++ b/hibernate-core/src/main/java/org/hibernate/StaleStateException.java @@ -8,7 +8,7 @@ /** * Thrown when a version number or timestamp check failed, indicating that the Session contained - * stale data (when using long transactions with versioning). Also occurs if we try delete or update + * stale data (when using long transactions with versioning). Also occurs if we try to delete or update * a row that does not exist. * * Note that this exception often indicates that the user failed to specify the correct diff --git a/hibernate-core/src/main/java/org/hibernate/UnknownEntityTypeException.java b/hibernate-core/src/main/java/org/hibernate/UnknownEntityTypeException.java index 7249e3de5c..0de3f12cd5 100644 --- a/hibernate-core/src/main/java/org/hibernate/UnknownEntityTypeException.java +++ b/hibernate-core/src/main/java/org/hibernate/UnknownEntityTypeException.java @@ -10,7 +10,7 @@ * Indicates an attempt was made to refer to an unknown entity name/class. *

      * NOTE : extends MappingException because that's what core used to do and that's how - * HEM expectes it. Longer term I think it makes more sense to have a different + * HEM expects it. Longer term I think it makes more sense to have a different * hierarchy for runtime-"mapping" exceptions. * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/action/internal/EntityUpdateAction.java b/hibernate-core/src/main/java/org/hibernate/action/internal/EntityUpdateAction.java index ff19ec265d..66831d369d 100644 --- a/hibernate-core/src/main/java/org/hibernate/action/internal/EntityUpdateAction.java +++ b/hibernate-core/src/main/java/org/hibernate/action/internal/EntityUpdateAction.java @@ -60,7 +60,7 @@ public final class EntityUpdateAction extends EntityAction { * @param previousVersion The previous (stored) version * @param nextVersion The incremented version * @param instance The entity instance - * @param rowId The entity's rowid + * @param rowId The entity's row id * @param persister The entity's persister * @param session The session */ @@ -129,12 +129,12 @@ public void execute() throws HibernateException { // multiple actions queued during the same flush previousVersion = persister.getVersion( instance ); } - + final Object ck; if ( persister.canWriteToCache() ) { final EntityDataAccess cache = persister.getCacheAccessStrategy(); ck = cache.generateCacheKey( - id, + id, persister, factory, session.getTenantIdentifier() @@ -146,16 +146,16 @@ public void execute() throws HibernateException { } if ( !veto ) { - persister.update( - id, - state, - dirtyFields, - hasDirtyCollection, - previousState, - previousVersion, - instance, - rowId, - session + persister.update( + id, + state, + dirtyFields, + hasDirtyCollection, + previousState, + previousVersion, + instance, + rowId, + session ); } @@ -163,7 +163,7 @@ public void execute() throws HibernateException { if ( entry == null ) { throw new AssertionFailure( "possible nonthreadsafe access to session" ); } - + if ( entry.getStatus()==Status.MANAGED || persister.isVersionPropertyGenerated() ) { // get the updated snapshot of the entity state by cloning current state; // it is safe to copy in place, since by this time no-one else (should have) @@ -326,7 +326,7 @@ public void doAfterTransactionCompletion(boolean success, SharedSessionContractI persister, factory, session.getTenantIdentifier() - + ); if ( success && diff --git a/hibernate-core/src/main/java/org/hibernate/action/internal/UnresolvedEntityInsertActions.java b/hibernate-core/src/main/java/org/hibernate/action/internal/UnresolvedEntityInsertActions.java index a75610bc5f..78fad6dacf 100644 --- a/hibernate-core/src/main/java/org/hibernate/action/internal/UnresolvedEntityInsertActions.java +++ b/hibernate-core/src/main/java/org/hibernate/action/internal/UnresolvedEntityInsertActions.java @@ -281,7 +281,7 @@ public void serialize(ObjectOutputStream oos) throws IOException { } /** - * Deerialize a {@link UnresolvedEntityInsertActions} object. + * Deserialize an {@link UnresolvedEntityInsertActions} object. * * @param ois - the input stream. * @param session - the session. diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/CacheConcurrencyStrategy.java b/hibernate-core/src/main/java/org/hibernate/annotations/CacheConcurrencyStrategy.java index a626208bb9..1252e785d9 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/CacheConcurrencyStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/CacheConcurrencyStrategy.java @@ -71,7 +71,7 @@ public static CacheConcurrencyStrategy fromAccessType(AccessType accessType) { if ( null == accessType ) { return NONE; } - + switch ( accessType ) { case READ_ONLY: { return READ_ONLY; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/DiscriminatorOptions.java b/hibernate-core/src/main/java/org/hibernate/annotations/DiscriminatorOptions.java index 14433bc6d6..341e52e563 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/DiscriminatorOptions.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/DiscriminatorOptions.java @@ -13,7 +13,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * Optional annotation to express Hibernate specific discrimintor properties. + * Optional annotation to express Hibernate specific discriminator properties. * * @author Hardy Ferentschik */ diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/ManyToAny.java b/hibernate-core/src/main/java/org/hibernate/annotations/ManyToAny.java index 5e24f340a7..aac5ede2d8 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/ManyToAny.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/ManyToAny.java @@ -34,7 +34,7 @@ String metaDef() default ""; /** - * Metadata dicriminator column description, This column will hold the meta value corresponding to the + * Metadata discriminator column description, This column will hold the meta value corresponding to the * targeted entity. */ Column metaColumn(); diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/OptimisticLock.java b/hibernate-core/src/main/java/org/hibernate/annotations/OptimisticLock.java index 97c5286594..ed66782f51 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/OptimisticLock.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/OptimisticLock.java @@ -12,7 +12,7 @@ import java.lang.annotation.Target; /** - * Whether or not a change of the annotated property will trigger a entity version increment. + * Whether or not a change of the annotated property will trigger an entity version increment. * * If the annotation is not present, the property is involved in the optimistic lock strategy (default). * diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/QueryHints.java b/hibernate-core/src/main/java/org/hibernate/annotations/QueryHints.java index 3b40ef4711..b524bfe5bf 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/QueryHints.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/QueryHints.java @@ -103,11 +103,11 @@ private QueryHints() { * Accepts a {@link javax.persistence.LockModeType} or a {@link org.hibernate.LockMode} */ public static final String NATIVE_LOCKMODE = "org.hibernate.lockMode"; - + /** * Hint providing a "fetchgraph" EntityGraph. Attributes explicitly specified as AttributeNodes are treated as * FetchType.EAGER (via join fetch or subsequent select). - * + * * Note: Currently, attributes that are not specified are treated as FetchType.LAZY or FetchType.EAGER depending * on the attribute's definition in metadata, rather than forcing FetchType.LAZY. * @@ -115,7 +115,7 @@ private QueryHints() { */ @Deprecated public static final String FETCHGRAPH = GraphSemantic.FETCH.getJpaHintName(); - + /** * Hint providing a "loadgraph" EntityGraph. Attributes explicitly specified as AttributeNodes are treated as * FetchType.EAGER (via join fetch or subsequent select). Attributes that are not specified are treated as @@ -129,7 +129,7 @@ private QueryHints() { /** * Hint to enable/disable the follow-on-locking mechanism provided by {@link org.hibernate.dialect.Dialect#useFollowOnLocking(QueryParameters)}. * A value of {@code true} enables follow-on-locking, whereas a value of {@code false} disables it. - * If the value is {@code null}, the the {@code Dialect} strategy is going to be used instead. + * If the value is {@code null}, the {@code Dialect} strategy is going to be used instead. * * @since 5.2 */ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/Metadata.java b/hibernate-core/src/main/java/org/hibernate/boot/Metadata.java index 22d9bf2aab..82e9caa4c2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/Metadata.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/Metadata.java @@ -38,7 +38,7 @@ */ public interface Metadata extends Mapping { /** - * Get the builder for {@link org.hibernate.SessionFactory} instances based on this metamodel, + * Get the builder for {@link org.hibernate.SessionFactory} instances based on this metamodel. * * @return The builder for {@link org.hibernate.SessionFactory} instances. */ @@ -67,7 +67,7 @@ public interface Metadata extends Mapping { Database getDatabase(); /** - * Retrieves the PersistentClass entity metadata representation for known all entities. + * Retrieves the PersistentClass entity metadata representation for all known entities. * * Returned collection is immutable * @@ -86,7 +86,7 @@ public interface Metadata extends Mapping { PersistentClass getEntityBinding(String entityName); /** - * Retrieves the Collection metadata representation for known all collections. + * Retrieves the Collection metadata representation for all known collections. * * Returned collection is immutable * diff --git a/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java index ec54db3dbd..70e30cb898 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/MetadataBuilder.java @@ -201,7 +201,7 @@ public interface MetadataBuilder { * setting if using property-based configuration. * * - * @param enable {@code true} to enable; {@code false} to disable;don't call for + * @param enable {@code true} to enable; {@code false} to disable; don't call for * default. * * @return {@code this}, for method chaining @@ -382,7 +382,7 @@ public interface MetadataBuilder { MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject); /** - * Adds an AttributeConverter by a AttributeConverterDefinition + * Adds an AttributeConverter by an AttributeConverterDefinition * * @param definition The definition * diff --git a/hibernate-core/src/main/java/org/hibernate/boot/MetadataSources.java b/hibernate-core/src/main/java/org/hibernate/boot/MetadataSources.java index ecfa53790d..d909bedb12 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/MetadataSources.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/MetadataSources.java @@ -284,7 +284,7 @@ public MetadataSources addClass(Class entityClass) { } /** - * Read mappings as a application resourceName (i.e. classpath lookup). + * Read mappings as an application resourceName (i.e. classpath lookup). * * @param name The resource name * diff --git a/hibernate-core/src/main/java/org/hibernate/boot/SessionFactoryBuilder.java b/hibernate-core/src/main/java/org/hibernate/boot/SessionFactoryBuilder.java index bdd2f22282..9c38c80f46 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/SessionFactoryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/SessionFactoryBuilder.java @@ -653,7 +653,7 @@ SessionFactoryBuilder applyEntityTuplizer( /** * Apply a fetch size to the JDBC driver for fetching results. * - * @param size The fetch saize to be passed to the driver. + * @param size The fetch size to be passed to the driver. * * @return {@code this}, for method chaining * diff --git a/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ArchiveHelper.java b/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ArchiveHelper.java index c3dbfdf80c..80376d4a15 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ArchiveHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ArchiveHelper.java @@ -104,7 +104,7 @@ else if ( "zip".equals( protocol ) * * @return The resolved URL reference * - * @throws IllegalArgumentException is something goes wrong + * @throws IllegalArgumentException if something goes wrong */ public static URL getURLFromPath(String jarPath) { URL jarUrl; @@ -126,7 +126,7 @@ public static URL getURLFromPath(String jarPath) { /** * Extracts the bytes out of an InputStream. This form is the same as {@link #getBytesFromInputStream} - * except that any {@link IOException} are wrapped as (runtime) {@link ArchiveException} + * except that any {@link IOException} is wrapped as (runtime) {@link ArchiveException} * * @param inputStream The stream from which to extract bytes. * diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/DatabaseIdentifier.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/DatabaseIdentifier.java index 6d5eae1a96..5d2f19b60c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/DatabaseIdentifier.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/DatabaseIdentifier.java @@ -16,7 +16,7 @@ public class DatabaseIdentifier extends Identifier { /** - * Constructs a datatabase identifier instance. + * Constructs a database identifier instance. * It is assumed that text is unquoted. * * @param text The identifier text. diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java index 35c925eeb5..be697f9be4 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/Identifier.java @@ -133,7 +133,7 @@ public String getText() { } /** - * Is this a quoted identifier> + * Is this a quoted identifier? * * @return True if this is a quote identifier; false otherwise. */ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ObjectNameNormalizer.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ObjectNameNormalizer.java index ee688be680..824b009ad3 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ObjectNameNormalizer.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ObjectNameNormalizer.java @@ -24,7 +24,7 @@ public abstract class ObjectNameNormalizer { * This implements the rules set forth in JPA 2 (section "2.13 Naming of Database Objects") which * states that the double-quote (") is the character which should be used to denote a quoted * identifier. Here, we handle recognizing that and converting it to the more elegant - * bactick (`) approach used in Hibernate.. Additionally we account for applying what JPA2 terms + * backtick (`) approach used in Hibernate.. Additionally we account for applying what JPA2 terms * "globally quoted identifiers". * * @param identifierText The identifier to be quoting-normalized. diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/ManagedResources.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/ManagedResources.java index df4a69ee71..9740e1842c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/ManagedResources.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/ManagedResources.java @@ -16,7 +16,7 @@ * Represents the result of the first step of the process of building {@link org.hibernate.boot.MetadataSources} * reference into a {@link org.hibernate.boot.Metadata} reference. *

      - * Essentially it represents thecombination of:

        + * Essentially it represents the combination of:
          *
        1. domain classes, packages and mapping files defined via MetadataSources
        2. *
        3. attribute converters defined via MetadataBuildingOptions
        4. *
        5. classes, converters, packages and mapping files auto-discovered as part of scanning
        6. diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/relational/QualifiedName.java b/hibernate-core/src/main/java/org/hibernate/boot/model/relational/QualifiedName.java index accffef431..92139e89c2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/relational/QualifiedName.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/relational/QualifiedName.java @@ -15,7 +15,7 @@ *
        7. {@link java.sql.DatabaseMetaData#getCatalogSeparator()}
        8. *
        *

        - * Also, be careful about the usage of {@link #render}. If the intention is get get the name + * Also, be careful about the usage of {@link #render}. If the intention is to get the name * as used in the database, the {@link org.hibernate.engine.jdbc.env.spi.JdbcEnvironment} -> * {@link org.hibernate.engine.jdbc.env.spi.QualifiedObjectNameFormatter#format} should be * used instead. diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java index 459b002c1e..062676ccb2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/FilterSource.java @@ -33,7 +33,7 @@ public interface FilterSource { public String getCondition(); /** - * Should Hibernate perform automatic alias injection into the supplied condition string? The default it to + * Should Hibernate perform automatic alias injection into the supplied condition string? The default is to * perform auto injection *unless* explicit alias(es) are supplied. * * @return {@code true} indicates auto injection should occur; {@code false} that it should not diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/MetadataSourceProcessor.java b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/MetadataSourceProcessor.java index 6fd2c3f17f..4a857b8a78 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/MetadataSourceProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/MetadataSourceProcessor.java @@ -38,7 +38,7 @@ public interface MetadataSourceProcessor { /** * Process all "root" named queries. These are named queries not defined on * a specific entity (which will be handled later during - * {@link #processEntityHierarchies}. + * {@link #processEntityHierarchies}). *

        * This step has no prerequisites. The returns associated with named native * queries can depend on entity binding being complete, but those are handled diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/NaturalIdUniqueKeyBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/NaturalIdUniqueKeyBinder.java index 3f574f9506..626cabf317 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/NaturalIdUniqueKeyBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/NaturalIdUniqueKeyBinder.java @@ -13,7 +13,7 @@ */ public interface NaturalIdUniqueKeyBinder { /** - * Adds a attribute binding. The attribute is a (top-level) part of the natural-id + * Adds an attribute binding. The attribute is a (top-level) part of the natural-id * * @param attributeBinding The attribute binding that is part of the natural-id */ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java index be055237b3..929a33c4a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/SessionFactoryOptions.java @@ -85,7 +85,7 @@ default boolean isAllowRefreshDetachedEntity() { } /** - * The name to be used for the SessionFactory. This is use both in:

          + * The name to be used for the SessionFactory. This is used both in:
            *
          • in-VM serialization
          • *
          • JNDI binding, depending on {@link #isSessionFactoryNameAlsoJndiName}
          • *
          diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancementContext.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancementContext.java index 1dc3bb46c3..d9b242728a 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancementContext.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancementContext.java @@ -31,7 +31,7 @@ public interface EnhancementContext { public ClassLoader getLoadingClassLoader(); /** - * Does the given class descriptor represent a entity class? + * Does the given class descriptor represent an entity class? * * @param classDescriptor The descriptor of the class to check. * diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancerConstants.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancerConstants.java index 41a09beef7..94958b6f69 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancerConstants.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/EnhancerConstants.java @@ -24,7 +24,7 @@ public final class EnhancerConstants { public static final String PERSISTENT_FIELD_WRITER_PREFIX = "$$_hibernate_write_"; /** - * Name of the method used to get reference the the entity instance (this in the case of enhanced classes). + * Name of the method used to get reference of the entity instance (this in the case of enhanced classes). */ public static final String ENTITY_INSTANCE_GETTER_NAME = "$$_hibernate_getEntityInstance"; @@ -118,7 +118,7 @@ public final class EnhancerConstants { public static final String TRACKER_FIELD_NAME = "$$_hibernate_tracker"; /** - * Name of method that add changed fields + * Name of method to add changed fields */ public static final String TRACKER_CHANGER_NAME = "$$_hibernate_trackChange"; diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/interceptor/LazyAttributeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/interceptor/LazyAttributeDescriptor.java index 53dd06d9e6..0a2b54aff4 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/interceptor/LazyAttributeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/interceptor/LazyAttributeDescriptor.java @@ -65,7 +65,7 @@ public int getAttributeIndex() { } /** - * Access to the index of the attribute in terms of its position withing the lazy attributes of the persister + * Access to the index of the attribute in terms of its position within the lazy attributes of the persister * * @return The persister lazy attribute index */ diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/spi/ClassTransformer.java b/hibernate-core/src/main/java/org/hibernate/bytecode/spi/ClassTransformer.java index ecbb8a6c89..9cd3bbebff 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/spi/ClassTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/spi/ClassTransformer.java @@ -23,7 +23,7 @@ public interface ClassTransformer extends javax.persistence.spi.ClassTransformer /** * Invoked when a class is being loaded or redefined to add hooks for persistence bytecode manipulation. * - * @param loader the defining class loaderof the class being transformed. It may be null if using bootstrap loader + * @param loader the defining class loader of the class being transformed. It may be null if using bootstrap loader * @param className The name of the class being transformed * @param classBeingRedefined If an already loaded class is being redefined, then pass this as a parameter * @param protectionDomain ProtectionDomain of the class being (re)-defined diff --git a/hibernate-core/src/main/java/org/hibernate/cache/NoCacheRegionFactoryAvailableException.java b/hibernate-core/src/main/java/org/hibernate/cache/NoCacheRegionFactoryAvailableException.java index 719bca5858..a400d8e351 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/NoCacheRegionFactoryAvailableException.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/NoCacheRegionFactoryAvailableException.java @@ -9,7 +9,7 @@ import org.hibernate.cfg.Environment; /** - * Indicates a condition where a second-level cache implementation was expected to be to available, but + * Indicates a condition where a second-level cache implementation was expected to be available, but * none was found on the classpath. * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/cache/cfg/spi/DomainDataRegionConfig.java b/hibernate-core/src/main/java/org/hibernate/cache/cfg/spi/DomainDataRegionConfig.java index e278912442..d6e7be9746 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/cfg/spi/DomainDataRegionConfig.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/cfg/spi/DomainDataRegionConfig.java @@ -25,7 +25,7 @@ public interface DomainDataRegionConfig { String getRegionName(); /** - * Retrieve the list of all entity to be stored in this region + * Retrieve the list of all entity data to be stored in this region */ List getEntityCaching(); diff --git a/hibernate-core/src/main/java/org/hibernate/cache/internal/CacheKeyImplementation.java b/hibernate-core/src/main/java/org/hibernate/cache/internal/CacheKeyImplementation.java index ba70417a55..dfe090bfc6 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/internal/CacheKeyImplementation.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/internal/CacheKeyImplementation.java @@ -37,7 +37,7 @@ final class CacheKeyImplementation implements Serializable { * @param id The identifier associated with the cached data * @param type The Hibernate type mapping * @param entityOrRoleName The entity or collection-role name. - * @param tenantId The tenant identifier associated this data. + * @param tenantId The tenant identifier associated with this data. * @param factory The session factory for which we are caching */ CacheKeyImplementation( diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/CachedDomainDataAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/CachedDomainDataAccess.java index 01c1e0c615..5aaf7a66d1 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/CachedDomainDataAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/CachedDomainDataAccess.java @@ -157,7 +157,7 @@ boolean putFromLoad( *

          * The semantic here is whether the cache contains data visible for the * current call context. This should be viewed as a "best effort", meaning - * blocking should be avoid if possible. + * blocking should be avoided if possible. * * @param key The cache key * diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/EntityDataAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/EntityDataAccess.java index fac7eff553..c2eccf08b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/EntityDataAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/EntityDataAccess.java @@ -62,7 +62,7 @@ Object generateCacheKey( * @param key The item key * @param value The item * @param version The item's version value - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * @throws CacheException Propagated from underlying cache provider */ boolean insert(SharedSessionContractImplementor session, Object key, Object value, Object version); @@ -92,7 +92,7 @@ Object generateCacheKey( * @param value The item * @param currentVersion The item's current version value * @param previousVersion The item's previous version value - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * @throws CacheException Propagated from underlying cache provider */ boolean update( @@ -113,7 +113,7 @@ boolean update( * @param currentVersion The item's current version value * @param previousVersion The item's previous version value * @param lock The lock previously obtained from {@link #lockItem} - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * @throws CacheException Propagated from underlying cache provider */ boolean afterUpdate( diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java index b63e09c4d0..5c6b7fd18d 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/access/NaturalIdDataAccess.java @@ -19,7 +19,7 @@ *

        • LOADS : {@link #putFromLoad}
        • *
        * Note the special case of UPDATES above. Because the cache key itself has changed here we need to remove the - * old entry as well as + * old entry as well *

        * There is another usage pattern that is used to invalidate entries * afterQuery performing "bulk" HQL/SQL operations: @@ -44,7 +44,7 @@ public interface NaturalIdDataAccess extends CachedDomainDataAccess { * @param naturalIdValues the sequence of values which unequivocally identifies a cached element on this region * @param rootEntityDescriptor the persister of the element being cached * - * @return a key which can be used to identify this an element unequivocally on this same region + * @return a key which can be used to identify an element unequivocally on this same region */ Object generateCacheKey( Object[] naturalIdValues, @@ -69,7 +69,7 @@ Object generateCacheKey( * @param key The item key * @param value The item * - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * * @throws CacheException Propagated from underlying cache provider */ @@ -84,7 +84,7 @@ Object generateCacheKey( * @param key The item key * @param value The item * - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * * @throws CacheException Propagated from underlying cache provider */ @@ -99,7 +99,7 @@ Object generateCacheKey( * @param key The item key * @param value The item * - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * * @throws CacheException Propagated from underlying cache provider */ @@ -115,7 +115,7 @@ Object generateCacheKey( * @param value The item * @param lock The lock previously obtained from {@link #lockItem} * - * @return Were the contents of the cache actual changed by this operation? + * @return Were the contents of the cache actually changed by this operation? * * @throws CacheException Propagated from underlying cache provider */ diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/CacheEntry.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/CacheEntry.java index dc2ac5de93..18e2bbb10f 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/CacheEntry.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/entry/CacheEntry.java @@ -41,7 +41,7 @@ public interface CacheEntry extends Serializable { * Get the underlying disassembled state * * todo : this was added to support initializing an entity's EntityEntry snapshot during reattach; - * this should be refactored to instead expose a method to assemble a EntityEntry based on this + * this should be refactored to instead expose a method to assemble an EntityEntry based on this * state for return. * * @return The disassembled state diff --git a/hibernate-core/src/main/java/org/hibernate/cache/spi/support/AbstractReadWriteAccess.java b/hibernate-core/src/main/java/org/hibernate/cache/spi/support/AbstractReadWriteAccess.java index 07820086a5..874a254182 100644 --- a/hibernate-core/src/main/java/org/hibernate/cache/spi/support/AbstractReadWriteAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/cache/spi/support/AbstractReadWriteAccess.java @@ -232,7 +232,7 @@ public interface Lockable { boolean isUnlockable(SoftLock lock); /** - * Locks this entry, stamping it with the UUID and lockId given, with the lock timeout occuring at the specified + * Locks this entry, stamping it with the UUID and lockId given, with the lock timeout occurring at the specified * time. The returned Lock object can be used to unlock the entry in the future. */ SoftLockImpl lock(long timeout, UUID uuid, long lockId); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java b/hibernate-core/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java index f5459296a8..029d8a2deb 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java @@ -157,7 +157,7 @@ protected MetadataBuildingContext getContext() { } /** - * Set the property be processed. property can be null + * Set the property to be processed. property can be null * * @param property The property */ @@ -207,7 +207,7 @@ public Column[] getOverriddenColumn(String propertyName) { // - the property uses some restricted values // - the user has overridden the column // also change getOverriddenJoinColumn and getOverriddenJoinTable as well - + // if ( propertyName.contains( ".key." ) ) { // //support for legacy @AttributeOverride declarations // //TODO cache the underlying regexp diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotatedClassType.java b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotatedClassType.java index 1f20465fa2..b872573fc4 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotatedClassType.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotatedClassType.java @@ -14,7 +14,7 @@ */ public enum AnnotatedClassType { /** - * has no revelent top level annotation + * has no relevant top level annotation */ NONE, /** @@ -22,7 +22,7 @@ public enum AnnotatedClassType { */ ENTITY, /** - * has a @Embeddable annotation + * has an @Embeddable annotation */ EMBEDDABLE, /** diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java index bcfc582874..eec3b493ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -1020,7 +1020,7 @@ private static boolean mapAsIdClass( * and we create an identifier mapper containing the id properties of the main entity * * In JPA 2, there is a shortcut if the id class is the Pk of the associated class pointed to by the id - * it ought to be treated as an embedded and not a real IdClass (at least in the Hibernate's internal way + * it ought to be treated as an embedded and not a real IdClass (at least in the Hibernate's internal way) */ XClass classWithIdClass = inheritanceState.getClassWithIdClass( false ); if ( classWithIdClass != null ) { @@ -3186,7 +3186,7 @@ private static void bindOneToOne( //try to find a hidden true one to one (FK == PK columns) KeyValue identifier = propertyHolder.getIdentifier(); if ( identifier == null ) { - //this is a @OneToOne in a @EmbeddedId (the persistentClass.identifier is not set yet, it's being built) + //this is a @OneToOne in an @EmbeddedId (the persistentClass.identifier is not set yet, it's being built) //by definition the PK cannot refers to itself so it cannot map to itself mapToPK = false; } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java index 140ee68ed0..fa623af9de 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -199,7 +199,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { * * delayed access to the BeanManager reference. Here, Hibernate * will not access the reference passed as the BeanManager during * bootstrap until it is first needed. Note however that this has - * the effect of delaying any deployement problems until after + * the effect of delaying any deployment problems until after * bootstrapping. * * This setting is used to configure Hibernate ORM's access to @@ -255,7 +255,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { String HIBERNATE_CLASSLOADER = "hibernate.classLoader.hibernate"; /** - * Names the {@link ClassLoader} used when Hibernate is unable to locates classes on the + * Names the {@link ClassLoader} used when Hibernate is unable to locate classes on the * {@link #APP_CLASSLOADER} or {@link #HIBERNATE_CLASSLOADER}. * @since 4.0 * @deprecated Use {@link #CLASSLOADERS} instead @@ -276,7 +276,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { * enabled - Do the build * *

      1. - * disabled - Do not so the build + * disabled - Do not do the build *
      2. *
      3. * ignoreUnsupported - Do the build, but ignore any non-JPA features that would otherwise @@ -336,7 +336,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { /** * Names the connection user. This might mean one of 2 things in out-of-the-box Hibernate * {@link org.hibernate.engine.jdbc.connections.spi.ConnectionProvider}:
          - *
        • The username used to pass along to creating the JDBC connection
        • + *
        • The username used to pass along to create the JDBC connection
        • *
        • The username used to obtain a JDBC connection from a data source
        • *
        */ @@ -1336,7 +1336,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { String HBM2DDL_DB_MINOR_VERSION = "javax.persistence.database-minor-version"; /** - * Specifies whether schema generation commands for schema creation are to be determine based on object/relational + * Specifies whether schema generation commands for schema creation are to be determined based on object/relational * mapping metadata, DDL scripts, or a combination of the two. See {@link SourceType} for valid set of values. * If no value is specified, a default is assumed as follows:
          *
        • @@ -1352,7 +1352,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { String HBM2DDL_CREATE_SOURCE = "javax.persistence.schema-generation.create-source"; /** - * Specifies whether schema generation commands for schema dropping are to be determine based on object/relational + * Specifies whether schema generation commands for schema dropping are to be determined based on object/relational * mapping metadata, DDL scripts, or a combination of the two. See {@link SourceType} for valid set of values. * If no value is specified, a default is assumed as follows:
            *
          • @@ -1742,7 +1742,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { * handling. Implicitly Hibernate will not pass the NULL, the intention being to allow * any default argument values to be applied. *

            - * This defines a global setting, which can them be controlled per parameter via + * This defines a global setting, which can then be controlled per parameter via * {@link org.hibernate.procedure.ParameterRegistration#enablePassingNulls(boolean)} *

            * Values are {@code true} (pass the NULLs) or {@code false} (do not pass the NULLs). @@ -1804,7 +1804,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { * a JPA {@link javax.persistence.EntityManager}). *

            *

            - * Values are {@code true} permits the refresh, {@code false} does not permit the detached instance refresh and an {@link IllegalArgumentException} is thrown. + * Values are: {@code true} permits the refresh, {@code false} does not permit the detached instance refresh and an {@link IllegalArgumentException} is thrown. *

            * The default value is {@code false} when the Session is bootstrapped via JPA {@link javax.persistence.EntityManagerFactory}, otherwise is {@code true} * @@ -1971,7 +1971,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings { * Determine if the scope of {@link javax.persistence.TableGenerator#name()} and {@link javax.persistence.SequenceGenerator#name()} should be * considered globally or locally defined. * - * If enabled, the names will considered globally scoped so defining two different generators with the same name + * If enabled, the names will be considered globally scoped so defining two different generators with the same name * will cause a name collision and an exception will be thrown during the bootstrap phase. * * @see JpaCompliance#isGlobalGeneratorScopeEnabled() diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/ClassPropertyHolder.java b/hibernate-core/src/main/java/org/hibernate/cfg/ClassPropertyHolder.java index a3958341fc..b2bc07ecda 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/ClassPropertyHolder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/ClassPropertyHolder.java @@ -259,7 +259,7 @@ private void addPropertyToJoin(Property prop, XClass declaringClass, Join join) /** * Needed for proper compliance with naming strategy, the property table - * can be overriden if the properties are part of secondary tables + * can be overridden if the properties are part of secondary tables */ private Map getJoinsPerRealTableName() { if ( joinsPerRealTableName == null ) { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java b/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java index 4413a5c34c..5fe60fd0d8 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Ejb3JoinColumn.java @@ -49,7 +49,7 @@ @SuppressWarnings("unchecked") public class Ejb3JoinColumn extends Ejb3Column { /** - * property name repated to this column + * property name related to this column */ private String referencedColumn; private String mappedBy; @@ -769,7 +769,7 @@ protected void addColumnBinding(SimpleValue value) { // was the column explicitly quoted in the mapping/annotation // TODO: in metamodel, we need to better split global quoting and explicit quoting w/ respect to logical names boolean isLogicalColumnQuoted = StringHelper.isQuoted( getLogicalColumnName() ); - + final ObjectNameNormalizer nameNormalizer = getBuildingContext().getObjectNameNormalizer(); final String logicalColumnName = nameNormalizer.normalizeIdentifierQuotingAsString( getLogicalColumnName() ); final String referencedColumn = nameNormalizer.normalizeIdentifierQuotingAsString( getReferencedColumn() ); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java index f0f2c1376d..30d97d5bcb 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/Environment.java @@ -29,7 +29,7 @@ * Hibernate has two property scopes: *

              *
            • Factory-level properties may be passed to the SessionFactory when it - * instantiated. Each instance might have different property values. If no + * is instantiated. Each instance might have different property values. If no * properties are specified, the factory calls Environment.getProperties(). *
            • System-level properties are shared by all factory instances and are always * determined by the Environment properties. @@ -58,7 +58,7 @@ * * hibernate.connection.provider_class * classname of ConnectionProvider - * subclass (if not specified hueristics are used) + * subclass (if not specified heuristics are used) * * hibernate.connection.usernamedatabase username * hibernate.connection.passworddatabase password @@ -83,7 +83,7 @@ * * * hibernate.connection.datasource - * databasource JNDI name (when using javax.sql.Datasource) + * datasource JNDI name (when using javax.sql.Datasource) * * * hibernate.jndi.urlJNDI InitialContext URL @@ -105,7 +105,7 @@ * * * hibernate.jdbc.use_scrollable_resultset - * enable use of JDBC2 scrollable resultsets (you only need this specify + * enable use of JDBC2 scrollable resultsets (you only need to specify * this property when using user supplied connections) * * @@ -231,9 +231,9 @@ public static void verifyProperties(Map configurationValues) { } /** - * This will be removed soon; currently just returns false as no known JVM exibits this bug + * This will be removed soon; currently just returns false as no known JVM exhibits this bug * and is also able to run this version of Hibernate ORM. - * @deprecated removed as unneccessary + * @deprecated removed as unnecessary * @return false */ @Deprecated diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/FkSecondPass.java b/hibernate-core/src/main/java/org/hibernate/cfg/FkSecondPass.java index 0e07b04725..0a689b3778 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/FkSecondPass.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/FkSecondPass.java @@ -20,7 +20,7 @@ public abstract class FkSecondPass implements SecondPass { * unique counter is needed to differentiate 2 instances of FKSecondPass * as they are compared. * Fairly hacky but IBM VM sometimes returns the same hashCode for 2 different objects - * TODO is it doable to rely on the Ejb3JoinColumn names? Not sure at they could be inferred + * TODO is it doable to rely on the Ejb3JoinColumn names? Not sure as they could be inferred */ private int uniqueCounter; private static AtomicInteger globalCounter = new AtomicInteger(); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java index f23df302b3..6487416f94 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/ImprovedNamingStrategy.java @@ -33,7 +33,7 @@ public String classToTableName(String className) { return addUnderscores( StringHelper.unqualify(className) ); } /** - * Return the full property path with underscore seperators, mixed + * Return the full property path with underscore separators, mixed * case converted to underscores */ public String propertyToColumnName(String propertyName) { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java index 21bb287dbc..80768c9216 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/NamingStrategy.java @@ -83,7 +83,7 @@ public String foreignKeyColumnName( * Return the logical column name used to refer to a column in the metadata * (like index, unique constraints etc) * A full bijection is required between logicalNames and physical ones - * logicalName have to be case insersitively unique for a given table + * logicalName have to be case insensitively unique for a given table * * @param columnName given column name if any * @param propertyName property name of this column diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/OneToOneSecondPass.java b/hibernate-core/src/main/java/org/hibernate/cfg/OneToOneSecondPass.java index c0e8eddc4a..37e0a5e40d 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/OneToOneSecondPass.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/OneToOneSecondPass.java @@ -86,7 +86,7 @@ public void doSecondPass(Map persistentClasses) throws MappingException { final String propertyName = inferredData.getPropertyName(); value.setPropertyName( propertyName ); String referencedEntityName = ToOneBinder.getReferenceEntityName( inferredData, targetEntity, buildingContext ); - value.setReferencedEntityName( referencedEntityName ); + value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() ); //value.setFetchMode( fetchMode ); value.setCascadeDeleteEnabled( cascadeOnDelete ); @@ -218,7 +218,7 @@ else if ( otherSideProperty.getValue() instanceof ManyToOne ) { else { propertyHolder.addProperty( prop, inferredData.getDeclaringClass() ); } - + value.setReferencedPropertyName( mappedBy ); // HHH-6813 @@ -234,7 +234,7 @@ else if ( otherSideProperty.getValue() instanceof ManyToOne ) { } boolean referenceToPrimaryKey = referencesDerivedId || mappedBy == null; value.setReferenceToPrimaryKey( referenceToPrimaryKey ); - + // If the other side is a derived ID, prevent an infinite // loop of attempts to resolve identifiers. if ( referencesDerivedId ) { @@ -263,8 +263,8 @@ else if ( otherSideProperty.getValue() instanceof ManyToOne ) { } /** - * Builds the Join instance for the mapped by side of a OneToOne association using - * a join tables. + * Builds the Join instance for the mapped by side of a OneToOne association using + * a join table. *

              * Note:
              *

                diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java index b0a530a3a5..a07dcb6350 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolder.java @@ -44,7 +44,7 @@ public interface PropertyHolder { boolean isOrWithinEmbeddedId(); /** - * Return true if this component is withing an @ElementCollection. + * Return true if this component is within an @ElementCollection. */ boolean isWithinElementCollection(); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolderBuilder.java b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolderBuilder.java index a38dde94e1..f8ec1d0022 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolderBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyHolderBuilder.java @@ -17,7 +17,7 @@ import org.hibernate.mapping.PersistentClass; /** - * This factory is here ot build a PropertyHolder and prevent .mapping interface adding + * This factory is here to build a PropertyHolder and prevent .mapping interface adding * * @author Emmanuel Bernard */ @@ -58,7 +58,7 @@ public static PropertyHolder buildPropertyHolder( } /** - * buid a property holder on top of a collection + * build a property holder on top of a collection */ public static CollectionPropertyHolder buildPropertyHolder( Collection collection, diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyInferredData.java b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyInferredData.java index cabc9750a4..76233cb2d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/PropertyInferredData.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/PropertyInferredData.java @@ -14,7 +14,7 @@ import org.hibernate.annotations.common.reflection.XProperty; /** - * Retrieve all inferred data from an annnoted element + * Retrieve all inferred data from an annotated element * * @author Emmanuel Bernard * @author Paolo Perrotta @@ -37,7 +37,7 @@ public String toString() { } /** - * Take the annoted element for lazy process + * Take the annotated element for lazy process */ public PropertyInferredData(XClass declaringClass, XProperty property, String propertyAccessor, ReflectionManager reflectionManager) { this.declaringClass = declaringClass; diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java index ad96518092..90a55a048d 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java @@ -424,7 +424,7 @@ public void bindEntity() { ); } } - persistentClass.addFilter(filterName, cond, filter.deduceAliasInjectionPoints(), + persistentClass.addFilter(filterName, cond, filter.deduceAliasInjectionPoints(), toAliasTableMap(filter.aliases()), toAliasEntityMap(filter.aliases())); } LOG.debugf( "Import with entity name %s", name ); @@ -460,7 +460,7 @@ private void processNamedEntityGraph(NamedEntityGraph annotation) { new NamedEntityGraphDefinition( annotation, name, persistentClass.getEntityName() ) ); } - + public void bindDiscriminatorValue() { if ( StringHelper.isEmpty( discriminatorValue ) ) { Value discriminator = persistentClass.getDiscriminator(); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/SimpleValueBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/SimpleValueBinder.java index 5b55c0a2cf..2f55aec0ad 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/SimpleValueBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/SimpleValueBinder.java @@ -454,7 +454,7 @@ public void linkWithValue() { public void fillSimpleValue() { LOG.debugf( "Starting fillSimpleValue for %s", propertyName ); - + if ( attributeConverterDescriptor != null ) { if ( ! BinderHelper.isEmptyAnnotationValue( explicitType ) ) { throw new AnnotationException( @@ -531,7 +531,7 @@ public void fillSimpleValue() { if ( timeStampVersionType != null ) { simpleValue.setTypeName( timeStampVersionType ); } - + if ( simpleValue.getTypeName() != null && simpleValue.getTypeName().length() > 0 && simpleValue.getMetadata().getTypeResolver().basic( simpleValue.getTypeName() ) == null ) { try { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java index 1383767eaf..78ba00db08 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java @@ -2998,7 +2998,7 @@ private static void copyStringAttribute( /** * Copy a string attribute from an XML element to an annotation descriptor. The name of the annotation attribute is - * explicitely given. + * explicitly given. * * @param annotation annotation where to copy to the attribute. * @param element XML element from where to copy the attribute. diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java index f46279b485..8aef32bc9b 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java @@ -59,7 +59,7 @@ public XMLContext(BootstrapContext bootstrapContext) { /** * @param doc The xml document to add - * @return Add a xml document to this context and return the list of added class names. + * @return Add an xml document to this context and return the list of added class names. */ @SuppressWarnings( "unchecked" ) public List addDocument(Document doc) { @@ -108,7 +108,7 @@ public List addDocument(Document doc) { unitElement = root.element( "access" ); setAccess( unitElement, entityMappingDefault ); defaultElements.add( root ); - + setLocalAttributeConverterDefinitions( root.elements( "converter" ) ); List entities = root.elements( "entity" ); @@ -190,7 +190,7 @@ private List addEntityListenerClasses(Element element, String packageNam addedClasses.addAll( localAddedClasses ); return localAddedClasses; } - + @SuppressWarnings("unchecked") private void setLocalAttributeConverterDefinitions(List converterElements) { for ( Element converterElement : converterElements ) { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationEventListener.java b/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationEventListener.java index 80685b8d9f..c147e7486e 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/beanvalidation/BeanValidationEventListener.java @@ -57,7 +57,7 @@ public class BeanValidationEventListener * Constructor used in an environment where validator factory is injected (JPA2). * * @param factory The {@code ValidatorFactory} to use to create {@code Validator} instance(s) - * @param settings Configued properties + * @param settings Configured properties */ public BeanValidationEventListener(ValidatorFactory factory, Map settings, ClassLoaderService classLoaderService) { init( factory, settings, classLoaderService ); diff --git a/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentBag.java b/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentBag.java index b53c940b80..0cf408f7df 100644 --- a/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentBag.java +++ b/hibernate-core/src/main/java/org/hibernate/collection/internal/PersistentBag.java @@ -519,7 +519,7 @@ public Object getSnapshotElement(Object entry, int i) { * * @param o The object to check * - * @return The number of occurences. + * @return The number of occurrences. */ @SuppressWarnings("UnusedDeclaration") public int occurrences(Object o) { diff --git a/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java b/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java index c49cfc0e2e..40b6832e5c 100644 --- a/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java +++ b/hibernate-core/src/main/java/org/hibernate/context/internal/ThreadLocalSessionContext.java @@ -160,7 +160,7 @@ protected boolean isAutoCloseEnabled() { /** * Mainly for subclass usage. This impl always returns true. * - * @return Whether or not the the session should be flushed prior transaction completion. + * @return Whether or not the the session should be flushed prior to transaction completion. */ protected boolean isAutoFlushEnabled() { return true; diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/AbstractEmptinessExpression.java b/hibernate-core/src/main/java/org/hibernate/criterion/AbstractEmptinessExpression.java index e4ba252531..5401de8cbf 100644 --- a/hibernate-core/src/main/java/org/hibernate/criterion/AbstractEmptinessExpression.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/AbstractEmptinessExpression.java @@ -36,7 +36,7 @@ protected AbstractEmptinessExpression(String propertyName) { /** * Should empty rows be excluded? * - * @return {@code true} Indicates the expression should be 'exists'; {@code false} indicates 'not exists' + * @return {@code true} Indicates the expression should 'exists'; {@code false} indicates 'not exists' */ protected abstract boolean excludeEmpty(); diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/Criterion.java b/hibernate-core/src/main/java/org/hibernate/criterion/Criterion.java index b790a514ea..f5fc024ad0 100644 --- a/hibernate-core/src/main/java/org/hibernate/criterion/Criterion.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/Criterion.java @@ -13,10 +13,10 @@ import org.hibernate.engine.spi.TypedValue; /** - * An object-oriented representation of a query criterion that may be used + * An object-oriented representation of a query criterion that may be used * as a restriction in a Criteria query. - * Built-in criterion types are provided by the Restrictions factory - * class. This interface might be implemented by application classes that + * Built-in criterion types are provided by the Restrictions factory + * class. This interface might be implemented by application classes that * define custom restriction criteria. * * @see Restrictions @@ -29,18 +29,18 @@ public interface Criterion extends Serializable { * Render the SQL fragment * * @param criteria The local criteria - * @param criteriaQuery The overal criteria query + * @param criteriaQuery The overall criteria query * * @return The generated SQL fragment * @throws org.hibernate.HibernateException Problem during rendering. */ public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException; - + /** * Return typed values for all parameters in the rendered SQL fragment * * @param criteria The local criteria - * @param criteriaQuery The overal criteria query + * @param criteriaQuery The overall criteria query * * @return The types values (for binding) * @throws HibernateException Problem determining types. diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/EnhancedProjection.java b/hibernate-core/src/main/java/org/hibernate/criterion/EnhancedProjection.java index dca87b31f2..b0db10d698 100644 --- a/hibernate-core/src/main/java/org/hibernate/criterion/EnhancedProjection.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/EnhancedProjection.java @@ -21,7 +21,7 @@ public interface EnhancedProjection extends Projection { * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the * SELECT clause ({@link #toSqlString}. Hibernate always uses column aliases to extract data from the * JDBC {@link java.sql.ResultSet}, so it is important that these be implemented correctly in order for - * Hibernate to be able to extract these val;ues correctly. + * Hibernate to be able to extract these values correctly. * * @param position Just as in {@link #toSqlString}, represents the number of columns rendered * prior to this projection. diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/Example.java b/hibernate-core/src/main/java/org/hibernate/criterion/Example.java index 58a290e215..535e529d35 100644 --- a/hibernate-core/src/main/java/org/hibernate/criterion/Example.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/Example.java @@ -123,7 +123,7 @@ public Example ignoreCase() { /** * Set the property selector to use. * - * The property selector operates separate from excluding a property. + * The property selector operates separately from excluding a property. * * @param selector The selector to use * @@ -285,11 +285,11 @@ protected void addPropertyTypedValue(Object value, Type type, List l } protected void addComponentTypedValues( - String path, - Object component, + String path, + Object component, CompositeType type, List list, - Criteria criteria, + Criteria criteria, CriteriaQuery criteriaQuery) { if ( component != null ) { final String[] propertyNames = type.getPropertyNames(); @@ -418,7 +418,7 @@ public static interface PropertySelector extends Serializable { * @param propertyName The name of the property * @param type The type of the property * - * @return {@code true} indicates the property should be included; {@code false} indiates it should not. + * @return {@code true} indicates the property should be included; {@code false} indicates it should not. */ public boolean include(Object propertyValue, String propertyName, Type type); } diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/Projection.java b/hibernate-core/src/main/java/org/hibernate/criterion/Projection.java index e41c9584ea..ba05204482 100644 --- a/hibernate-core/src/main/java/org/hibernate/criterion/Projection.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/Projection.java @@ -81,7 +81,7 @@ public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQu * Get the SQL column aliases used by this projection for the columns it writes for inclusion into the * SELECT clause ({@link #toSqlString}. Hibernate always uses column aliases to extract data from the * JDBC {@link java.sql.ResultSet}, so it is important that these be implemented correctly in order for - * Hibernate to be able to extract these val;ues correctly. + * Hibernate to be able to extract these values correctly. * * @param position Just as in {@link #toSqlString}, represents the number of columns rendered * prior to this projection. diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java b/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java index 264f7f8a9d..548ed9e09b 100755 --- a/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java @@ -375,7 +375,7 @@ public static PropertyExpression geProperty(String propertyName, String otherPro } /** - * Return the conjuction of two expressions + * Return the conjunction of two expressions * * @param lhs One expression * @param rhs The other expression @@ -386,7 +386,7 @@ public static LogicalExpression and(Criterion lhs, Criterion rhs) { return new LogicalExpression(lhs, rhs, "and"); } /** - * Return the conjuction of multiple expressions + * Return the conjunction of multiple expressions * * @param predicates The predicates making up the initial junction * @@ -397,7 +397,7 @@ public static Conjunction and(Criterion... predicates) { } /** - * Return the disjuction of two expressions + * Return the disjunction of two expressions * * @param lhs One expression * @param rhs The other expression @@ -409,7 +409,7 @@ public static LogicalExpression or(Criterion lhs, Criterion rhs) { } /** - * Return the disjuction of multiple expressions + * Return the disjunction of multiple expressions * * @param predicates The predicates making up the initial junction * diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java index 652b7bb6ca..1ff25b5c34 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Cache71Dialect.java @@ -49,7 +49,7 @@ /** * Caché 2007.1 dialect. * - * This class is required in order to use Hibernate with Intersystems Caché SQL. Compatible with + * This class is required in order to use Hibernate with InterSystems Caché SQL. Compatible with * Caché 2007.1. * *

                PREREQUISITES

                diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index 996cbfce22..d0072caffb 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -1111,11 +1111,11 @@ public String getLimitString(String query, int offset, int limit) { } /** - * Apply s limit clause to the query. + * Apply a limit clause to the query. *

                * Typically dialects utilize {@link #supportsVariableLimit() variable} * limit clauses when they support limits. Thus, when building the - * select command we do not actually need to know the limit or the offest + * select command we do not actually need to know the limit or the offset * since we will just be using placeholders. *

                * Here we do still pass along whether or not an offset was specified @@ -1262,7 +1262,7 @@ public String getForUpdateString() { /** * Get the string to append to SELECT statements to acquire WRITE locks - * for this dialect. Location of the of the returned string is treated + * for this dialect. Location of the returned string is treated * the same as getForUpdateString. * * @param timeout in milliseconds, -1 for indefinite wait and 0 for no wait. @@ -1290,7 +1290,7 @@ public String getWriteLockString(String aliases, int timeout) { /** * Get the string to append to SELECT statements to acquire READ locks - * for this dialect. Location of the of the returned string is treated + * for this dialect. Location of the returned string is treated * the same as getForUpdateString. * * @param timeout in milliseconds, -1 for indefinite wait and 0 for no wait. @@ -1303,7 +1303,7 @@ public String getReadLockString(int timeout) { /** * Get the string to append to SELECT statements to acquire READ locks * for this dialect given the aliases of the columns to be read locked. - * Location of the of the returned string is treated + * Location of the returned string is treated * the same as getForUpdateString. * * @param aliases The columns to be read locked. @@ -1418,7 +1418,7 @@ public String getForUpdateSkipLockedString(String aliases) { /** * Some dialects support an alternative means to SELECT FOR UPDATE, - * whereby a "lock hint" is appends to the table name in the from clause. + * whereby a "lock hint" is appended to the table name in the from clause. *

                * contributed by Helge Schulz * @@ -1433,7 +1433,7 @@ public String appendLockHint(LockMode mode, String tableName) { } /** * Some dialects support an alternative means to SELECT FOR UPDATE, - * whereby a "lock hint" is appends to the table name in the from clause. + * whereby a "lock hint" is appended to the table name in the from clause. *

                * contributed by Helge Schulz * @@ -1701,7 +1701,7 @@ public SQLExceptionConverter buildSQLExceptionConverter() { *

                * It is strongly recommended that specific Dialect implementations override this * method, since interpretation of a SQL error is much more accurate when based on - * the a vendor-specific ErrorCode rather than the SQLState. + * the vendor-specific ErrorCode rather than the SQLState. *

                * Specific Dialects may override to return whatever is most appropriate for that vendor. * @@ -2454,7 +2454,7 @@ public boolean supportsParametersInInsertSelect() { /** * Does this dialect require that references to result variables - * (i.e, select expresssion aliases) in an ORDER BY clause be + * (i.e, select expression aliases) in an ORDER BY clause be * replaced by column positions (1-origin) as defined * by the select clause? diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java index 908fd7f7de..ccfe04af7c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Ingres9Dialect.java @@ -31,7 +31,7 @@ *

              • Added support for pooled sequences
              • *
              • Added support for SELECT queries with limit and offset
              • *
              • Added getIdentitySelectString
              • - *
              • Modified concatination operator
              • + *
              • Modified concatenation operator
              • *
              * * @author Enrico Schenk diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java index 33affffe4b..9bc7973e9b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java @@ -42,7 +42,7 @@ * Perform string casts to varchar; removes space padding. *
            • *
            - * + * * @author Ian Booth * @author Bruce Lunsford * @author Max Rydahl Andersen diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MimerSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MimerSQLDialect.java index d404309825..073ca5cc75 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MimerSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MimerSQLDialect.java @@ -29,8 +29,8 @@ public class MimerSQLDialect extends Dialect { private static final int BINARY_MAX_LENGTH = 2000; /** - * Even thoug Mimer SQL supports character and binary columns up to 15 000 in lenght, - * this is also the maximum width of the table (exluding LOBs). To avoid breaking the limit all the + * Even though Mimer SQL supports character and binary columns up to 15 000 in length, + * this is also the maximum width of the table (excluding LOBs). To avoid breaking the limit all the * time we limit the length of the character columns to CHAR_MAX_LENTH, NATIONAL_CHAR_LENGTH for national * characters, and BINARY_MAX_LENGTH for binary types. */ diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java index dc384cb4f2..db487581d4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle10gDialect.java @@ -24,7 +24,7 @@ */ public class Oracle10gDialect extends Oracle9iDialect { /** - * Constructs a Oracle10gDialect + * Constructs an Oracle10gDialect */ public Oracle10gDialect() { super(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java index b6580d5feb..5f0c25bac2 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle8iDialect.java @@ -120,7 +120,7 @@ public boolean useMaxForLimit() { private static final int PARAM_LIST_SIZE_LIMIT = 1000; /** - * Constructs a Oracle8iDialect + * Constructs an Oracle8iDialect */ public Oracle8iDialect() { super(); @@ -340,7 +340,7 @@ public String getLimitString(String sql, boolean hasOffset) { * implementation... * * @param sqlType The {@link java.sql.Types} mapping type code - * @return The appropriate select cluse fragment + * @return The appropriate select clause fragment */ public String getBasicSelectClauseNullString(int sqlType) { return super.getSelectClauseNullString( sqlType ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java index 1fe9a24a41..996fee000d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Oracle9Dialect.java @@ -51,7 +51,7 @@ public class Oracle9Dialect extends Dialect { ); /** - * Constructs a Oracle9Dialect + * Constructs an Oracle9Dialect */ public Oracle9Dialect() { super(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java index a7b28147d0..f0a010d88b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java @@ -160,7 +160,7 @@ public PostgreSQL81Dialect() { registerFunction( "user", new NoArgSQLFunction("user", StandardBasicTypes.STRING, false) ); registerFunction( "current_database", new NoArgSQLFunction("current_database", StandardBasicTypes.STRING, true) ); registerFunction( "current_schema", new NoArgSQLFunction("current_schema", StandardBasicTypes.STRING, true) ); - + registerFunction( "to_char", new StandardSQLFunction("to_char", StandardBasicTypes.STRING) ); registerFunction( "to_date", new StandardSQLFunction("to_date", StandardBasicTypes.DATE) ); registerFunction( "to_timestamp", new StandardSQLFunction("to_timestamp", StandardBasicTypes.TIMESTAMP) ); @@ -417,7 +417,7 @@ public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter() { /** * Constraint-name extractor for Postgres constraint violation exceptions. - * Orginally contributed by Denny Bartelt. + * Originally contributed by Denny Bartelt. */ private static final ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() { @Override @@ -439,7 +439,7 @@ protected String doExtractConstraintName(SQLException sqle) throws NumberFormatE } } }; - + @Override public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate() { return new SQLExceptionConversionDelegate() { @@ -518,7 +518,7 @@ else if ( initialValue > 0 && incrementSize < 0 ) { ); } } - + // Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @Override @@ -590,12 +590,12 @@ public String getReadLockString(String aliases, int timeout) { public boolean supportsRowValueConstructorSyntax() { return true; } - + @Override public String getForUpdateNowaitString() { return getForUpdateString() + " nowait "; } - + @Override public String getForUpdateNowaitString(String aliases) { return getForUpdateString( aliases ) + " nowait "; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java index cba477cc57..e389197d5e 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java @@ -224,7 +224,7 @@ public RDMSOS2200Dialect() { * The TIMESTAMP literal format is: YYYY-MM-DD HH:MM:SS[.[FFFFFF]] * * Note that $l (dollar-L) will use the length value if provided. - * Also new for Hibernate3 is the $p percision and $s (scale) parameters + * Also new for Hibernate3 is the $p precision and $s (scale) parameters */ registerColumnType( Types.BIT, "SMALLINT" ); registerColumnType( Types.TINYINT, "SMALLINT" ); @@ -256,7 +256,7 @@ public RDMSOS2200Dialect() { // Dialect method overrides ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** - * RDMS does not support qualifing index names with the schema name. + * RDMS does not support qualifying index names with the schema name. *

            * {@inheritDoc} */ diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/ResultColumnReferenceStrategy.java b/hibernate-core/src/main/java/org/hibernate/dialect/ResultColumnReferenceStrategy.java index 6f664df0ac..519a1d8a9c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/ResultColumnReferenceStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/ResultColumnReferenceStrategy.java @@ -1,59 +1,59 @@ -/* - * 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 . - */ -package org.hibernate.dialect; - -/** - * Defines how we need to reference columns in the group-by, having, and order-by - * clauses. - * - * @author Steve Ebersole - */ -public enum ResultColumnReferenceStrategy { - /** - * This strategy says to reference the result columns by the qualified column name - * found in the result source. This strategy is not strictly allowed by ANSI SQL - * but is Hibernate's legacy behavior and is also the fastest of the strategies; thus - * it should be used if supported by the underlying database. - */ - SOURCE, - /** - * For databases which do not support {@link #SOURCE}, ANSI SQL defines two allowable - * approaches. One is to reference the result column by the alias it is given in the - * result source (if it is given an alias). This strategy says to use this approach. - *

            - * The other QNSI SQL compliant approach is {@link #ORDINAL}. - */ - ALIAS, - /** - * For databases which do not support {@link #SOURCE}, ANSI SQL defines two allowable - * approaches. One is to reference the result column by the ordinal position at which - * it appears in the result source. This strategy says to use this approach. - *

            - * The other QNSI SQL compliant approach is {@link #ALIAS}. - */ - ORDINAL; - - /** - * Resolves the strategy by name, in a case insensitive manner. If the name cannot be resolved, {@link #SOURCE} - * is returned as the default. - * - * @param name The strategy name to resolve - * - * @return The resolved strategy - */ - public static ResultColumnReferenceStrategy resolveByName(String name) { - if ( ALIAS.name().equalsIgnoreCase( name ) ) { - return ALIAS; - } - else if ( ORDINAL.name().equalsIgnoreCase( name ) ) { - return ORDINAL; - } - else { - return SOURCE; - } - } -} +/* + * 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 . + */ +package org.hibernate.dialect; + +/** + * Defines how we need to reference columns in the group-by, having, and order-by + * clauses. + * + * @author Steve Ebersole + */ +public enum ResultColumnReferenceStrategy { + /** + * This strategy says to reference the result columns by the qualified column name + * found in the result source. This strategy is not strictly allowed by ANSI SQL + * but is Hibernate's legacy behavior and is also the fastest of the strategies; thus + * it should be used if supported by the underlying database. + */ + SOURCE, + /** + * For databases which do not support {@link #SOURCE}, ANSI SQL defines two allowable + * approaches. One is to reference the result column by the alias it is given in the + * result source (if it is given an alias). This strategy says to use this approach. + *

            + * The other ANSI SQL compliant approach is {@link #ORDINAL}. + */ + ALIAS, + /** + * For databases which do not support {@link #SOURCE}, ANSI SQL defines two allowable + * approaches. One is to reference the result column by the ordinal position at which + * it appears in the result source. This strategy says to use this approach. + *

            + * The other ANSI SQL compliant approach is {@link #ALIAS}. + */ + ORDINAL; + + /** + * Resolves the strategy by name, in a case insensitive manner. If the name cannot be resolved, {@link #SOURCE} + * is returned as the default. + * + * @param name The strategy name to resolve + * + * @return The resolved strategy + */ + public static ResultColumnReferenceStrategy resolveByName(String name) { + if ( ALIAS.name().equalsIgnoreCase( name ) ) { + return ALIAS; + } + else if ( ORDINAL.name().equalsIgnoreCase( name ) ) { + return ORDINAL; + } + else { + return SOURCE; + } + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java index e27281c217..8b485350fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java @@ -1,273 +1,273 @@ -/* - * 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 . - */ -package org.hibernate.dialect; -import java.sql.Types; - -import org.hibernate.HibernateException; -import org.hibernate.cfg.Environment; -import org.hibernate.dialect.function.SQLFunctionTemplate; -import org.hibernate.dialect.function.VarArgsSQLFunction; -import org.hibernate.hql.spi.id.IdTableSupport; -import org.hibernate.hql.spi.id.IdTableSupportStandardImpl; -import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy; -import org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy; -import org.hibernate.hql.spi.id.local.AfterUseAction; -import org.hibernate.type.StandardBasicTypes; - -/** - * A dialect for the Teradata database created by MCR as part of the - * dialect certification process. - * - * @author Jay Nance - */ -public class TeradataDialect extends Dialect implements IdTableSupport { - - private static final int PARAM_LIST_SIZE_LIMIT = 1024; - - /** - * Constructor - */ - public TeradataDialect() { - super(); - //registerColumnType data types - registerColumnType( Types.NUMERIC, "NUMERIC($p,$s)" ); - registerColumnType( Types.DOUBLE, "DOUBLE PRECISION" ); - registerColumnType( Types.BIGINT, "NUMERIC(18,0)" ); - registerColumnType( Types.BIT, "BYTEINT" ); - registerColumnType( Types.TINYINT, "BYTEINT" ); - registerColumnType( Types.VARBINARY, "VARBYTE($l)" ); - registerColumnType( Types.BINARY, "BYTEINT" ); - registerColumnType( Types.LONGVARCHAR, "LONG VARCHAR" ); - registerColumnType( Types.CHAR, "CHAR(1)" ); - registerColumnType( Types.DECIMAL, "DECIMAL" ); - registerColumnType( Types.INTEGER, "INTEGER" ); - registerColumnType( Types.SMALLINT, "SMALLINT" ); - registerColumnType( Types.FLOAT, "FLOAT" ); - registerColumnType( Types.VARCHAR, "VARCHAR($l)" ); - registerColumnType( Types.DATE, "DATE" ); - registerColumnType( Types.TIME, "TIME" ); - registerColumnType( Types.TIMESTAMP, "TIMESTAMP" ); - registerColumnType( Types.BOOLEAN, "BYTEINT" ); // hibernate seems to ignore this type... - registerColumnType( Types.BLOB, "BLOB" ); - registerColumnType( Types.CLOB, "CLOB" ); - - registerFunction( "year", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "extract(year from ?1)" ) ); - registerFunction( "length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "character_length(?1)" ) ); - registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) ); - registerFunction( "substring", new SQLFunctionTemplate( StandardBasicTypes.STRING, "substring(?1 from ?2 for ?3)" ) ); - registerFunction( "locate", new SQLFunctionTemplate( StandardBasicTypes.STRING, "position(?1 in ?2)" ) ); - registerFunction( "mod", new SQLFunctionTemplate( StandardBasicTypes.STRING, "?1 mod ?2" ) ); - registerFunction( "str", new SQLFunctionTemplate( StandardBasicTypes.STRING, "cast(?1 as varchar(255))" ) ); - - // bit_length feels a bit broken to me. We have to cast to char in order to - // pass when a numeric value is supplied. But of course the answers given will - // be wildly different for these two datatypes. 1234.5678 will be 9 bytes as - // a char string but will be 8 or 16 bytes as a true numeric. - // Jay Nance 2006-09-22 - registerFunction( - "bit_length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "octet_length(cast(?1 as char))*4" ) - ); - - // The preference here would be - // SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_timestamp(?1)", false) - // but this appears not to work. - // Jay Nance 2006-09-22 - registerFunction( "current_timestamp", new SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_timestamp" ) ); - registerFunction( "current_time", new SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_time" ) ); - registerFunction( "current_date", new SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_date" ) ); - // IBID for current_time and current_date - - registerKeyword( "password" ); - registerKeyword( "type" ); - registerKeyword( "title" ); - registerKeyword( "year" ); - registerKeyword( "month" ); - registerKeyword( "summary" ); - registerKeyword( "alias" ); - registerKeyword( "value" ); - registerKeyword( "first" ); - registerKeyword( "role" ); - registerKeyword( "account" ); - registerKeyword( "class" ); - - // Tell hibernate to use getBytes instead of getBinaryStream - getDefaultProperties().setProperty( Environment.USE_STREAMS_FOR_BINARY, "false" ); - // No batch statements - getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH ); - } - - /** - * Does this dialect support the FOR UPDATE syntax? - * - * @return empty string ... Teradata does not support FOR UPDATE syntax - */ - @Override - public String getForUpdateString() { - return ""; - } - - @Override - public boolean supportsSequences() { - return false; - } - - @Override - public String getAddColumnString() { - return "Add Column"; - } - - @Override - public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() { - return new GlobalTemporaryTableBulkIdStrategy( this, AfterUseAction.CLEAN ); - } - - @Override - public String generateIdTableName(String baseName) { - return IdTableSupportStandardImpl.INSTANCE.generateIdTableName( baseName ); - } - - @Override - public String getCreateIdTableCommand() { - return "create global temporary table"; - } - - @Override - public String getCreateIdTableStatementOptions() { - return " on commit preserve rows"; - } - - @Override - public String getDropIdTableCommand() { - return "drop table"; - } - - @Override - public String getTruncateIdTableCommand() { - return "delete from"; - } - - /** - * Get the name of the database type associated with the given - * java.sql.Types typecode. - * - * @param code java.sql.Types typecode - * @param length the length or precision of the column - * @param precision the precision of the column - * @param scale the scale of the column - * - * @return the database type name - * - * @throws HibernateException - */ - public String getTypeName(int code, int length, int precision, int scale) throws HibernateException { - /* - * We might want a special case for 19,2. This is very common for money types - * and here it is converted to 18,1 - */ - float f = precision > 0 ? ( float ) scale / ( float ) precision : 0; - int p = ( precision > 18 ? 18 : precision ); - int s = ( precision > 18 ? ( int ) ( 18.0 * f ) : ( scale > 18 ? 18 : scale ) ); - - return super.getTypeName( code, length, p, s ); - } - - @Override - public boolean supportsCascadeDelete() { - return false; - } - - @Override - public boolean supportsCircularCascadeDeleteConstraints() { - return false; - } - - @Override - public boolean areStringComparisonsCaseInsensitive() { - return true; - } - - @Override - public boolean supportsEmptyInList() { - return false; - } - - @Override - public String getSelectClauseNullString(int sqlType) { - String v = "null"; - - switch ( sqlType ) { - case Types.BIT: - case Types.TINYINT: - case Types.SMALLINT: - case Types.INTEGER: - case Types.BIGINT: - case Types.FLOAT: - case Types.REAL: - case Types.DOUBLE: - case Types.NUMERIC: - case Types.DECIMAL: - v = "cast(null as decimal)"; - break; - case Types.CHAR: - case Types.VARCHAR: - case Types.LONGVARCHAR: - v = "cast(null as varchar(255))"; - break; - case Types.DATE: - case Types.TIME: - case Types.TIMESTAMP: - v = "cast(null as timestamp)"; - break; - case Types.BINARY: - case Types.VARBINARY: - case Types.LONGVARBINARY: - case Types.NULL: - case Types.OTHER: - case Types.JAVA_OBJECT: - case Types.DISTINCT: - case Types.STRUCT: - case Types.ARRAY: - case Types.BLOB: - case Types.CLOB: - case Types.REF: - case Types.DATALINK: - case Types.BOOLEAN: - break; - } - return v; - } - - @Override - public String getCreateMultisetTableString() { - return "create multiset table "; - } - - @Override - public boolean supportsLobValueChangePropogation() { - return false; - } - - @Override - public boolean doesReadCommittedCauseWritersToBlockReaders() { - return true; - } - - @Override - public boolean doesRepeatableReadCauseReadersToBlockWriters() { - return true; - } - - @Override - public boolean supportsBindAsCallableArgument() { - return false; - } - - @Override - public int getInExpressionCountLimit() { - return PARAM_LIST_SIZE_LIMIT; - } -} +/* + * 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 . + */ +package org.hibernate.dialect; +import java.sql.Types; + +import org.hibernate.HibernateException; +import org.hibernate.cfg.Environment; +import org.hibernate.dialect.function.SQLFunctionTemplate; +import org.hibernate.dialect.function.VarArgsSQLFunction; +import org.hibernate.hql.spi.id.IdTableSupport; +import org.hibernate.hql.spi.id.IdTableSupportStandardImpl; +import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy; +import org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy; +import org.hibernate.hql.spi.id.local.AfterUseAction; +import org.hibernate.type.StandardBasicTypes; + +/** + * A dialect for the Teradata database created by MCR as part of the + * dialect certification process. + * + * @author Jay Nance + */ +public class TeradataDialect extends Dialect implements IdTableSupport { + + private static final int PARAM_LIST_SIZE_LIMIT = 1024; + + /** + * Constructor + */ + public TeradataDialect() { + super(); + //registerColumnType data types + registerColumnType( Types.NUMERIC, "NUMERIC($p,$s)" ); + registerColumnType( Types.DOUBLE, "DOUBLE PRECISION" ); + registerColumnType( Types.BIGINT, "NUMERIC(18,0)" ); + registerColumnType( Types.BIT, "BYTEINT" ); + registerColumnType( Types.TINYINT, "BYTEINT" ); + registerColumnType( Types.VARBINARY, "VARBYTE($l)" ); + registerColumnType( Types.BINARY, "BYTEINT" ); + registerColumnType( Types.LONGVARCHAR, "LONG VARCHAR" ); + registerColumnType( Types.CHAR, "CHAR(1)" ); + registerColumnType( Types.DECIMAL, "DECIMAL" ); + registerColumnType( Types.INTEGER, "INTEGER" ); + registerColumnType( Types.SMALLINT, "SMALLINT" ); + registerColumnType( Types.FLOAT, "FLOAT" ); + registerColumnType( Types.VARCHAR, "VARCHAR($l)" ); + registerColumnType( Types.DATE, "DATE" ); + registerColumnType( Types.TIME, "TIME" ); + registerColumnType( Types.TIMESTAMP, "TIMESTAMP" ); + registerColumnType( Types.BOOLEAN, "BYTEINT" ); // hibernate seems to ignore this type... + registerColumnType( Types.BLOB, "BLOB" ); + registerColumnType( Types.CLOB, "CLOB" ); + + registerFunction( "year", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "extract(year from ?1)" ) ); + registerFunction( "length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "character_length(?1)" ) ); + registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) ); + registerFunction( "substring", new SQLFunctionTemplate( StandardBasicTypes.STRING, "substring(?1 from ?2 for ?3)" ) ); + registerFunction( "locate", new SQLFunctionTemplate( StandardBasicTypes.STRING, "position(?1 in ?2)" ) ); + registerFunction( "mod", new SQLFunctionTemplate( StandardBasicTypes.STRING, "?1 mod ?2" ) ); + registerFunction( "str", new SQLFunctionTemplate( StandardBasicTypes.STRING, "cast(?1 as varchar(255))" ) ); + + // bit_length feels a bit broken to me. We have to cast to char in order to + // pass when a numeric value is supplied. But of course the answers given will + // be wildly different for these two data types. 1234.5678 will be 9 bytes as + // a char string but will be 8 or 16 bytes as a true numeric. + // Jay Nance 2006-09-22 + registerFunction( + "bit_length", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "octet_length(cast(?1 as char))*4" ) + ); + + // The preference here would be + // SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_timestamp(?1)", false) + // but this appears not to work. + // Jay Nance 2006-09-22 + registerFunction( "current_timestamp", new SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_timestamp" ) ); + registerFunction( "current_time", new SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_time" ) ); + registerFunction( "current_date", new SQLFunctionTemplate( StandardBasicTypes.TIMESTAMP, "current_date" ) ); + // IBID for current_time and current_date + + registerKeyword( "password" ); + registerKeyword( "type" ); + registerKeyword( "title" ); + registerKeyword( "year" ); + registerKeyword( "month" ); + registerKeyword( "summary" ); + registerKeyword( "alias" ); + registerKeyword( "value" ); + registerKeyword( "first" ); + registerKeyword( "role" ); + registerKeyword( "account" ); + registerKeyword( "class" ); + + // Tell hibernate to use getBytes instead of getBinaryStream + getDefaultProperties().setProperty( Environment.USE_STREAMS_FOR_BINARY, "false" ); + // No batch statements + getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH ); + } + + /** + * Does this dialect support the FOR UPDATE syntax? + * + * @return empty string ... Teradata does not support FOR UPDATE syntax + */ + @Override + public String getForUpdateString() { + return ""; + } + + @Override + public boolean supportsSequences() { + return false; + } + + @Override + public String getAddColumnString() { + return "Add Column"; + } + + @Override + public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() { + return new GlobalTemporaryTableBulkIdStrategy( this, AfterUseAction.CLEAN ); + } + + @Override + public String generateIdTableName(String baseName) { + return IdTableSupportStandardImpl.INSTANCE.generateIdTableName( baseName ); + } + + @Override + public String getCreateIdTableCommand() { + return "create global temporary table"; + } + + @Override + public String getCreateIdTableStatementOptions() { + return " on commit preserve rows"; + } + + @Override + public String getDropIdTableCommand() { + return "drop table"; + } + + @Override + public String getTruncateIdTableCommand() { + return "delete from"; + } + + /** + * Get the name of the database type associated with the given + * java.sql.Types typecode. + * + * @param code java.sql.Types typecode + * @param length the length or precision of the column + * @param precision the precision of the column + * @param scale the scale of the column + * + * @return the database type name + * + * @throws HibernateException + */ + public String getTypeName(int code, int length, int precision, int scale) throws HibernateException { + /* + * We might want a special case for 19,2. This is very common for money types + * and here it is converted to 18,1 + */ + float f = precision > 0 ? ( float ) scale / ( float ) precision : 0; + int p = ( precision > 18 ? 18 : precision ); + int s = ( precision > 18 ? ( int ) ( 18.0 * f ) : ( scale > 18 ? 18 : scale ) ); + + return super.getTypeName( code, length, p, s ); + } + + @Override + public boolean supportsCascadeDelete() { + return false; + } + + @Override + public boolean supportsCircularCascadeDeleteConstraints() { + return false; + } + + @Override + public boolean areStringComparisonsCaseInsensitive() { + return true; + } + + @Override + public boolean supportsEmptyInList() { + return false; + } + + @Override + public String getSelectClauseNullString(int sqlType) { + String v = "null"; + + switch ( sqlType ) { + case Types.BIT: + case Types.TINYINT: + case Types.SMALLINT: + case Types.INTEGER: + case Types.BIGINT: + case Types.FLOAT: + case Types.REAL: + case Types.DOUBLE: + case Types.NUMERIC: + case Types.DECIMAL: + v = "cast(null as decimal)"; + break; + case Types.CHAR: + case Types.VARCHAR: + case Types.LONGVARCHAR: + v = "cast(null as varchar(255))"; + break; + case Types.DATE: + case Types.TIME: + case Types.TIMESTAMP: + v = "cast(null as timestamp)"; + break; + case Types.BINARY: + case Types.VARBINARY: + case Types.LONGVARBINARY: + case Types.NULL: + case Types.OTHER: + case Types.JAVA_OBJECT: + case Types.DISTINCT: + case Types.STRUCT: + case Types.ARRAY: + case Types.BLOB: + case Types.CLOB: + case Types.REF: + case Types.DATALINK: + case Types.BOOLEAN: + break; + } + return v; + } + + @Override + public String getCreateMultisetTableString() { + return "create multiset table "; + } + + @Override + public boolean supportsLobValueChangePropogation() { + return false; + } + + @Override + public boolean doesReadCommittedCauseWritersToBlockReaders() { + return true; + } + + @Override + public boolean doesRepeatableReadCauseReadersToBlockWriters() { + return true; + } + + @Override + public boolean supportsBindAsCallableArgument() { + return false; + } + + @Override + public int getInExpressionCountLimit() { + return PARAM_LIST_SIZE_LIMIT; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/AbstractAnsiTrimEmulationFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/AbstractAnsiTrimEmulationFunction.java index 8d31c0f7f2..d08d897a72 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/AbstractAnsiTrimEmulationFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/AbstractAnsiTrimEmulationFunction.java @@ -102,7 +102,7 @@ else if ( "both".equalsIgnoreCase( firstArg ) ) { } final String potentialTrimCharacter = (String) args.get( potentialTrimCharacterArgIndex ); - if ( "from".equalsIgnoreCase( potentialTrimCharacter ) ) { + if ( "from".equalsIgnoreCase( potentialTrimCharacter ) ) { trimCharacter = "' '"; trimSource = (String) args.get( potentialTrimCharacterArgIndex + 1 ); } @@ -152,7 +152,7 @@ else if ( leading ) { /** * Resolve the function definition which should be used to trim both leading and trailing spaces. *

            - * In this form, the imput arguments is missing the FROM keyword. + * In this form, the input arguments is missing the FROM keyword. * * @return The sql function */ @@ -163,7 +163,7 @@ else if ( leading ) { *

            * The same as {#link resolveBothSpaceTrimFunction} except that here theFROM is included and * will need to be accounted for during {@link SQLFunction#render} processing. - * + * * @return The sql function */ protected abstract SQLFunction resolveBothSpaceTrimFromFunction(); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/AvgWithArgumentCastFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/AvgWithArgumentCastFunction.java index a503da3710..81c56d1493 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/AvgWithArgumentCastFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/AvgWithArgumentCastFunction.java @@ -9,7 +9,7 @@ import java.sql.Types; /** - * Some databases strictly return the type of the of the aggregation value for AVG which is + * Some databases strictly return the type of the aggregation value for AVG which is * problematic in the case of averaging integers because the decimals will be dropped. The usual workaround * is to cast the integer argument as some form of double/decimal. * diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/ConvertFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/ConvertFunction.java index a157061a39..212f3c5f70 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/ConvertFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/ConvertFunction.java @@ -14,7 +14,7 @@ import org.hibernate.type.Type; /** - * A Caché defintion of a convert function. + * A Caché definition of a convert function. * * @author Jonathan Levinson */ diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/lock/SelectLockingStrategy.java b/hibernate-core/src/main/java/org/hibernate/dialect/lock/SelectLockingStrategy.java index 52f7c8e48e..f448c485ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/lock/SelectLockingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/lock/SelectLockingStrategy.java @@ -40,7 +40,7 @@ public class SelectLockingStrategy extends AbstractSelectLockingStrategy { * Construct a locking strategy based on SQL SELECT statements. * * @param lockable The metadata for the entity to be locked. - * @param lockMode Indictates the type of lock to be acquired. + * @param lockMode Indicates the type of lock to be acquired. */ public SelectLockingStrategy(Lockable lockable, LockMode lockMode) { super( lockable, lockMode ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/lock/UpdateLockingStrategy.java b/hibernate-core/src/main/java/org/hibernate/dialect/lock/UpdateLockingStrategy.java index 40fe3c2632..1d4d659d46 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/lock/UpdateLockingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/lock/UpdateLockingStrategy.java @@ -49,7 +49,7 @@ public class UpdateLockingStrategy implements LockingStrategy { * Construct a locking strategy based on SQL UPDATE statements. * * @param lockable The metadata for the entity to be locked. - * @param lockMode Indictates the type of lock to be acquired. Note that + * @param lockMode Indicates the type of lock to be acquired. Note that * read-locks are not valid for this strategy. */ public UpdateLockingStrategy(Lockable lockable, LockMode lockMode) { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/pagination/SQLServer2005LimitHandler.java b/hibernate-core/src/main/java/org/hibernate/dialect/pagination/SQLServer2005LimitHandler.java index 34b8b4724b..daed5489f0 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/pagination/SQLServer2005LimitHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/pagination/SQLServer2005LimitHandler.java @@ -395,7 +395,7 @@ private static Pattern buildShallowIndexPattern(String pattern, boolean wordBoun } /** - * Geneartes a list of {@code IgnoreRange} objects that represent nested sections of the + * Generates a list of {@code IgnoreRange} objects that represent nested sections of the * provided SQL buffer that should be ignored when performing regular expression matches. * * @param sql The SQL buffer. diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/ImmutableEntityEntry.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/ImmutableEntityEntry.java index d32c113824..b15ffb58fa 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/ImmutableEntityEntry.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/ImmutableEntityEntry.java @@ -22,7 +22,7 @@ /** * An EntityEntry implementation for immutable entities. Note that this implementation is not completely - * immutable in terms of its internal state; the term immutable here refers to the entity is describes. + * immutable in terms of its internal state; the term immutable here refers to the entity it describes. * * @author Gavin King * @author Emmanuel Bernard diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java index 83c6d1cbdd..e7d42cb68d 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/JoinSequence.java @@ -156,9 +156,9 @@ public JoinSequence addJoin( } /** - * Embedds an implied from element into this sequence + * Embeds an implied from element into this sequence * - * @param fromElement The implied from element to embedd + * @param fromElement The implied from element to embed * @return The Join memento */ public JoinSequence addJoin(ImpliedFromElement fromElement) { diff --git a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java index 651e339108..36a3afb747 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/DatasourceConnectionProviderImpl.java @@ -25,8 +25,8 @@ *

            * The {@link DataSource} to use may be specified by either:

              *
            • injection via {@link #setDataSource}
            • - *
            • decaring the {@link DataSource} instance using the {@link Environment#DATASOURCE} config property
            • - *
            • decaring the JNDI name under which the {@link DataSource} can be found via {@link Environment#DATASOURCE} config property
            • + *
            • declaring the {@link DataSource} instance using the {@link Environment#DATASOURCE} config property
            • + *
            • declaring the JNDI name under which the {@link DataSource} can be found via {@link Environment#DATASOURCE} config property
            • *
            * * @author Gavin King diff --git a/hibernate-core/src/main/java/org/hibernate/engine/profile/Association.java b/hibernate-core/src/main/java/org/hibernate/engine/profile/Association.java index 5daea67541..00133c385b 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/profile/Association.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/profile/Association.java @@ -18,7 +18,7 @@ public class Association { private final String role; /** - * Constructs a association defining what is to be fetched. + * Constructs an association defining what is to be fetched. * * @param owner The entity owning the association * @param associationPath The path of the association, from the entity diff --git a/hibernate-core/src/main/java/org/hibernate/engine/profile/Fetch.java b/hibernate-core/src/main/java/org/hibernate/engine/profile/Fetch.java index e766393cff..b32a214371 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/profile/Fetch.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/profile/Fetch.java @@ -37,7 +37,7 @@ public Style getStyle() { /** * The type or style of fetch. For the moment we limit this to * join and select, though technically subselect would be valid - * here as as well; however, to support subselect here would + * here as well; however, to support subselect here would * require major changes to the subselect loading code (which is * needed for other things as well anyway). */ diff --git a/hibernate-core/src/main/java/org/hibernate/engine/query/spi/HQLQueryPlan.java b/hibernate-core/src/main/java/org/hibernate/engine/query/spi/HQLQueryPlan.java index 1ba9dbe6e0..cb152b16fb 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/query/spi/HQLQueryPlan.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/query/spi/HQLQueryPlan.java @@ -263,7 +263,7 @@ public List performList( /** * If we're able to guess a likely size of the results we can optimize allocation - * of our datastructures. + * of our data structures. * Essentially if we detect the user is not using pagination, we attempt to use the FetchSize * as a reasonable hint. If fetch size is not being set either, it is reasonable to expect * that we're going to have a single hit. In such a case it would be tempting to return a constant diff --git a/hibernate-core/src/main/java/org/hibernate/engine/query/spi/ParameterParser.java b/hibernate-core/src/main/java/org/hibernate/engine/query/spi/ParameterParser.java index 45f628c495..4c21743fd3 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/query/spi/ParameterParser.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/query/spi/ParameterParser.java @@ -54,7 +54,7 @@ public interface Recognizer { void jpaPositionalParameter(int identifier, int position); /** - * Called when a character that is not a parameter (or part of a parameter dfinition) is recognized. + * Called when a character that is not a parameter (or part of a parameter definition) is recognized. * * @param character The recognized character */ diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java index 435a6aa952..287afe8ce5 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/ActionQueue.java @@ -502,7 +502,7 @@ private void prepareActions(ExecutableList queue) throws HibernateException { } /** - * Performs cleanup of any held cache softlocks. + * Performs cleanup of any held cache soft locks. * * @param success Was the transaction successful. */ diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java index cbc596796e..57d3567743 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/BatchFetchQueue.java @@ -52,7 +52,7 @@ public class BatchFetchQueue { * type at a time. */ private Map > batchLoadableEntityKeys; - + /** * Used to hold information about the collections that are currently eligible for batch-fetching. Ultimately * used by {@link #getCollectionBatch} to build collection load batches. @@ -97,7 +97,7 @@ public SubselectFetch getSubselect(EntityKey key) { } /** - * Adds a subselect fetch decriptor for the given entity key. + * Adds a subselect fetch descriptor for the given entity key. * * @param key The entity for which to register the subselect fetch. * @param subquery The fetch descriptor. @@ -146,7 +146,7 @@ public void addBatchLoadableEntityKey(EntityKey key) { keysForEntity.add( key ); } } - + /** * After evicting or deleting or loading an entity, we don't @@ -244,7 +244,7 @@ private boolean isCached(EntityKey entityKey, EntityPersister persister) { } return false; } - + // collection batch support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -311,7 +311,7 @@ public Serializable[] getCollectionBatch( for ( Entry me : map.entrySet() ) { final CollectionEntry ce = me.getKey(); final PersistentCollection collection = me.getValue(); - + if ( ce.getLoadedKey() == null ) { // the loadedKey of the collectionEntry might be null as it might have been reset to null // (see for example Collections.processDereferencedCollection() diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingAction.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingAction.java index 6cfc94efb1..b78fcbfde2 100755 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingAction.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingAction.java @@ -25,7 +25,7 @@ public interface CascadingAction { /** * Cascade the action to the child object. * - * @param session The session within which the cascade is occuring. + * @param session The session within which the cascade is occurring. * @param child The child to which cascading should be performed. * @param entityName The child's entity name * @param anything Anything ;) Typically some form of cascade-local cache @@ -44,7 +44,7 @@ void cascade( * Given a collection, get an iterator of the children upon which the * current cascading action should be visited. * - * @param session The session within which the cascade is occuring. + * @param session The session within which the cascade is occurring. * @param collectionType The mapping type of the collection. * @param collection The collection instance. * @return The children iterator. @@ -73,7 +73,7 @@ Iterator getCascadableChildrenIterator( * Called (in the case of {@link #requiresNoCascadeChecking} returning true) to validate * that no cascade on the given property is considered a valid semantic. * - * @param session The session witin which the cascade is occurring. + * @param session The session within which the cascade is occurring. * @param parent The property value owner * @param persister The entity persister for the owner * @param propertyType The property type diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingActions.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingActions.java index eef7e7b8cc..586bf1699a 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingActions.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadingActions.java @@ -464,7 +464,7 @@ public boolean performOnLazyProperty() { * Given a collection, get an iterator of all its children, loading them * from the database if necessary. * - * @param session The session within which the cascade is occuring. + * @param session The session within which the cascade is occurring. * @param collectionType The mapping type of the collection. * @param collection The collection instance. * diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/ExceptionConverter.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/ExceptionConverter.java index d84fb442ab..586693bc82 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/ExceptionConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/ExceptionConverter.java @@ -26,11 +26,11 @@ public interface ExceptionConverter { RuntimeException convertCommitException(RuntimeException e); /** - * Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA sepcification makes use + * Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA specification makes use * of exceptions outside its exception hierarchy, though they are all runtime exceptions. *

            * - * @param e The Hibernate excepton. + * @param e The Hibernate exception. * @param lockOptions The lock options in effect at the time of exception (can be null) * * @return The JPA-specified exception @@ -38,11 +38,11 @@ public interface ExceptionConverter { RuntimeException convert(HibernateException e, LockOptions lockOptions); /** - * Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA sepcification makes use + * Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA specification makes use * of exceptions outside its exception hierarchy, though they are all runtime exceptions. *

            * - * @param e The Hibernate excepton. + * @param e The Hibernate exception. * * @return The JPA-specified exception */ diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedQueryDefinition.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedQueryDefinition.java index 3dc6f41a39..346412ab09 100755 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedQueryDefinition.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedQueryDefinition.java @@ -14,7 +14,7 @@ import org.hibernate.LockOptions; /** - * Definition of a named query, defined in the mapping metadata. Additional, as of JPA 2.1, named query definition + * Definition of a named query, defined in the mapping metadata. Additionally, as of JPA 2.1, named query definition * can also come from a compiled query. * * @author Gavin King diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedSQLQueryDefinition.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedSQLQueryDefinition.java index ea5fa3ecbb..782fb9e47e 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedSQLQueryDefinition.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/NamedSQLQueryDefinition.java @@ -15,7 +15,7 @@ /** * Definition of a named native SQL query, defined in the mapping metadata. - * + * * @author Max Andersen * @author Steve Ebersole */ @@ -27,7 +27,7 @@ public class NamedSQLQueryDefinition extends NamedQueryDefinition { private String resultSetRef; /** - * This form was initially used to construct a NamedSQLQueryDefinition from the binder code when a the + * This form was initially used to construct a NamedSQLQueryDefinition from the binder code when the * result-set mapping information is not explicitly provided in the query definition * (i.e., no resultset-mapping used). * diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java index 07b70b6e06..7218646d9c 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java @@ -71,7 +71,7 @@ public interface PersistenceContext { /** * Take ownership of a previously unowned collection, if one. This method returns {@code null} if no such - * collection was previous added () or was previously removed. + * collection was previously added () or was previously removed. *

            * This should indicate the owner is being loaded and we are ready to "link" them. * @@ -87,7 +87,7 @@ public interface PersistenceContext { * @return The batch fetch queue in effect for this persistence context */ BatchFetchQueue getBatchFetchQueue(); - + /** * Clear the state of the persistence context */ @@ -128,9 +128,9 @@ public interface PersistenceContext { /** * Retrieve the cached database snapshot for the requested entity key. *

            - * This differs from {@link #getDatabaseSnapshot} is two important respects:

              + * This differs from {@link #getDatabaseSnapshot} in two important respects:
                *
              1. no snapshot is obtained from the database if not already cached
              2. - *
              3. an entry of {@link #NO_ROW} here is interpretet as an exception
              4. + *
              5. an entry of {@link #NO_ROW} here is interpreted as an exception
              6. *
              * @param key The entity key for which to retrieve the cached snapshot * @return The cached snapshot @@ -269,7 +269,7 @@ EntityEntry addEntry( * Is the given collection associated with this persistence context? */ boolean containsCollection(PersistentCollection collection); - + /** * Is the given proxy associated with this persistence context? */ @@ -438,7 +438,7 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, * array, since the array instance is not created until endLoad(). */ void addCollectionHolder(PersistentCollection holder); - + /** * Remove the mapping of collection to holder during eviction * of the owning entity @@ -539,7 +539,7 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, * How deep are we cascaded? */ int getCascadeLevel(); - + /** * Called before cascading */ @@ -555,14 +555,14 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, */ @SuppressWarnings( {"UnusedDeclaration"}) boolean isFlushing(); - + /** - * Called before and after the flushcycle + * Called before and after the flush cycle */ void setFlushing(boolean flushing); /** - * Call this before begining a two-phase load + * Call this before beginning a two-phase load */ void beforeLoad(); @@ -570,7 +570,7 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, * Call this after finishing a two-phase load */ void afterLoad(); - + /** * Is in a two-phase load? */ @@ -744,7 +744,7 @@ CollectionEntry addInitializedCollection(CollectionPersister persister, * Checks if a certain {@link EntityKey} was registered as nullifiable on this {@link PersistenceContext}. * * @param sek a supplier for the EntityKey; this allows to not always needing to create the key; - * for example is the map is known to be empty there is no need to create one to check. + * for example if the map is known to be empty there is no need to create one to check. * @return true if the EntityKey had been registered before using {@link #registerNullifiableEntityKey(EntityKey)} * @see #registerNullifiableEntityKey(EntityKey) */ diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java index 66a92a1951..fd4e166ae8 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java @@ -108,7 +108,7 @@ public SessionDelegatorBaseImpl(SessionImplementor delegate) { } /** - * Returns the underlying delegate. Be careful that is has a different behavior from the {@link #getDelegate()} + * Returns the underlying delegate. Be careful that it has a different behavior from the {@link #getDelegate()} * method coming from the EntityManager interface which returns the current session. * * @see SessionDelegatorBaseImpl#getDelegate() diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java index 9ff13b6966..7ff0da6497 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java @@ -108,7 +108,7 @@ public interface SessionFactoryImplementor extends Mapping, SessionFactory, Quer Interceptor getInterceptor(); /** - * Access to the cachres of HQL/JPQL and native query plans. + * Access to the caches of HQL/JPQL and native query plans. * * @return The query plan cache * diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java index 8f9aa1259d..646fab72cf 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionContractImplementor.java @@ -122,7 +122,7 @@ public interface SharedSessionContractImplementor /** * Checks whether the session is closed. Provided separately from * {@link #isOpen()} as this method does not attempt any JTA synchronization - * registration, where as {@link #isOpen()} does; which makes this one + * registration, whereas {@link #isOpen()} does; which makes this one * nicer to use for most internal purposes. * * @return {@code true} if the session is closed; {@code false} otherwise. diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/UnsavedValueStrategy.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/UnsavedValueStrategy.java index cdb2ca6893..039d28dea3 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/UnsavedValueStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/UnsavedValueStrategy.java @@ -17,7 +17,7 @@ public interface UnsavedValueStrategy { * * @param test The value to be tested * - * @return {@code true} indicates the value corresponds to unsaved data (aka, transient state; {@code false} + * @return {@code true} indicates the value corresponds to unsaved data (aka, transient state); {@code false} * indicates the value does not corresponds to unsaved data (aka, detached state); {@code null} indicates that * this strategy was not able to determine conclusively. */ diff --git a/hibernate-core/src/main/java/org/hibernate/engine/transaction/spi/TransactionObserver.java b/hibernate-core/src/main/java/org/hibernate/engine/transaction/spi/TransactionObserver.java index 682ee9bcb2..f096a766be 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/transaction/spi/TransactionObserver.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/transaction/spi/TransactionObserver.java @@ -15,7 +15,7 @@ public interface TransactionObserver { /** * Callback for processing the beginning of a transaction. *

              - * Do not rely on this being called as the transaction mat be started in a manner other than through the + * Do not rely on this being called as the transaction may be started in a manner other than through the * {@link org.hibernate.Transaction} API. */ public void afterBegin(); diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java index 61b63ccddc..9c8ea95ae2 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java @@ -414,7 +414,7 @@ protected boolean substituteValuesIfNecessary( /** * Handles the calls needed to perform pre-save cascades for the given entity. * - * @param source The session from whcih the save event originated. + * @param source The session from which the save event originated. * @param persister The entity's persister instance. * @param entity The entity to be saved. * @param anything Generally cascade-specific data @@ -448,7 +448,7 @@ protected void cascadeBeforeSave( * * @param source The session from which the event originated. * @param persister The entity's persister instance. - * @param entity The entity beng saved. + * @param entity The entity being saved. * @param anything Generally cascade-specific data */ protected void cascadeAfterSave( diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultInitializeCollectionEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultInitializeCollectionEventListener.java index 54b6a7f319..76248ffb0a 100755 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultInitializeCollectionEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultInitializeCollectionEventListener.java @@ -91,7 +91,7 @@ public void onInitializeCollection(InitializeCollectionEvent event) throws Hiber /** * Try to initialize a collection from the cache * - * @param id The id of the collection of initialize + * @param id The id of the collection to initialize * @param persister The collection persister * @param collection The collection to initialize * @param source The originating session diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java b/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java index 4f83cb302a..86a1a62774 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/EntityCopyAllowedLoggedObserver.java @@ -22,7 +22,7 @@ /** * An {@link org.hibernate.event.spi.EntityCopyObserver} implementation that allows multiple representations of * the same persistent entity to be merged and provides logging of the entity copies that - * that are detected. + * are detected. * * @author Gail Badner */ diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java b/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java index 6472418984..3f334dcd52 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/MergeContext.java @@ -46,7 +46,7 @@ *

                *
              • Methods that return collections (e.g., {@link #keySet()}, * {@link #values()}, {@link #entrySet()}) return an - * unnmodifiable view of the collection;
              • + * unmodifiable view of the collection; *
              • If {@link #put(Object mergeEntity, Object) managedEntity} or * {@link #put(Object mergeEntity, Object managedEntity, boolean isOperatedOn)} * is executed and this MergeMap already contains a cross-reference for diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java b/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java index 797cc91b39..8d31f09d5a 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/AbstractPreDatabaseOperationEvent.java @@ -28,8 +28,8 @@ public abstract class AbstractPreDatabaseOperationEvent * Constructs an event containing the pertinent information. * * @param source The session from which the event originated. - * @param entity The entity to be invloved in the database operation. - * @param id The entity id to be invloved in the database operation. + * @param entity The entity to be involved in the database operation. + * @param id The entity id to be involved in the database operation. * @param persister The entity's persister. */ public AbstractPreDatabaseOperationEvent( diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/DeleteEvent.java b/hibernate-core/src/main/java/org/hibernate/event/spi/DeleteEvent.java index f7448dcb0d..46e6ec1983 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/DeleteEvent.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/DeleteEvent.java @@ -55,7 +55,7 @@ public DeleteEvent(String entityName, Object object, boolean cascadeDeleteEnable } /** - * Returns the encapsulated entity to be deleed. + * Returns the encapsulated entity to be deleted. * * @return The entity to be deleted. */ @@ -66,11 +66,11 @@ public Object getObject() { public String getEntityName() { return entityName; } - + public boolean isCascadeDeleteEnabled() { return cascadeDeleteEnabled; } - + public boolean isOrphanRemovalBeforeUpdates() { return orphanRemovalBeforeUpdates; } diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/PostInsertEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/spi/PostInsertEventListener.java index 768bd0d0da..3809b15daa 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/PostInsertEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/PostInsertEventListener.java @@ -9,8 +9,8 @@ import java.io.Serializable; /** - * Called after insterting an item in the datastore - * + * Called after inserting an item in the datastore + * * @author Gavin King * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/event/spi/PreDeleteEvent.java b/hibernate-core/src/main/java/org/hibernate/event/spi/PreDeleteEvent.java index becf2cbda9..b9c495a173 100755 --- a/hibernate-core/src/main/java/org/hibernate/event/spi/PreDeleteEvent.java +++ b/hibernate-core/src/main/java/org/hibernate/event/spi/PreDeleteEvent.java @@ -46,7 +46,7 @@ public PreDeleteEvent( /** * Getter for property 'deletedState'. This is the entity state at the - * time of deletion (useful for optomistic locking and such). + * time of deletion (useful for optimistic locking and such). * * @return Value for property 'deletedState'. */ diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlToken.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlToken.java index 6cc68c8c17..9dd6986149 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlToken.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlToken.java @@ -8,7 +8,7 @@ /** * A custom token class for the HQL grammar. - *

                NOTE: This class must be public becuase it is instantiated by the ANTLR library. Ignore any suggestions + *

                NOTE: This class must be public because it is instantiated by the ANTLR library. Ignore any suggestions * by various code 'analyzers' about this class being package local.

                */ public class HqlToken extends antlr.CommonToken { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ParameterTranslationsImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ParameterTranslationsImpl.java index c430dc604e..ec70bf9816 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ParameterTranslationsImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/ParameterTranslationsImpl.java @@ -32,7 +32,7 @@ public class ParameterTranslationsImpl implements ParameterTranslations { * specifications. *

                * Note: the order in the incoming list denotes the parameter's - * psudeo-position within the resulting sql statement. + * pseudo-position within the resulting sql statement. * * @param parameterSpecifications The parameter specifications */ diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java index 615ff78d19..04ffbb52f0 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/QueryTranslatorImpl.java @@ -93,7 +93,7 @@ public class QueryTranslatorImpl implements FilterTranslator { private ParameterTranslations paramTranslations; private List collectedParameterSpecifications; - + private EntityGraphQueryHint entityGraphQueryHint; @@ -117,7 +117,7 @@ public QueryTranslatorImpl( this.enabledFilters = enabledFilters; this.factory = factory; } - + public QueryTranslatorImpl( String queryIdentifier, String query, diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/DotNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/DotNode.java index 7b70a52b9e..a2368b4dfb 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/DotNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/DotNode.java @@ -109,7 +109,7 @@ public static enum DereferenceType { private boolean fetch; /** - * The type of dereference that hapened + * The type of dereference that happened */ private DereferenceType dereferenceType = DereferenceType.UNKNOWN; diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java index 665733981e..980bb8ee50 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/FromElementType.java @@ -548,7 +548,7 @@ PropertyMapping getPropertyMapping(String propertyName) { // indexed, many-to-many collections must be treated specially here if the property to // be mapped touches on the index as we must adjust the alias to use the alias from - // the association table (which i different than the one passed in + // the association table (which i different than the one passed in) if ( queryableCollection.isManyToMany() && queryableCollection.hasIndex() && SPECIAL_MANY2MANY_TREATMENT_FUNCTION_NAMES.contains( propertyName ) ) { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ImpliedFromElement.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ImpliedFromElement.java index 2877b1d568..d5e36f32d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ImpliedFromElement.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/ImpliedFromElement.java @@ -14,7 +14,7 @@ public class ImpliedFromElement extends FromElement { /** * True if this from element was implied from a path in the FROM clause, but not - * explicitly declard in the from clause. + * explicitly declared in the from clause. */ private boolean impliedInFromClause; diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/SelectClause.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/SelectClause.java index 734d553e71..471bf55efe 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/SelectClause.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/SelectClause.java @@ -46,7 +46,7 @@ public class SelectClause extends SelectExpressionList { /** * Does this SelectClause represent a scalar query * - * @return True if this is a scalara select clause; false otherwise. + * @return True if this is a scalar select clause; false otherwise. */ public boolean isScalarSelect() { return scalarSelect; @@ -110,7 +110,7 @@ public AggregatedSelectExpression getAggregatedSelectExpression() { * * @param fromClause The from clause linked to this select clause. * - * @throws SemanticException indicates a semntic issue with the explicit select clause. + * @throws SemanticException indicates a semantic issue with the explicit select clause. */ public void initializeExplicitSelectClause(FromClause fromClause) throws SemanticException { if ( prepared ) { diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/UnaryOperatorNode.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/UnaryOperatorNode.java index d67948be84..f7f2444d80 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/UnaryOperatorNode.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/UnaryOperatorNode.java @@ -14,8 +14,8 @@ */ public interface UnaryOperatorNode extends OperatorNode { /** - * Retrievs the node representing the operator's single operand. - * + * Retrieves the node representing the operator's single operand. + * * @return The operator's single operand. */ public Node getOperand(); diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java index 3da4f0af12..8001da85dd 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/ast/util/ASTUtil.java @@ -89,7 +89,7 @@ public static AST insertSibling(AST node, AST prevSibling) { /** * Creates a 'binary operator' subtree, given the information about the - * parent and the two child nodex. + * parent and the two child nodes. * * @param factory The AST factory. * @param parentType The type of the parent node. @@ -143,7 +143,7 @@ public static AST createTree(ASTFactory factory, AST[] nestedChildren) { * Determine if a given node (test) is contained anywhere in the subtree * of another given node (fixture). * - * @param fixture The node against which to testto be checked for children. + * @param fixture The node against which to test to be checked for children. * @param test The node to be tested as being a subtree child of the parent. * * @return True if child is contained in the parent's collection of children. diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/FromParser.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/FromParser.java index 5ca180cb3c..604fa394ca 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/FromParser.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/FromParser.java @@ -315,7 +315,7 @@ public void start(QueryTranslatorImpl q) { public void end(QueryTranslatorImpl q) { if ( afterMemberDeclarations ) { - //The exception throwned by the AST query translator contains the error token location, respensent by line and colum, + //The exception throwned by the AST query translator contains the error token location, represented by line and column, //but it hard to get that info here. throw new QueryException( "alias not specified for IN" ); } diff --git a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java index a29a096d53..ab68bd667b 100644 --- a/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/hql/internal/classic/QueryTranslatorImpl.java @@ -179,7 +179,7 @@ public QueryTranslatorImpl( * * @throws org.hibernate.MappingException Indicates problems resolving * things referenced in the query. - * @throws org.hibernate.QueryException Generally some form of syntatic + * @throws org.hibernate.QueryException Generally some form of syntactic * failure. */ void compile(QueryTranslatorImpl superquery) throws QueryException, MappingException { @@ -231,7 +231,7 @@ public synchronized void compile( * * @throws org.hibernate.MappingException Indicates problems resolving * things referenced in the query. - * @throws org.hibernate.QueryException Generally some form of syntatic + * @throws org.hibernate.QueryException Generally some form of syntactic * failure. */ private void compile() throws QueryException, MappingException { diff --git a/hibernate-core/src/main/java/org/hibernate/id/IdentifierGeneratorHelper.java b/hibernate-core/src/main/java/org/hibernate/id/IdentifierGeneratorHelper.java index 8f021d2417..228ac61f27 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/IdentifierGeneratorHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/id/IdentifierGeneratorHelper.java @@ -46,7 +46,7 @@ public String toString() { /** * Marker object returned from {@link IdentifierGenerator#generate} to indicate that the entity's identifier will - * be generated as part of the datbase insertion. + * be generated as part of the database insertion. */ public static final Serializable POST_INSERT_INDICATOR = new Serializable() { @Override @@ -80,7 +80,7 @@ public static Serializable getGeneratedIdentity(ResultSet rs, String identifier, } /** - * Extract the value from the result set (which is assumed to already have been positioned to the apopriate row) + * Extract the value from the result set (which is assumed to already have been positioned to the appropriate row) * and wrp it in the appropriate Java numeric type. * * @param rs The result set from which to extract the value. diff --git a/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java index 6236dd3043..7dfbe44da6 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/MultipleHiLoPerTableGenerator.java @@ -47,7 +47,7 @@ /** * A hilo IdentifierGenerator that returns a Long, constructed using - * a hi/lo algorithm. The hi value MUST be fetched in a seperate transaction + * a hi/lo algorithm. The hi value MUST be fetched in a separate transaction * to the Session transaction so the generator must be able to obtain * a new connection and commit it. Hence this implementation may not * be used when the user is supplying connections. In this diff --git a/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java index ba71e8ae17..6529124f98 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java @@ -53,7 +53,7 @@ public interface PersistentIdentifierGenerator extends IdentifierGenerator, Expo String CATALOG = "catalog"; /** - * The key under whcih to find the {@link org.hibernate.boot.model.naming.ObjectNameNormalizer} in the config param map. + * The key under which to find the {@link org.hibernate.boot.model.naming.ObjectNameNormalizer} in the config param map. */ String IDENTIFIER_NORMALIZER = "identifier_normalizer"; diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/InitialValueAwareOptimizer.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/InitialValueAwareOptimizer.java index 13e042acf6..079553288d 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/InitialValueAwareOptimizer.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/InitialValueAwareOptimizer.java @@ -7,7 +7,7 @@ package org.hibernate.id.enhanced; /** - * Marker interface for optimizer which wish to know the user-specified initial value. + * Marker interface for optimizer which wishes to know the user-specified initial value. *

                * Used instead of constructor injection since that is already a public understanding and * because not all optimizers care. diff --git a/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java index 48c63bf532..47e5a69bd0 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/enhanced/TableGenerator.java @@ -284,7 +284,7 @@ public final String getSegmentColumnName() { } /** - * The value in {@link #getSegmentColumnName segment column} which + * The value in {@link #getSegmentColumnName segment column} * corresponding to this generator instance. In other words this value * indicates the row in which this generator instance will store values. * diff --git a/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java b/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java index c00e6eb585..f3e4847930 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java @@ -40,7 +40,7 @@ public interface IdentifierGeneratorFactory { * * @param strategy The generation strategy. * @param type The mapping type for the identifier values. - * @param config Any configuraion properties given in the generator mapping. + * @param config Any configuration properties given in the generator mapping. * * @return The appropriate generator instance. */ diff --git a/hibernate-core/src/main/java/org/hibernate/id/insert/IdentifierGeneratingInsert.java b/hibernate-core/src/main/java/org/hibernate/id/insert/IdentifierGeneratingInsert.java index f85432748b..064ccb3866 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/insert/IdentifierGeneratingInsert.java +++ b/hibernate-core/src/main/java/org/hibernate/id/insert/IdentifierGeneratingInsert.java @@ -1,22 +1,22 @@ -/* - * 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 . - */ -package org.hibernate.id.insert; -import org.hibernate.dialect.Dialect; -import org.hibernate.sql.Insert; - -/** - * Nothing more than a distinguishing subclass of Insert used to indicate - * intent. Some subclasses of this also provided some additional - * functionality or semantic to the genernated SQL statement string. - * - * @author Steve Ebersole - */ -public class IdentifierGeneratingInsert extends Insert { - public IdentifierGeneratingInsert(Dialect dialect) { - super( dialect ); - } -} +/* + * 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 . + */ +package org.hibernate.id.insert; +import org.hibernate.dialect.Dialect; +import org.hibernate.sql.Insert; + +/** + * Nothing more than a distinguishing subclass of Insert used to indicate + * intent. Some subclasses of this also provided some additional + * functionality or semantic to the generated SQL statement string. + * + * @author Steve Ebersole + */ +public class IdentifierGeneratingInsert extends Insert { + public IdentifierGeneratingInsert(Dialect dialect) { + super( dialect ); + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java index 3fa72c35f1..ea3bc13aec 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -193,7 +193,7 @@ public AbstractSharedSessionContract(SessionFactoryImpl factory, SessionCreation this.transactionCoordinator = sharedOptions.getTransactionCoordinator(); this.jdbcCoordinator = sharedOptions.getJdbcCoordinator(); - // todo : "wrap" the transaction to no-op cmmit/rollback attempts? + // todo : "wrap" the transaction to no-op comit/rollback attempts? this.currentHibernateTransaction = sharedOptions.getTransaction(); if ( sharedOptions.shouldAutoJoinTransactions() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java index a822200afb..944d1b83ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/BytesHelper.java @@ -71,17 +71,16 @@ public static byte[] fromLong(long longValue) { fromLong(longValue, bytes, 0); return bytes; } - + /** * Interpret a long as its binary form * * @param longValue The long to interpret to binary * @param dest the destination array. * @param destPos starting position in the destination array. - * @return The binary */ public static void fromLong(long longValue, byte[] dest, int destPos) { - + dest[destPos] = (byte) ( longValue >> 56 ); dest[destPos + 1] = (byte) ( ( longValue << 8 ) >> 56 ); dest[destPos + 2] = (byte) ( ( longValue << 16 ) >> 56 ); @@ -102,7 +101,7 @@ public static void fromLong(long longValue, byte[] dest, int destPos) { public static long asLong(byte[] bytes) { return asLong(bytes, 0); } - + /** * Interpret the binary representation of a long. * diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/Cloneable.java b/hibernate-core/src/main/java/org/hibernate/internal/util/Cloneable.java index ef7f431732..dc51d40714 100755 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/Cloneable.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/Cloneable.java @@ -16,7 +16,7 @@ import org.hibernate.HibernateException; /** - * An object that is shallow-coneable + * An object that is shallow-cloneable * * @author Steve Ebersole */ @@ -87,7 +87,7 @@ private Object copyListeners() { } finally { if ( beanInfo != null ) { - // release the jdk internal caches everytime to ensure this + // release the jdk internal caches every time to ensure this // plays nicely with destroyable class-loaders Introspector.flushFromCaches( getClass() ); } @@ -107,7 +107,7 @@ private void checkListeners() { } finally { if ( beanInfo != null ) { - // release the jdk internal caches everytime to ensure this + // release the jdk internal caches every time to ensure this // plays nicely with destroyable class-loaders Introspector.flushFromCaches( getClass() ); } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java index f87581521c..329e3a17e8 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java @@ -30,7 +30,7 @@ public final class ConfigHelper { /** * Try to locate a local URL representing the incoming path. The first attempt * assumes that the incoming path is an actual URL string (file://, etc). If this - * does not work, then the next attempts try to locate this UURL as a java system + * does not work, then the next attempts try to locate this URL as a java system * resource. * * @param path The path representing the config location. diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java index 4fbff725c4..423e38241e 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java @@ -191,7 +191,7 @@ public static Class classForName(String name) throws ClassNotFoundException { * Is this member publicly accessible. * * @param clazz The class which defines the member - * @param member The memeber. + * @param member The member. * @return True if the member is publicly accessible, false otherwise. */ public static boolean isPublic(Class clazz, Member member) { @@ -299,7 +299,7 @@ public static boolean isAbstractClass(Class clazz) { * Determine is the given class is declared final. * * @param clazz The class to check. - * @return True if the class is final, flase otherwise. + * @return True if the class is final, false otherwise. */ public static boolean isFinalClass(Class clazz) { return Modifier.isFinal( clazz.getModifiers() ); diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java index f79b03a651..6b390cd082 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java @@ -548,7 +548,7 @@ public static String generateAlias(String description, int unique) { /** * Generates a root alias by truncating the "root name" defined by - * the incoming decription and removing/modifying any non-valid + * the incoming description and removing/modifying any non-valid * alias characters. * * @param description The root name from which to generate a root alias. diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/collections/Stack.java b/hibernate-core/src/main/java/org/hibernate/internal/util/collections/Stack.java index 240d48ab22..35048585b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/collections/Stack.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/collections/Stack.java @@ -48,7 +48,7 @@ public interface Stack { boolean isEmpty(); /** - * Remmove all elements from the stack + * Remove all elements from the stack */ void clear(); diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java index fe97b287cc..aa0471eabf 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/config/ConfigurationHelper.java @@ -262,7 +262,7 @@ public static Map clone(Map configurationValues) { * replace a property by a starred version * * @param props properties to check - * @param key proeprty to mask + * @param key property to mask * * @return cloned and masked properties */ diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/xml/Origin.java b/hibernate-core/src/main/java/org/hibernate/internal/util/xml/Origin.java index 211f57b442..9c1a9955ca 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/xml/Origin.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/xml/Origin.java @@ -15,7 +15,7 @@ */ public interface Origin extends Serializable { /** - * Retrieve the type of origin. This is not a discrete set, but might be somethign like + * Retrieve the type of origin. This is not a discrete set, but might be something like * {@code file} for file protocol URLs, or {@code resource} for classpath resource lookups. * * @return The origin type. diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/xml/XMLHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/xml/XMLHelper.java index 4239bd0ded..b44997c02e 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/xml/XMLHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/xml/XMLHelper.java @@ -14,7 +14,7 @@ import org.xml.sax.EntityResolver; /** - * Small helper class that lazy loads DOM and SAX reader and keep them for fast use afterwards. + * Small helper class that lazily loads DOM and SAX reader and keep them for fast use afterwards. * * @deprecated Currently only used for integration with HCANN. The rest of Hibernate uses StAX now * for XML processing. See {@link org.hibernate.boot.jaxb.internal.stax} diff --git a/hibernate-core/src/main/java/org/hibernate/jdbc/BatchedTooManyRowsAffectedException.java b/hibernate-core/src/main/java/org/hibernate/jdbc/BatchedTooManyRowsAffectedException.java index 30c38714d1..f13c7a42c9 100644 --- a/hibernate-core/src/main/java/org/hibernate/jdbc/BatchedTooManyRowsAffectedException.java +++ b/hibernate-core/src/main/java/org/hibernate/jdbc/BatchedTooManyRowsAffectedException.java @@ -1,28 +1,28 @@ -/* - * 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 . - */ -package org.hibernate.jdbc; - - -/** - * Much like {@link TooManyRowsAffectedException}, indicates that more - * rows than what we were expcecting were affected. Additionally, this form - * occurs from a batch and carries along the batch positon that failed. - * - * @author Steve Ebersole - */ -public class BatchedTooManyRowsAffectedException extends TooManyRowsAffectedException { - private final int batchPosition; - - public BatchedTooManyRowsAffectedException(String message, int expectedRowCount, int actualRowCount, int batchPosition) { - super( message, expectedRowCount, actualRowCount ); - this.batchPosition = batchPosition; - } - - public int getBatchPosition() { - return batchPosition; - } -} +/* + * 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 . + */ +package org.hibernate.jdbc; + + +/** + * Much like {@link TooManyRowsAffectedException}, indicates that more + * rows than what we were expecting were affected. Additionally, this form + * occurs from a batch and carries along the batch position that failed. + * + * @author Steve Ebersole + */ +public class BatchedTooManyRowsAffectedException extends TooManyRowsAffectedException { + private final int batchPosition; + + public BatchedTooManyRowsAffectedException(String message, int expectedRowCount, int actualRowCount, int batchPosition) { + super( message, expectedRowCount, actualRowCount ); + this.batchPosition = batchPosition; + } + + public int getBatchPosition() { + return batchPosition; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/jdbc/WorkExecutor.java b/hibernate-core/src/main/java/org/hibernate/jdbc/WorkExecutor.java index 718b459533..3f5db464b5 100644 --- a/hibernate-core/src/main/java/org/hibernate/jdbc/WorkExecutor.java +++ b/hibernate-core/src/main/java/org/hibernate/jdbc/WorkExecutor.java @@ -28,8 +28,8 @@ public class WorkExecutor { * @param work The @link ReturningWork} instance encapsulating the discrete work * @param connection The connection on which to perform the work. * - * @return null>. - * + * @return null. + * * @throws SQLException Thrown during execution of the underlying JDBC interaction. * @throws org.hibernate.HibernateException Generally indicates a wrapped SQLException. */ diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/jpa/AvailableSettings.java index 7d4641856c..a3282b11f3 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/AvailableSettings.java @@ -236,7 +236,7 @@ public interface AvailableSettings { * enabled - Do the build *

              • *
              • - * disabled - Do not so the build + * disabled - Do not do the build *
              • *
              • * ignoreUnsupported - Do the build, but ignore any non-JPA features that would otherwise diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/HibernateEntityManager.java b/hibernate-core/src/main/java/org/hibernate/jpa/HibernateEntityManager.java index 54a53a7e06..bf82f7a02d 100755 --- a/hibernate-core/src/main/java/org/hibernate/jpa/HibernateEntityManager.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/HibernateEntityManager.java @@ -17,7 +17,7 @@ * * @author Gavin King * - * @deprecated (snce 5.2) Use Session (or SessionImplementor), as it now extends EntityManager directly + * @deprecated (since 5.2) Use Session (or SessionImplementor), as it now extends EntityManager directly */ @Deprecated public interface HibernateEntityManager extends EntityManager, QueryProducer { diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/XmlHelper.java b/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/XmlHelper.java index 652b398537..3269811cc1 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/XmlHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/XmlHelper.java @@ -29,7 +29,7 @@ private XmlHelper() { * * @param element The parent element * @param tagName The name of the desired child - * @return An interator of children or null if element is null. + * @return An iterator of children or null if element is null. */ public static Iterator getChildrenByTagName( Element element, diff --git a/hibernate-core/src/main/java/org/hibernate/loader/CollectionAliases.java b/hibernate-core/src/main/java/org/hibernate/loader/CollectionAliases.java index 70da4cd5b9..abd6818246 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/CollectionAliases.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/CollectionAliases.java @@ -22,7 +22,7 @@ public interface CollectionAliases { public String[] getSuffixedKeyAliases(); /** - * Returns the suffixed result-set column-aliases for the collumns + * Returns the suffixed result-set column-aliases for the columns * making up the collection's index (map or list). * * @return The index result-set column aliases. diff --git a/hibernate-core/src/main/java/org/hibernate/loader/GeneratedCollectionAliases.java b/hibernate-core/src/main/java/org/hibernate/loader/GeneratedCollectionAliases.java index 2951e90676..4589c6929d 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/GeneratedCollectionAliases.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/GeneratedCollectionAliases.java @@ -66,7 +66,7 @@ public String[] getSuffixedKeyAliases() { } /** - * Returns the suffixed result-set column-aliases for the collumns making up the collection's index (map or list). + * Returns the suffixed result-set column-aliases for the columns making up the collection's index (map or list). * * @return The index result-set column aliases. */ diff --git a/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java b/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java index 7a1bed66d1..9ce89b60de 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java @@ -570,7 +570,7 @@ else if ( type.isComponentType() ) { * @param componentType The component type to be walked. * @param propertyNumber The property number for the component property (relative to * persister). - * @param begin todo unknowm + * @param begin todo unknown * @param persister The owner of the component property * @param alias The root alias * @param path The property access path @@ -661,7 +661,7 @@ private void walkCompositeElementTree( if ( types[i].isAssociationType() ) { AssociationType associationType = (AssociationType) types[i]; - // simple, because we can't have a one-to-one or a collection + // simple, because we can't have a one-to-one or a collection // (or even a property-ref) in a composite-element: String[] aliasedLhsColumns = StringHelper.qualify( alias, lhsColumns ); @@ -707,11 +707,11 @@ else if ( types[i].isComponentType() ) { * is the "first" join in a series */ protected JoinType getJoinType(boolean nullable, int currentDepth) { - //TODO: this is too conservative; if all preceding joins were + //TODO: this is too conservative; if all preceding joins were // also inner joins, we could use an inner join here // // IMPL NOTE : currentDepth might be less-than zero if this is the - // root of a many-to-many collection initializer + // root of a many-to-many collection initializer return !nullable && currentDepth <= 0 ? JoinType.INNER_JOIN : JoinType.LEFT_OUTER_JOIN; @@ -743,7 +743,7 @@ protected boolean isJoinedFetchEnabledInMapping(FetchMode config, AssociationTyp return false; } if ( type.isEntityType() ) { - //TODO: look at the owning property and check that it + //TODO: look at the owning property and check that it // isn't lazy (by instrumentation) EntityType entityType = (EntityType) type; EntityPersister persister = getFactory().getEntityPersister( entityType.getAssociatedEntityName() ); diff --git a/hibernate-core/src/main/java/org/hibernate/loader/collection/BasicCollectionLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/collection/BasicCollectionLoader.java index 9338e35d59..d035198e57 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/collection/BasicCollectionLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/collection/BasicCollectionLoader.java @@ -18,7 +18,7 @@ /** * Loads a collection of values or a many-to-many association. *
                - * The collection persister must implement QueryableCOllection. For + * The collection persister must implement QueryableCollection. For * other collections, create a customized subclass of Loader. * * @see OneToManyLoader diff --git a/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyLoader.java index 26d5b4519f..90d1d0cf0f 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/collection/OneToManyLoader.java @@ -18,7 +18,7 @@ /** * Loads one-to-many associations
                *
                - * The collection persister must implement QueryableCOllection. For + * The collection persister must implement QueryableCollection. For * other collections, create a customized subclass of Loader. * * @see BasicCollectionLoader diff --git a/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java b/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java index dabdcfee99..fffd36b346 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java @@ -606,7 +606,7 @@ public Type getType(Criteria subcriteria, String propertyName) } /** - * Get the a typed value for the given property value. + * Get the typed value for the given property value. */ @Override public TypedValue getTypedValue(Criteria subcriteria, String propertyName, Object value) throws HibernateException { diff --git a/hibernate-core/src/main/java/org/hibernate/loader/custom/ColumnCollectionAliases.java b/hibernate-core/src/main/java/org/hibernate/loader/custom/ColumnCollectionAliases.java index 13c10f8805..aebaaed61d 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/custom/ColumnCollectionAliases.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/custom/ColumnCollectionAliases.java @@ -12,7 +12,7 @@ import org.hibernate.persister.collection.SQLLoadableCollection; /** - * CollectionAliases that uses columnnames instead of generated aliases. + * CollectionAliases that uses column names instead of generated aliases. * Aliases can still be overwritten via * * @author Max Rydahl Andersen @@ -62,7 +62,7 @@ public String[] getSuffixedKeyAliases() { } /** - * Returns the suffixed result-set column-aliases for the collumns making up the collection's index (map or list). + * Returns the suffixed result-set column-aliases for the columns making up the collection's index (map or list). * * @return The index result-set column aliases. */ diff --git a/hibernate-core/src/main/java/org/hibernate/loader/custom/CustomLoader.java b/hibernate-core/src/main/java/org/hibernate/loader/custom/CustomLoader.java index cdde43aa9e..e30802a143 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/custom/CustomLoader.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/custom/CustomLoader.java @@ -533,7 +533,7 @@ protected void validateAlias(String alias) { * *after* {@link #list(SharedSessionContractImplementor, QueryParameters)} has already been called. It's a bit of a * chicken-and-the-egg issue since {@link #autoDiscoverTypes(ResultSet)} needs the {@link ResultSet}. *

                - * As a hacky workaround, overriden here to provide the {@link #resultTypes}. + * As a hacky workaround, overridden here to provide the {@link #resultTypes}. * * see HHH-3051 */ diff --git a/hibernate-core/src/main/java/org/hibernate/loader/custom/EntityFetchReturn.java b/hibernate-core/src/main/java/org/hibernate/loader/custom/EntityFetchReturn.java index 3ae3e656dd..71bb96e4c1 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/custom/EntityFetchReturn.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/custom/EntityFetchReturn.java @@ -1,32 +1,32 @@ -/* - * 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 . - */ -package org.hibernate.loader.custom; -import org.hibernate.LockMode; -import org.hibernate.loader.EntityAliases; - -/** - * Spefically a fetch return that refers to an entity association. - * - * @author Steve Ebersole - */ -public class EntityFetchReturn extends FetchReturn { - private final EntityAliases entityAliases; - - public EntityFetchReturn( - String alias, - EntityAliases entityAliases, - NonScalarReturn owner, - String ownerProperty, - LockMode lockMode) { - super( owner, ownerProperty, alias, lockMode ); - this.entityAliases = entityAliases; - } - - public EntityAliases getEntityAliases() { - return entityAliases; - } -} +/* + * 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 . + */ +package org.hibernate.loader.custom; +import org.hibernate.LockMode; +import org.hibernate.loader.EntityAliases; + +/** + * Specifically a fetch return that refers to an entity association. + * + * @author Steve Ebersole + */ +public class EntityFetchReturn extends FetchReturn { + private final EntityAliases entityAliases; + + public EntityFetchReturn( + String alias, + EntityAliases entityAliases, + NonScalarReturn owner, + String ownerProperty, + LockMode lockMode) { + super( owner, ownerProperty, alias, lockMode ); + this.entityAliases = entityAliases; + } + + public EntityAliases getEntityAliases() { + return entityAliases; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/loader/custom/FetchReturn.java b/hibernate-core/src/main/java/org/hibernate/loader/custom/FetchReturn.java index 491443f9eb..4c11572bfa 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/custom/FetchReturn.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/custom/FetchReturn.java @@ -1,54 +1,54 @@ -/* - * 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 . - */ -package org.hibernate.loader.custom; -import org.hibernate.LockMode; - -/** - * Represents a return which names a fetched association. - * - * @author Steve Ebersole - */ -public abstract class FetchReturn extends NonScalarReturn { - private final NonScalarReturn owner; - private final String ownerProperty; - - /** - * Creates a return descriptor for an association fetch. - * - * @param owner The return descriptor for the owner of the fetch - * @param ownerProperty The name of the property represernting the association being fetched - * @param alias The alias for the fetch - * @param lockMode The lock mode to apply to the fetched association. - */ - public FetchReturn( - NonScalarReturn owner, - String ownerProperty, - String alias, - LockMode lockMode) { - super( alias, lockMode ); - this.owner = owner; - this.ownerProperty = ownerProperty; - } - - /** - * Retrieves the return descriptor for the owner of this fetch. - * - * @return The owner - */ - public NonScalarReturn getOwner() { - return owner; - } - - /** - * The name of the property on the owner which represents this association. - * - * @return The property name. - */ - public String getOwnerProperty() { - return ownerProperty; - } -} +/* + * 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 . + */ +package org.hibernate.loader.custom; +import org.hibernate.LockMode; + +/** + * Represents a return which names a fetched association. + * + * @author Steve Ebersole + */ +public abstract class FetchReturn extends NonScalarReturn { + private final NonScalarReturn owner; + private final String ownerProperty; + + /** + * Creates a return descriptor for an association fetch. + * + * @param owner The return descriptor for the owner of the fetch + * @param ownerProperty The name of the property representing the association being fetched + * @param alias The alias for the fetch + * @param lockMode The lock mode to apply to the fetched association. + */ + public FetchReturn( + NonScalarReturn owner, + String ownerProperty, + String alias, + LockMode lockMode) { + super( alias, lockMode ); + this.owner = owner; + this.ownerProperty = ownerProperty; + } + + /** + * Retrieves the return descriptor for the owner of this fetch. + * + * @return The owner + */ + public NonScalarReturn getOwner() { + return owner; + } + + /** + * The name of the property on the owner which represents this association. + * + * @return The property name. + */ + public String getOwnerProperty() { + return ownerProperty; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryParser.java b/hibernate-core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryParser.java index 823753360c..216d72a0cf 100755 --- a/hibernate-core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryParser.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/custom/sql/SQLQueryParser.java @@ -74,7 +74,7 @@ public String process() { return processedSql; } - // TODO: should "record" how many properties we have reffered to - and if we + // TODO: should "record" how many properties we have reffered to - and if we // don't get'em'all we throw an exception! Way better than trial and error ;) protected String substituteBrackets(String sqlQuery) throws QueryException { @@ -125,7 +125,7 @@ else if ( SCHEMA_PLACEHOLDER.equals( aliasPath ) ) { result.append(schemaName); result.append("."); } - } + } // Catalog replacement else if ( CATALOG_PLACEHOLDER.equals( aliasPath ) ) { final String catalogName = factory.getSettings().getDefaultCatalogName(); @@ -145,10 +145,10 @@ else if (context != null) { // it is a simple table alias {foo} result.append( aliasPath ); aliasesFound++; - } + } else { // passing through anything we do not know : to support jdbc escape sequences HB-898 - result.append( '{' ).append(aliasPath).append( '}' ); + result.append( '{' ).append(aliasPath).append( '}' ); } } else { @@ -158,7 +158,7 @@ else if (context != null) { String propertyName = aliasPath.substring( firstDot + 1 ); result.append( resolveCollectionProperties( aliasName, propertyName ) ); aliasesFound++; - } + } else if ( context.isEntityAlias( aliasName ) ) { // it is a property reference {foo.bar} String propertyName = aliasPath.substring( firstDot + 1 ); @@ -179,7 +179,7 @@ else if ( context.isEntityAlias( aliasName ) ) { // Possibly handle :something parameters for the query ? return result.toString(); - } + } private String resolveCollectionProperties( String aliasName, @@ -193,11 +193,11 @@ private String resolveCollectionProperties( if( !fieldResults.isEmpty() ) { throw new QueryException("Using return-propertys together with * syntax is not supported."); } - + String selectFragment = collectionPersister.selectFragment( aliasName, collectionSuffix ); aliasesFound++; - return selectFragment - + ", " + return selectFragment + + ", " + resolveProperties( aliasName, propertyName ); } else if ( "element.*".equals( propertyName ) ) { @@ -211,7 +211,7 @@ else if ( "element.*".equals( propertyName ) ) { if ( columnAliases==null ) { columnAliases = collectionPersister.getCollectionPropertyColumnAliases( propertyName, collectionSuffix ); } - + if ( columnAliases == null || columnAliases.length == 0 ) { throw new QueryException( "No column name found for property [" + propertyName + "] for alias [" + aliasName + "]", @@ -228,7 +228,7 @@ else if ( "element.*".equals( propertyName ) ) { } aliasesFound++; return columnAliases[0]; - + } } private String resolveProperties(String aliasName, String propertyName) { @@ -239,7 +239,7 @@ private String resolveProperties(String aliasName, String propertyName) { if ( "*".equals( propertyName ) ) { if( !fieldResults.isEmpty() ) { throw new QueryException("Using return-propertys together with * syntax is not supported."); - } + } aliasesFound++; return persister.selectFragment( aliasName, suffix ) ; } @@ -265,14 +265,14 @@ private String resolveProperties(String aliasName, String propertyName) { "SQL queries only support properties mapped to a single column - property [" + propertyName + "] is mapped to " + columnAliases.length + " columns.", originalQueryString ); - } + } aliasesFound++; return columnAliases[0]; } } /** - * Substitues JDBC parameter placeholders (?) for all encountered + * Substitutes JDBC parameter placeholders (?) for all encountered * parameter specifications. It also tracks the positions of these * parameter specifications within the query string. This accounts for * ordinal-params, named-params, and ejb3-positional-params. diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/QuerySpaceTreePrinter.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/QuerySpaceTreePrinter.java index 22b3949708..eeedd9e28d 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/QuerySpaceTreePrinter.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/build/spi/QuerySpaceTreePrinter.java @@ -64,7 +64,7 @@ public String asString(QuerySpaces spaces, AliasResolutionContext aliasResolutio * An indentation is defined as the number of characters defined by {@link TreePrinterHelper#INDENTATION}. * * @param spaces The {@link QuerySpaces} object. - * @param depth The intial number of indentations + * @param depth The initial number of indentations * @param aliasResolutionContext The context for resolving table and column aliases * for the {@link QuerySpace} references in spaces; if null, * table and column aliases are not included in returned value.. @@ -89,7 +89,7 @@ public String asString(QuerySpaces spaces, int depth, AliasResolutionContext ali * An indentation is defined as the number of characters defined by {@link TreePrinterHelper#INDENTATION}. * * @param spaces The {@link QuerySpaces} object. - * @param depth The intial number of indentations + * @param depth The initial number of indentations * @param aliasResolutionContext The context for resolving table and column aliases * for the {@link QuerySpace} references in spaces; if null, * table and column aliases are not included in returned value. @@ -114,7 +114,7 @@ public void write( * An indentation is defined as the number of characters defined by {@link TreePrinterHelper#INDENTATION}. * * @param spaces The {@link QuerySpaces} object. - * @param depth The intial number of indentations + * @param depth The initial number of indentations * @param aliasResolutionContext The context for resolving table and column aliases * for the {@link QuerySpace} references in spaces; if null, * table and column aliases are not included in returned value. @@ -233,7 +233,7 @@ private void writeJoins( *

              • query space class name
              • *
              • unique ID
              • *
              • entity name (for {@link EntityQuerySpace}
              • - *
              • collection role (for {@link CollectionQuerySpace}
              • * + *
              • collection role (for {@link CollectionQuerySpace}
              • *
              * @param space The query space * @return a String containing details about the {@link QuerySpace} diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BasicCollectionLoadQueryDetails.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BasicCollectionLoadQueryDetails.java index 1a35e684af..7fe49ad788 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BasicCollectionLoadQueryDetails.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BasicCollectionLoadQueryDetails.java @@ -23,7 +23,7 @@ public class BasicCollectionLoadQueryDetails extends AbstractCollectionLoadQuery * Constructs a BasicCollectionLoadQueryDetails object from the given inputs. * * @param loadPlan The load plan - * @param buildingParameters And influencers that would affect the generated SQL (mostly we are concerned with those + * @param buildingParameters Any influencers that would affect the generated SQL (mostly we are concerned with those * that add additional joins here) * @param factory The SessionFactory */ diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BatchingLoadQueryDetailsFactory.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BatchingLoadQueryDetailsFactory.java index 3b03f72d9c..a03cf24e92 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BatchingLoadQueryDetailsFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/BatchingLoadQueryDetailsFactory.java @@ -31,11 +31,11 @@ private BatchingLoadQueryDetailsFactory() { } /** - * Returns a EntityLoadQueryDetails object from the given inputs. + * Returns an EntityLoadQueryDetails object from the given inputs. * * @param loadPlan The load plan * @param keyColumnNames The columns to load the entity by (the PK columns or some other unique set of columns) - * @param buildingParameters And influencers that would affect the generated SQL (mostly we are concerned with those + * @param buildingParameters Any influencers that would affect the generated SQL (mostly we are concerned with those * that add additional joins here) * @param factory The SessionFactory * @@ -72,7 +72,7 @@ public EntityLoadQueryDetails makeEntityLoadQueryDetails( * Returns a EntityLoadQueryDetails object based on an existing one and additional elements specific to this one. * * @param entityLoadQueryDetailsTemplate the template - * @param buildingParameters And influencers that would affect the generated SQL (mostly we are concerned with those + * @param buildingParameters Any influencers that would affect the generated SQL (mostly we are concerned with those * that add additional joins here) * @return The EntityLoadQueryDetails */ @@ -90,7 +90,7 @@ public EntityLoadQueryDetails makeEntityLoadQueryDetails( * * @param collectionPersister The collection persister. * @param loadPlan The load plan. - * @param buildingParameters And influencers that would affect the generated SQL (mostly we are concerned with those + * @param buildingParameters Any influencers that would affect the generated SQL (mostly we are concerned with those * that add additional joins here) * * @return The EntityLoadQueryDetails diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/EntityLoadQueryDetails.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/EntityLoadQueryDetails.java index 7c78004c51..4b922df9cf 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/EntityLoadQueryDetails.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/exec/internal/EntityLoadQueryDetails.java @@ -55,7 +55,7 @@ public class EntityLoadQueryDetails extends AbstractLoadQueryDetails { * * @param loadPlan The load plan * @param keyColumnNames The columns to load the entity by (the PK columns or some other unique set of columns) - * @param buildingParameters And influencers that would affect the generated SQL (mostly we are concerned with those + * @param buildingParameters Any influencers that would affect the generated SQL (mostly we are concerned with those * that add additional joins here) * @param factory The SessionFactory */ diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java b/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java index 0624c06c59..f1f32981ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Constraint.java @@ -41,7 +41,7 @@ public String getName() { public void setName(String name) { this.name = name; } - + /** * If a constraint is not explicitly named, this is called to generate * a unique hash using the table and column names. @@ -92,10 +92,10 @@ public static String generateName(String prefix, Table table, List colum * (full alphanumeric), guaranteeing * that the length of the name will always be smaller than the 30 * character identifier restriction enforced by a few dialects. - * + * * @param s * The name to be hashed. - * @return String The hased name. + * @return String The hashed name. */ public static String hashedName(String s) { try { @@ -214,7 +214,7 @@ public abstract String sqlConstraintString( public String toString() { return getClass().getName() + '(' + getTable().getName() + getColumns() + ") as " + name; } - + /** * @return String The prefix to use in generated constraint names. Examples: * "UK_", "FK_", and "PK_". diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/FetchProfile.java b/hibernate-core/src/main/java/org/hibernate/mapping/FetchProfile.java index 1705533a2d..087fcad64e 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/FetchProfile.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/FetchProfile.java @@ -65,7 +65,7 @@ public LinkedHashSet getFetches() { * * @param entity The entity which contains the association to be fetched * @param association The association to fetch - * @param style The style of fetch t apply + * @param style The style of fetch to apply */ public void addFetch(String entity, String association, String style) { fetches.add( new Fetch( entity, association, style ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Subclass.java b/hibernate-core/src/main/java/org/hibernate/mapping/Subclass.java index 4b367f7908..0affe8d9ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Subclass.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Subclass.java @@ -19,14 +19,14 @@ import org.hibernate.internal.util.collections.SingletonIterator; /** - * A sublass in a table-per-class-hierarchy mapping + * A subclass in a table-per-class-hierarchy mapping * @author Gavin King */ public class Subclass extends PersistentClass { private PersistentClass superclass; private Class classPersisterClass; private final int subclassId; - + public Subclass(PersistentClass superclass, MetadataBuildingContext metadataBuildingContext) { super( metadataBuildingContext ); this.superclass = superclass; @@ -36,11 +36,11 @@ public Subclass(PersistentClass superclass, MetadataBuildingContext metadataBuil int nextSubclassId() { return getSuperclass().nextSubclassId(); } - + public int getSubclassId() { return subclassId; } - + @Override public String getNaturalIdCacheRegionName() { return getSuperclass().getNaturalIdCacheRegionName(); @@ -243,7 +243,7 @@ public java.util.List getFilters() { } public boolean hasSubselectLoadableCollections() { - return super.hasSubselectLoadableCollections() || + return super.hasSubselectLoadableCollections() || getSuperclass().hasSubselectLoadableCollections(); } diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java index f9a9d868fa..19b5ba57a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java @@ -222,7 +222,7 @@ public boolean isCatalogQuoted() { /** * Return the column which is identified by column provided as argument. * - * @param column column with atleast a name. + * @param column column with at least a name. * @return the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same. */ public Column getColumn(Column column) { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java index 7ca31ff011..ef0bc44788 100755 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/MetadataContext.java @@ -77,7 +77,7 @@ class MetadataContext { private List orderedMappings = new ArrayList<>(); /** - * Stack of PersistentClass being process. Last in the list is the highest in the stack. + * Stack of PersistentClass being processed. Last in the list is the highest in the stack. */ private List stackOfPersistentClassesBeingProcessed = new ArrayList<>(); @@ -159,7 +159,7 @@ public Map, MappedSuperclassType> getMappedSuperclassTypeMap() { /** * Given a Hibernate {@link PersistentClass}, locate the corresponding JPA {@link org.hibernate.type.EntityType} - * implementation. May retur null if the given {@link PersistentClass} has not yet been processed. + * implementation. May return null if the given {@link PersistentClass} has not yet been processed. * * @param persistentClass The Hibernate (config time) metamodel instance representing an entity. * @@ -171,7 +171,7 @@ public EntityTypeDescriptor locateEntityType(PersistentClass persistentClass) /** * Given a Java {@link Class}, locate the corresponding JPA {@link org.hibernate.type.EntityType}. May - * return null which could means that no such mapping exists at least at this time. + * return null which could mean that no such mapping exists at least at this time. * * @param javaType The java class. * diff --git a/hibernate-core/src/main/java/org/hibernate/param/DynamicFilterParameterSpecification.java b/hibernate-core/src/main/java/org/hibernate/param/DynamicFilterParameterSpecification.java index def45bdf99..b4387dd7d3 100644 --- a/hibernate-core/src/main/java/org/hibernate/param/DynamicFilterParameterSpecification.java +++ b/hibernate-core/src/main/java/org/hibernate/param/DynamicFilterParameterSpecification.java @@ -17,7 +17,7 @@ /** * A specialized ParameterSpecification impl for dealing with a dynamic filter parameters. - * + * * @see org.hibernate.Session#enableFilter(String) * * @author Steve Ebersole @@ -32,7 +32,7 @@ public class DynamicFilterParameterSpecification implements ParameterSpecificati * * @param filterName The name of the filter * @param parameterName The name of the parameter - * @param definedParameterType The paremeter type specified on the filter metadata + * @param definedParameterType The parameter type specified on the filter metadata */ public DynamicFilterParameterSpecification( String filterName, diff --git a/hibernate-core/src/main/java/org/hibernate/param/ParameterBinder.java b/hibernate-core/src/main/java/org/hibernate/param/ParameterBinder.java index 6a88b02fe8..33ee2a49cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/param/ParameterBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/param/ParameterBinder.java @@ -25,7 +25,7 @@ public interface ParameterBinder { * @param position The position from which to start binding value(s). * * @return The number of sql bind positions "eaten" by this bind operation. - * @throws java.sql.SQLException Indicates problems performing the JDBC biind operation. + * @throws java.sql.SQLException Indicates problems performing the JDBC bind operation. */ int bind(PreparedStatement statement, QueryParameters qp, SharedSessionContractImplementor session, int position) throws SQLException; diff --git a/hibernate-core/src/main/java/org/hibernate/param/ParameterSpecification.java b/hibernate-core/src/main/java/org/hibernate/param/ParameterSpecification.java index 2c1d64a9d1..062235cd0a 100644 --- a/hibernate-core/src/main/java/org/hibernate/param/ParameterSpecification.java +++ b/hibernate-core/src/main/java/org/hibernate/param/ParameterSpecification.java @@ -18,7 +18,7 @@ */ public interface ParameterSpecification extends ParameterBinder { /** - * Get the type which we are expeting for a bind into this parameter based + * Get the type which we are expecting for a bind into this parameter based * on translated contextual information. * * @return The expected type. diff --git a/hibernate-core/src/main/java/org/hibernate/param/PositionalParameterSpecification.java b/hibernate-core/src/main/java/org/hibernate/param/PositionalParameterSpecification.java index 178fb5c5f3..403dbd4e26 100644 --- a/hibernate-core/src/main/java/org/hibernate/param/PositionalParameterSpecification.java +++ b/hibernate-core/src/main/java/org/hibernate/param/PositionalParameterSpecification.java @@ -44,7 +44,7 @@ public PositionalParameterSpecification( * * @param statement The statement into which the value should be bound. * @param qp The defined values for the current query execution. - * @param session The session against which the current execution is occuring. + * @param session The session against which the current execution is occurring. * @param position The position from which to start binding value(s). * * @return The number of sql bind positions "eaten" by this bind operation. diff --git a/hibernate-core/src/main/java/org/hibernate/param/VersionTypeSeedParameterSpecification.java b/hibernate-core/src/main/java/org/hibernate/param/VersionTypeSeedParameterSpecification.java index 669b1eb1f5..9693c9d293 100644 --- a/hibernate-core/src/main/java/org/hibernate/param/VersionTypeSeedParameterSpecification.java +++ b/hibernate-core/src/main/java/org/hibernate/param/VersionTypeSeedParameterSpecification.java @@ -15,7 +15,7 @@ import org.hibernate.type.VersionType; /** - * Parameter bind specification used for optimisitc lock version seeding (from insert statements). + * Parameter bind specification used for optimistic lock version seeding (from insert statements). * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java index 6e21f10ced..8956498021 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java @@ -143,7 +143,7 @@ Object readIdentifier( /** * Is this a many-to-many association? Note that this is mainly * a convenience feature as the single persister does not - * conatin all the information needed to handle a many-to-many + * contain all the information needed to handle a many-to-many * itself, as internally it is looked at as two many-to-ones. */ boolean isManyToMany(); @@ -160,7 +160,7 @@ Object readIdentifier( boolean isLazy(); /** * Is this collection "inverse", so state changes are not - * propogated to the database. + * propagated to the database. */ boolean isInverse(); /** @@ -201,7 +201,7 @@ void insertRows( Serializable key, SharedSessionContractImplementor session) throws HibernateException; - + /** * Process queued operations within the PersistentCollection. */ @@ -210,7 +210,7 @@ void processQueuedOps( Serializable key, SharedSessionContractImplementor session) throws HibernateException; - + /** * Get the name of this collection role (the fully qualified class name, * extended by a "property path") @@ -253,22 +253,22 @@ void processQueuedOps( * foreign key constraint definition? */ boolean isCascadeDeleteEnabled(); - + /** - * Does this collection cause version increment of the + * Does this collection cause version increment of the * owning entity? */ boolean isVersioned(); - + /** * Can the elements of this collection change? */ boolean isMutable(); - + //public boolean isSubselectLoadable(); - + void postInstantiate() throws MappingException; - + SessionFactoryImplementor getFactory(); boolean isAffectedByEnabledFilters(SharedSessionContractImplementor session); @@ -308,7 +308,7 @@ void processQueuedOps( * @return The key column aliases. */ String getIdentifierColumnAlias(String suffix); - + boolean isExtraLazy(); int getSize(Serializable key, SharedSessionContractImplementor session); boolean indexExists(Serializable key, Object index, SharedSessionContractImplementor session); diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index ce1953c3dd..b2d2517ff3 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -1441,7 +1441,7 @@ public String[] getPropertyAliases(String suffix, int i) { public String getDiscriminatorAlias(String suffix) { // NOTE: this assumes something about how propertySelectFragment is implemented by the subclass! - // was toUnqotedAliasStrings( getdiscriminatorColumnName() ) before - now tried + // toUnqotedAliasStrings( getdiscriminatorColumnName() ) before - now tried // to remove that unqoting and missing aliases.. return entityMetamodel.hasSubclasses() ? new Alias( suffix ).toAliasString( getDiscriminatorAlias() ) : @@ -2794,7 +2794,7 @@ else if ( includeProperty[i] ) { } /** - * Used to generate an insery statement against the root table in the + * Used to generate an insert statement against the root table in the * case of identifier generation strategies where the insert statement * executions actually generates the identifier value. * @@ -2972,7 +2972,7 @@ else if ( id != null ) { } /** - * Unmarshall the fields of a persistent instance from a result set, + * Unmarshal the fields of a persistent instance from a result set, * without resolving associations or collections. Question: should * this really be here, or should it be sent back to Loader? */ diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java index e214bb8c4f..e5195da47d 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java @@ -396,7 +396,7 @@ default Object load(Serializable id, Object optionalObject, LockOptions lockOpti * Performs a load of multiple entities (of this type) by identifier simultaneously. * * @param ids The identifiers to load - * @param session The originating Sesison + * @param session The originating Session * @param loadOptions The options for loading * * @return The loaded, matching entities diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java index 2b9d726a3c..bd1fd7c472 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java @@ -47,8 +47,8 @@ /** * The default implementation of the EntityPersister interface. * Implements the "table-per-class-hierarchy" or "roll-up" mapping strategy - * for an entity class and its inheritence hierarchy. This is implemented - * as a single table holding all classes in the hierarchy with a discrimator + * for an entity class and its inheritance hierarchy. This is implemented + * as a single table holding all classes in the hierarchy with a discriminator * column used to determine which concrete class is referenced. * * @author Gavin King diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java index 090d00a001..cb3ed30119 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/UnionSubclassEntityPersister.java @@ -46,7 +46,7 @@ /** * Implementation of the "table-per-concrete-class" or "roll-down" mapping - * strategy for an entity and its inheritence hierarchy. + * strategy for an entity and its inheritance hierarchy. * * @author Gavin King */ diff --git a/hibernate-core/src/main/java/org/hibernate/persister/spi/UnknownPersisterException.java b/hibernate-core/src/main/java/org/hibernate/persister/spi/UnknownPersisterException.java index 9e1044d1ef..a43d4fc237 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/spi/UnknownPersisterException.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/spi/UnknownPersisterException.java @@ -9,8 +9,8 @@ import org.hibernate.HibernateException; /** - * Indicates that the persister to use is not known and couyld not be determined. - * + * Indicates that the persister to use is not known and could not be determined. + * * @author Steve Ebersole */ public class UnknownPersisterException extends HibernateException { diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/ParameterRegistration.java b/hibernate-core/src/main/java/org/hibernate/procedure/ParameterRegistration.java index b36f656052..28b5ce4711 100644 --- a/hibernate-core/src/main/java/org/hibernate/procedure/ParameterRegistration.java +++ b/hibernate-core/src/main/java/org/hibernate/procedure/ParameterRegistration.java @@ -30,7 +30,7 @@ public interface ParameterRegistration extends ProcedureParameter { /** * The position at which this parameter was registered. Can be {@code null} which should indicate that - * named registration was used (and therefore {@link #getName()} should return non-null. + * named registration was used (and therefore {@link #getName()} should return non-null). * * @return The name; */ diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/spi/EnhancedSetterImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/spi/EnhancedSetterImpl.java index 89e90c9d03..637e2a2879 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/spi/EnhancedSetterImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/spi/EnhancedSetterImpl.java @@ -17,7 +17,7 @@ /** * A specialized Setter implementation for handling setting values into - * a into a bytecode-enhanced Class. The reason we need specialized handling + * a bytecode-enhanced Class. The reason we need specialized handling * is to render the fact that we need to account for certain enhancement features * during the setting process. * diff --git a/hibernate-core/src/main/java/org/hibernate/proxy/LazyInitializer.java b/hibernate-core/src/main/java/org/hibernate/proxy/LazyInitializer.java index 023bf4592c..36efc40746 100644 --- a/hibernate-core/src/main/java/org/hibernate/proxy/LazyInitializer.java +++ b/hibernate-core/src/main/java/org/hibernate/proxy/LazyInitializer.java @@ -54,7 +54,7 @@ public interface LazyInitializer { Class getPersistentClass(); /** - * Is the proxy uninitialzed? + * Is the proxy uninitialized? * * @return True if uninitialized; false otherwise. */ @@ -94,7 +94,7 @@ public interface LazyInitializer { boolean isReadOnlySettingAvailable(); /** - * Is the proxy read-only?. + * Is the proxy read-only? * * The read-only/modifiable setting is not available when the proxy is * detached or its associated session is closed. @@ -103,7 +103,7 @@ public interface LazyInitializer { * * @return true, if this proxy is read-only; false, otherwise * @throws org.hibernate.TransientObjectException if the proxy is detached (getSession() == null) - * @throws org.hibernate.SessionException if the proxy is associated with a sesssion that is closed + * @throws org.hibernate.SessionException if the proxy is associated with a session that is closed * * @see org.hibernate.proxy.LazyInitializer#isReadOnlySettingAvailable() * @see org.hibernate.Session#isReadOnly(Object entityOrProxy) @@ -125,7 +125,7 @@ public interface LazyInitializer { * if false, the associated proxy is made modifiable. * @throws org.hibernate.TransientObjectException if the proxy is not association with a session * @throws org.hibernate.SessionException if the proxy is associated with a session that is closed - * + * * @see org.hibernate.Session#setReadOnly(Object entityOrProxy, boolean readOnly) */ void setReadOnly(boolean readOnly); @@ -141,9 +141,9 @@ public interface LazyInitializer { * Associate the proxy with the given session. *

              * Care should be given to make certain that the proxy is added to the session's persistence context as well - * to maintain the symetry of the association. That must be done seperately as this method simply sets an + * to maintain the symmetry of the association. That must be done separately as this method simply sets an * internal reference. We do also check that if there is already an associated session that the proxy - * reference was removed from that previous session's persistence contet. + * reference was removed from that previous session's persistence context. * * @param session The session * @throws HibernateException Indicates that the proxy was still contained in the persistence context of the @@ -159,7 +159,7 @@ public interface LazyInitializer { * {@link org.hibernate.Session#clear} processing; most other use-cases should call {@link #setSession} instead. */ void unsetSession(); - + void setUnwrap(boolean unwrap); boolean isUnwrap(); } diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/ParameterContainer.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/ParameterContainer.java index 54fe2a63e3..709ecc0698 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/ParameterContainer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/ParameterContainer.java @@ -8,7 +8,7 @@ import javax.persistence.criteria.Selection; /** - * Contract for query components capable of eirther being a parameter or containing parameters. + * Contract for query components capable of either being a parameter or containing parameters. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/BinaryArithmeticOperation.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/BinaryArithmeticOperation.java index eda788a957..83223ebe9b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/BinaryArithmeticOperation.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/BinaryArithmeticOperation.java @@ -16,7 +16,7 @@ import org.hibernate.query.criteria.internal.predicate.ImplicitNumericExpressionTypeDeterminer; /** - * Models standard arithmetc operations with two operands. + * Models standard arithmetic operations with two operands. * * @author Steve Ebersole */ @@ -105,7 +105,7 @@ public static Class determineResultType( public static Class determineReturnType( Class defaultType, Expression expression) { - return expression == null || expression.getJavaType() == null + return expression == null || expression.getJavaType() == null ? defaultType : expression.getJavaType(); } @@ -125,7 +125,7 @@ public static Class determineReturnType( } /** - * Creates an arithmethic operation based on 2 expressions. + * Creates an arithmetic operation based on 2 expressions. * * @param criteriaBuilder The builder for query components. * @param resultType The operation result type @@ -146,7 +146,7 @@ public BinaryArithmeticOperation( } /** - * Creates an arithmethic operation based on an expression and a literal. + * Creates an arithmetic operation based on an expression and a literal. * * @param criteriaBuilder The builder for query components. * @param javaType The operation result type diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/SubqueryComparisonModifierExpression.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/SubqueryComparisonModifierExpression.java index e262f08fdb..f1335de666 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/SubqueryComparisonModifierExpression.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/expression/SubqueryComparisonModifierExpression.java @@ -15,7 +15,7 @@ import org.hibernate.query.criteria.internal.compile.RenderingContext; /** - * Represents a {@link Modifier#ALL}, {@link Modifier#ANY}, {@link Modifier#SOME} modifier appplied to a subquery as + * Represents a {@link Modifier#ALL}, {@link Modifier#ANY}, {@link Modifier#SOME} modifier applied to a subquery as * part of a comparison. * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/NullnessPredicate.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/NullnessPredicate.java index 1217931be5..2bfac24354 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/NullnessPredicate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/NullnessPredicate.java @@ -30,7 +30,7 @@ public class NullnessPredicate private final Expression operand; /** - * Constructs the affirmitive form of nullness checking (IS NULL). To + * Constructs the affirmative form of nullness checking (IS NULL). To * construct the negative form (IS NOT NULL) call {@link #not} on the * constructed instance. * diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/TruthValue.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/TruthValue.java index 34021f940b..eeb08dc291 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/TruthValue.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/internal/predicate/TruthValue.java @@ -13,7 +13,7 @@ * boolean expression (the syntax is like a > b IS TRUE. IS TRUE is the assumed default. *

              * JPA defines support for only IS TRUE and IS FALSE, not IS UNKNOWN (a > NULL - * is an example where the result would be UNKNOWN). All 3 are provided here for completness. + * is an example where the result would be UNKNOWN). All 3 are provided here for completeness. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/resource/jdbc/LogicalConnection.java b/hibernate-core/src/main/java/org/hibernate/resource/jdbc/LogicalConnection.java index 2386575cda..9366f2834a 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/jdbc/LogicalConnection.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/jdbc/LogicalConnection.java @@ -19,7 +19,7 @@ public interface LogicalConnection { * Is this (logical) JDBC Connection still open/active. In other words, has {@link #close} not been called yet? * * @return {@code true} if still open ({@link #close} has not been called yet); {@code false} if not open - * (({@link #close} has been called). + * ({@link #close} has been called). */ boolean isOpen(); diff --git a/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/TransactionCoordinatorOwner.java b/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/TransactionCoordinatorOwner.java index fbde477e74..2863165386 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/TransactionCoordinatorOwner.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/transaction/spi/TransactionCoordinatorOwner.java @@ -52,7 +52,7 @@ default void startTransactionBoundary() { * An after-completion callback from the coordinator to its owner. * * @param successful Was the transaction successful? - * @param delayed Is this a delayed after transaction completion call (aka after a timeout)? + * @param delayed Is this delayed after transaction completion call (aka after a timeout)? */ void afterTransactionCompletion(boolean successful, boolean delayed); diff --git a/hibernate-core/src/main/java/org/hibernate/service/UnknownServiceException.java b/hibernate-core/src/main/java/org/hibernate/service/UnknownServiceException.java index 5efaf0e13c..8f3b04677c 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/UnknownServiceException.java +++ b/hibernate-core/src/main/java/org/hibernate/service/UnknownServiceException.java @@ -8,7 +8,7 @@ import org.hibernate.HibernateException; /** - * Indicates that an unkown service was requested from the registry. + * Indicates that an unknown service was requested from the registry. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/service/internal/ServiceDependencyException.java b/hibernate-core/src/main/java/org/hibernate/service/internal/ServiceDependencyException.java index 29e953c27e..49ce8281a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/internal/ServiceDependencyException.java +++ b/hibernate-core/src/main/java/org/hibernate/service/internal/ServiceDependencyException.java @@ -8,7 +8,7 @@ import org.hibernate.HibernateException; /** - * Indictes a problem processing service dependencies. + * Indicates a problem processing service dependencies. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/service/spi/Manageable.java b/hibernate-core/src/main/java/org/hibernate/service/spi/Manageable.java index 4719a29375..afc47301bc 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/spi/Manageable.java +++ b/hibernate-core/src/main/java/org/hibernate/service/spi/Manageable.java @@ -35,7 +35,7 @@ default String getManagementServiceType() { } /** - * The the management bean (MBean) for this service. + * The management bean (MBean) for this service. * * @return The management bean. */ diff --git a/hibernate-core/src/main/java/org/hibernate/service/spi/OptionallyManageable.java b/hibernate-core/src/main/java/org/hibernate/service/spi/OptionallyManageable.java index 5e08a462cb..f3c486e97c 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/spi/OptionallyManageable.java +++ b/hibernate-core/src/main/java/org/hibernate/service/spi/OptionallyManageable.java @@ -11,7 +11,7 @@ /** * Extension to Manageable for things that are optionally Manageable depending * on some internal state. E.g. services that wrap other services wanting to - * delegate manageablity if the wrapped service is Manageable. + * delegate manageability if the wrapped service is Manageable. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/service/spi/Wrapped.java b/hibernate-core/src/main/java/org/hibernate/service/spi/Wrapped.java index 953fdc6f98..9dd667fcdb 100644 --- a/hibernate-core/src/main/java/org/hibernate/service/spi/Wrapped.java +++ b/hibernate-core/src/main/java/org/hibernate/service/spi/Wrapped.java @@ -30,7 +30,7 @@ public interface Wrapped { * * @return The unwrapped reference * - * @throws UnknownUnwrapTypeException if the servicebe unwrapped as the indicated type + * @throws UnknownUnwrapTypeException if the service cannot be unwrapped as the indicated type */ public T unwrap(Class unwrapType); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java b/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java index ee21fb2231..7779fff995 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/OracleJoinFragment.java @@ -153,7 +153,7 @@ else if ( joinType == JoinType.LEFT_OUTER_JOIN ) { * This method is a bit of a hack, and assumes * that the column on the "right" side of the * join appears on the "left" side of the - * operator, which is extremely wierd if this + * operator, which is extremely weird if this * was a normal join condition, but is natural * for a filter. */ diff --git a/hibernate-core/src/main/java/org/hibernate/sql/SelectValues.java b/hibernate-core/src/main/java/org/hibernate/sql/SelectValues.java index 80233b8a4e..dd3acd306d 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/SelectValues.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/SelectValues.java @@ -15,7 +15,7 @@ /** * Models a SELECT values lists. Eventually, rather than Strings, pass in the Column/Formula representations (something - * like {@link org.hibernate.sql.ordering.antlr.ColumnReference}/{@link org.hibernate.sql.ordering.antlr.FormulaReference} + * like {@link org.hibernate.sql.ordering.antlr.ColumnReference}/{@link org.hibernate.sql.ordering.antlr.FormulaReference}) * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/NodeSupport.java b/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/NodeSupport.java index faeec0922f..ead33d269e 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/NodeSupport.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ordering/antlr/NodeSupport.java @@ -9,7 +9,7 @@ import antlr.CommonAST; /** - * Basic implementation of a {@link Node} briding to the Antlr {@link CommonAST} hierarchy. + * Basic implementation of a {@link Node} bridging to the Antlr {@link CommonAST} hierarchy. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/stat/internal/DeprecatedNaturalIdCacheStatisticsImpl.java b/hibernate-core/src/main/java/org/hibernate/stat/internal/DeprecatedNaturalIdCacheStatisticsImpl.java index 74eb0bb43f..3dc5add036 100644 --- a/hibernate-core/src/main/java/org/hibernate/stat/internal/DeprecatedNaturalIdCacheStatisticsImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/stat/internal/DeprecatedNaturalIdCacheStatisticsImpl.java @@ -63,7 +63,7 @@ public long getExecutionCount() { } /** - * average time in ms taken by the excution of this query onto the DB + * average time in ms taken by the execution of this query onto the DB */ @Override public long getExecutionAvgTime() { @@ -84,7 +84,7 @@ public long getExecutionAvgTime() { } /** - * max time in ms taken by the excution of this query onto the DB + * max time in ms taken by the execution of this query onto the DB */ @Override public long getExecutionMaxTime() { @@ -92,7 +92,7 @@ public long getExecutionMaxTime() { } /** - * min time in ms taken by the excution of this query onto the DB + * min time in ms taken by the execution of this query onto the DB */ @Override public long getExecutionMinTime() { diff --git a/hibernate-core/src/main/java/org/hibernate/stat/internal/NaturalIdStatisticsImpl.java b/hibernate-core/src/main/java/org/hibernate/stat/internal/NaturalIdStatisticsImpl.java index 17428ffc84..217bdb0a3a 100644 --- a/hibernate-core/src/main/java/org/hibernate/stat/internal/NaturalIdStatisticsImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/stat/internal/NaturalIdStatisticsImpl.java @@ -18,7 +18,7 @@ /** * NaturalId cache statistics of a specific entity - * + * * @author Eric Dalquist */ public class NaturalIdStatisticsImpl extends AbstractCacheableDataStatistics implements NaturalIdStatistics, Serializable { @@ -53,7 +53,7 @@ public long getExecutionCount() { } /** - * average time in ms taken by the excution of this query onto the DB + * average time in ms taken by the execution of this query onto the DB */ @Override public long getExecutionAvgTime() { @@ -74,7 +74,7 @@ public long getExecutionAvgTime() { } /** - * max time in ms taken by the excution of this query onto the DB + * max time in ms taken by the execution of this query onto the DB */ @Override public long getExecutionMaxTime() { diff --git a/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SingleLineSqlCommandExtractor.java b/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SingleLineSqlCommandExtractor.java index e794b39444..5885974ef9 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SingleLineSqlCommandExtractor.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/hbm2ddl/SingleLineSqlCommandExtractor.java @@ -15,7 +15,7 @@ import org.hibernate.internal.util.StringHelper; /** - * Class responsible for extracting SQL statements from import script. Treads each line as a complete SQL statement. + * Class responsible for extracting SQL statements from import script. Treats each line as a complete SQL statement. * Comment lines shall start with {@code --}, {@code //} or {@code /*} character sequence. * * @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com) diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java index 090cd960d8..fa7d0a4f3b 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/DatabaseInformation.java @@ -54,7 +54,7 @@ public interface DatabaseInformation { /** * Obtain reference to the named TableInformation * - * @param tableName The qualfied table name + * @param tableName The qualified table name * * @return The table information. May return {@code null} if not found. */ diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/SequenceInformationExtractor.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/SequenceInformationExtractor.java index 094d1edbbc..59d0f6657e 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/SequenceInformationExtractor.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/spi/SequenceInformationExtractor.java @@ -9,7 +9,7 @@ import java.sql.SQLException; /** - * Because JDBC (at least up to an including Java 7, JDBC 4) still does not have support for obtaining information + * Because JDBC (at least up to and including Java 7, JDBC 4) still does not have support for obtaining information * about sequences from DatabaseMetaData. * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanConstructorResultTransformer.java b/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanConstructorResultTransformer.java index e785fbcf9a..381ef85373 100644 --- a/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanConstructorResultTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanConstructorResultTransformer.java @@ -1,74 +1,74 @@ -/* - * 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 . - */ -package org.hibernate.transform; -import java.lang.reflect.Constructor; -import java.util.List; - -import org.hibernate.QueryException; - -/** - * Wraps the tuples in a constructor call. - * - * todo : why Alias* in the name??? - */ -public class AliasToBeanConstructorResultTransformer implements ResultTransformer { - - private final Constructor constructor; - - /** - * Instantiates a AliasToBeanConstructorResultTransformer. - * - * @param constructor The contructor in which to wrap the tuples. - */ - public AliasToBeanConstructorResultTransformer(Constructor constructor) { - this.constructor = constructor; - } - - /** - * Wrap the incoming tuples in a call to our configured constructor. - */ - @Override - public Object transformTuple(Object[] tuple, String[] aliases) { - try { - return constructor.newInstance( tuple ); - } - catch ( Exception e ) { - throw new QueryException( - "could not instantiate class [" + constructor.getDeclaringClass().getName() + "] from tuple", - e - ); - } - } - - @Override - public List transformList(List collection) { - return collection; - } - - /** - * Define our hashCode by our defined constructor's hasCode. - * - * @return Our defined ctor hashCode - */ - @Override - public int hashCode() { - return constructor.hashCode(); - } - - /** - * 2 AliasToBeanConstructorResultTransformer are considered equal if they have the same - * defined constructor. - * - * @param other The other instance to check for equality. - * @return True if both have the same defined constuctor; false otherwise. - */ - @Override - public boolean equals(Object other) { - return other instanceof AliasToBeanConstructorResultTransformer - && constructor.equals( ( ( AliasToBeanConstructorResultTransformer ) other ).constructor ); - } -} +/* + * 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 . + */ +package org.hibernate.transform; +import java.lang.reflect.Constructor; +import java.util.List; + +import org.hibernate.QueryException; + +/** + * Wraps the tuples in a constructor call. + * + * todo : why Alias* in the name??? + */ +public class AliasToBeanConstructorResultTransformer implements ResultTransformer { + + private final Constructor constructor; + + /** + * Instantiates a AliasToBeanConstructorResultTransformer. + * + * @param constructor The constructor in which to wrap the tuples. + */ + public AliasToBeanConstructorResultTransformer(Constructor constructor) { + this.constructor = constructor; + } + + /** + * Wrap the incoming tuples in a call to our configured constructor. + */ + @Override + public Object transformTuple(Object[] tuple, String[] aliases) { + try { + return constructor.newInstance( tuple ); + } + catch ( Exception e ) { + throw new QueryException( + "could not instantiate class [" + constructor.getDeclaringClass().getName() + "] from tuple", + e + ); + } + } + + @Override + public List transformList(List collection) { + return collection; + } + + /** + * Define our hashCode by our defined constructor's hasCode. + * + * @return Our defined ctor hashCode + */ + @Override + public int hashCode() { + return constructor.hashCode(); + } + + /** + * 2 AliasToBeanConstructorResultTransformer are considered equal if they have the same + * defined constructor. + * + * @param other The other instance to check for equality. + * @return True if both have the same defined constructor; false otherwise. + */ + @Override + public boolean equals(Object other) { + return other instanceof AliasToBeanConstructorResultTransformer + && constructor.equals( ( ( AliasToBeanConstructorResultTransformer ) other ).constructor ); + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/transform/CacheableResultTransformer.java b/hibernate-core/src/main/java/org/hibernate/transform/CacheableResultTransformer.java index bdf98e7c13..1a1e40109f 100644 --- a/hibernate-core/src/main/java/org/hibernate/transform/CacheableResultTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/transform/CacheableResultTransformer.java @@ -177,7 +177,7 @@ public Object transformTuple(Object[] tuple, String[] aliases) { * @param transformer - the transformer for the re-transformation * @param includeInTuple indicates the indexes of * - * @return transformedResults, with each element re-transformed (if nececessary) + * @return transformedResults, with each element re-transformed (if necessary) */ @SuppressWarnings( {"unchecked"}) public List retransformResults( @@ -230,7 +230,7 @@ else if ( transformer instanceof TupleSubsetResultTransformer ) { * tuple, then, on return, elements corresponding to * excluded tuple elements will be null. * @param results - results that were previously transformed - * @return results, with each element untransformed (if nececessary) + * @return results, with each element untransformed (if necessary) */ @SuppressWarnings( {"unchecked"}) public List untransformToTuples(List results) { diff --git a/hibernate-core/src/main/java/org/hibernate/transform/ToListResultTransformer.java b/hibernate-core/src/main/java/org/hibernate/transform/ToListResultTransformer.java index aaa862ad34..943d016394 100644 --- a/hibernate-core/src/main/java/org/hibernate/transform/ToListResultTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/transform/ToListResultTransformer.java @@ -1,36 +1,36 @@ -/* - * 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 . - */ -package org.hibernate.transform; - -import java.util.Arrays; - -/** - * Tranforms each result row from a tuple into a {@link java.util.List} whose elements are each tuple value - */ -public class ToListResultTransformer extends BasicTransformerAdapter { - public static final ToListResultTransformer INSTANCE = new ToListResultTransformer(); - - /** - * Disallow instantiation of ToListResultTransformer. - */ - private ToListResultTransformer() { - } - - @Override - public Object transformTuple(Object[] tuple, String[] aliases) { - return Arrays.asList( tuple ); - } - - /** - * Serialization hook for ensuring singleton uniqueing. - * - * @return The singleton instance : {@link #INSTANCE} - */ - private Object readResolve() { - return INSTANCE; - } -} +/* + * 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 . + */ +package org.hibernate.transform; + +import java.util.Arrays; + +/** + * Transforms each result row from a tuple into a {@link java.util.List} whose elements are each tuple value + */ +public class ToListResultTransformer extends BasicTransformerAdapter { + public static final ToListResultTransformer INSTANCE = new ToListResultTransformer(); + + /** + * Disallow instantiation of ToListResultTransformer. + */ + private ToListResultTransformer() { + } + + @Override + public Object transformTuple(Object[] tuple, String[] aliases) { + return Arrays.asList( tuple ); + } + + /** + * Serialization hook for ensuring singleton uniqueing. + * + * @return The singleton instance : {@link #INSTANCE} + */ + private Object readResolve() { + return INSTANCE; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/transform/Transformers.java b/hibernate-core/src/main/java/org/hibernate/transform/Transformers.java index 2f868d823a..a5b569458c 100644 --- a/hibernate-core/src/main/java/org/hibernate/transform/Transformers.java +++ b/hibernate-core/src/main/java/org/hibernate/transform/Transformers.java @@ -1,33 +1,33 @@ -/* - * 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 . - */ -package org.hibernate.transform; - - -final public class Transformers { - - private Transformers() {} - - /** - * Each row of results is a Map from alias to values/entities - */ - public static final AliasToEntityMapResultTransformer ALIAS_TO_ENTITY_MAP = - AliasToEntityMapResultTransformer.INSTANCE; - - /** - * Each row of results is a List - */ - public static final ToListResultTransformer TO_LIST = ToListResultTransformer.INSTANCE; - - /** - * Creates a resulttransformer that will inject aliased values into - * instances of Class via property methods or fields. - */ - public static ResultTransformer aliasToBean(Class target) { - return new AliasToBeanResultTransformer(target); - } - -} +/* + * 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 . + */ +package org.hibernate.transform; + + +final public class Transformers { + + private Transformers() {} + + /** + * Each row of results is a Map from alias to values/entities + */ + public static final AliasToEntityMapResultTransformer ALIAS_TO_ENTITY_MAP = + AliasToEntityMapResultTransformer.INSTANCE; + + /** + * Each row of results is a List + */ + public static final ToListResultTransformer TO_LIST = ToListResultTransformer.INSTANCE; + + /** + * Creates a resulttransformer that will inject aliased values into + * instances of Class via property methods or fields. + */ + public static ResultTransformer aliasToBean(Class target) { + return new AliasToBeanResultTransformer(target); + } + +} diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/Tuplizer.java b/hibernate-core/src/main/java/org/hibernate/tuple/Tuplizer.java index 5de7424fa8..65faa25f62 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/Tuplizer.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/Tuplizer.java @@ -69,9 +69,9 @@ public interface Tuplizer { * @return The new, empty entity instance. */ public Object instantiate(); - + /** - * Is the given object considered an instance of the the entity (acconting + * Is the given object considered an instance of the the entity (accounting * for entity-mode) managed by this tuplizer. * * @param object The object to be checked. diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/component/ComponentTuplizer.java b/hibernate-core/src/main/java/org/hibernate/tuple/component/ComponentTuplizer.java index 609923b05e..916e02b6d5 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/component/ComponentTuplizer.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/component/ComponentTuplizer.java @@ -17,7 +17,7 @@ *

              * ComponentTuplizer implementations should have the following constructor signature: * (org.hibernate.mapping.Component) - * + * * @author Gavin King * @author Steve Ebersole */ @@ -35,13 +35,13 @@ public interface ComponentTuplizer extends Tuplizer, Serializable { * Set the value of the parent property. * * @param component The component instance on which to set the parent. - * @param parent The parent to be set on the comonent. + * @param parent The parent to be set on the component. * @param factory The current session factory. */ public void setParent(Object component, Object parent, SessionFactoryImplementor factory); /** - * Does the component managed by this tuuplizer contain a parent property? + * Does the component managed by this tuplizer contain a parent property? * * @return True if the component does contain a parent property; false otherwise. */ diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java index f9a79e2e8c..68b8b9d22f 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizer.java @@ -19,7 +19,7 @@ import org.hibernate.tuple.Tuplizer; /** - * Defines further responsibilities reagarding tuplization based on + * Defines further responsibilities regarding tuplization based on * a mapped entity. *

              * EntityTuplizer implementations should have the following constructor signatures: @@ -169,7 +169,7 @@ public interface EntityTuplizer extends Tuplizer { * * @param entity The entity from which to extract. * @param mergeMap a map of instances being merged to merged instances - * @param session The session in which the resuest is being made. + * @param session The session in which the result set is being made. * @return The insertable property values. * @throws HibernateException Indicates a problem access the properties */ @@ -240,7 +240,7 @@ Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionCon /** * Given an entity instance, determine the most appropriate (most targeted) entity-name which represents it. * This is called in situations where we already know an entity name for the given entityInstance; we are being - * asked to determine if there is a more appropriate entity-name to use, specifically within an inheritence + * asked to determine if there is a more appropriate entity-name to use, specifically within an inheritance * hierarchy. *

              * For example, consider a case where a user calls session.update( "Animal", cat );. Here, the @@ -248,7 +248,7 @@ Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionCon * of Cat which is a subclass of Animal. In this case, we would return Cat as the * entity-name. *

              - * null may be returned from calls to this method. The meaining of null in that case is assumed + * null may be returned from calls to this method. The meaning of null in that case is assumed * to be that we should use whatever explicit entity-name the user provided (Animal rather than Cat * in the example above). * @@ -257,7 +257,7 @@ Object[] getPropertyValuesToInsert(Object entity, Map mergeMap, SharedSessionCon * * @return The most appropriate entity name to use. * - * @throws HibernateException If we are unable to determine an entity-name within the inheritence hierarchy. + * @throws HibernateException If we are unable to determine an entity-name within the inheritance hierarchy. */ String determineConcreteSubclassEntityName(Object entityInstance, SessionFactoryImplementor factory); diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java index ea0e52ebf7..8a84a5df6f 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityTuplizerFactory.java @@ -93,7 +93,7 @@ public EntityTuplizer constructTuplizer( } /** - * Construct am instance of the default tuplizer for the given entity-mode. + * Construct an instance of the default tuplizer for the given entity-mode. * * @param entityMode The entity mode for which to build a default tuplizer. * @param metamodel The entity metadata. diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java b/hibernate-core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java index 57c61115c8..f22c752438 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java @@ -92,7 +92,7 @@ public PojoEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappe protected ProxyFactory buildProxyFactory(PersistentClass persistentClass, Getter idGetter, Setter idSetter) { // determine the id getter and setter methods from the proxy interface (if any) // determine all interfaces needed by the resulting proxy - + /* * We need to preserve the order of the interfaces they were put into the set, since javassist will choose the * first one's class-loader to construct the proxy class with. This is also the reason why HibernateProxy.class diff --git a/hibernate-core/src/main/java/org/hibernate/type/ArrayType.java b/hibernate-core/src/main/java/org/hibernate/type/ArrayType.java index 805b3c333f..9593c3c582 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ArrayType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ArrayType.java @@ -33,7 +33,7 @@ public class ArrayType extends CollectionType { private final Class arrayClass; /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public ArrayType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Class elementClass) { @@ -104,23 +104,23 @@ public Object instantiateResult(Object original) { public Object replaceElements( Object original, Object target, - Object owner, + Object owner, Map copyCache, SharedSessionContractImplementor session) throws HibernateException { - + int length = Array.getLength(original); if ( length!=Array.getLength(target) ) { //note: this affects the return value! target=instantiateResult(original); } - + Type elemType = getElementType( session.getFactory() ); for ( int i=0; iPersistentCollection - * + * * @see org.hibernate.collection.spi.PersistentCollection * @see org.hibernate.usertype.UserCollectionType * @author Gavin King @@ -33,7 +33,7 @@ public class CustomCollectionType extends CollectionType { private final boolean customLogging; /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public CustomCollectionType( diff --git a/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java b/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java index a1f5818cb0..1dd70d4064 100755 --- a/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/EmbeddedComponentType.java @@ -18,7 +18,7 @@ public class EmbeddedComponentType extends ComponentType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public EmbeddedComponentType(TypeFactory.TypeScope typeScope, ComponentMetamodel metamodel) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/EntityType.java b/hibernate-core/src/main/java/org/hibernate/type/EntityType.java index 4a17b60c24..b553962778 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/EntityType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/EntityType.java @@ -68,7 +68,7 @@ public abstract class EntityType extends AbstractType implements AssociationType * reference the PK of the associated entity. * @param eager Is eager fetching enabled. * @param unwrapProxy Is unwrapping of proxies allowed for this association; unwrapping - * says to return the "implementation target" of lazy prooxies; typically only possible + * says to return the "implementation target" of lazy proxies; typically only possible * with lazy="no-proxy". * * @deprecated Use {@link #EntityType(org.hibernate.type.TypeFactory.TypeScope, String, boolean, String, boolean, boolean)} instead. @@ -93,7 +93,7 @@ protected EntityType( * reference the PK of the associated entity. * @param eager Is eager fetching enabled. * @param unwrapProxy Is unwrapping of proxies allowed for this association; unwrapping - * says to return the "implementation target" of lazy prooxies; typically only possible + * says to return the "implementation target" of lazy proxies; typically only possible * with lazy="no-proxy". */ protected EntityType( @@ -236,7 +236,7 @@ public Joinable getAssociatedJoinable(SessionFactoryImplementor factory) throws * entity persister (nor to the session factory, to look it up) which is really * needed to "do the right thing" here... * - * @return The entiyt class. + * @return The entity class. */ @Override public final Class getReturnedClass() { @@ -567,7 +567,7 @@ public String toLoggableString(Object value, SessionFactoryImplementor factory) public abstract boolean isOneToOne(); /** - * Is the association modeled here a 1-1 according to the logical moidel? + * Is the association modeled here a 1-1 according to the logical model? * * @return True if a 1-1 in the logical model; false otherwise. */ @@ -670,7 +670,7 @@ public final String getIdentifierOrUniqueKeyPropertyName(Mapping factory) * Resolve an identifier via a load. * * @param id The entity id to resolve - * @param session The orginating session. + * @param session The originating session. * * @return The resolved identifier (i.e., loaded entity). * @@ -711,7 +711,7 @@ protected boolean isNull(Object owner, SharedSessionContractImplementor session) * Load an instance by a unique key that is not the primary key. * * @param entityName The name of the entity to load - * @param uniqueKeyPropertyName The name of the property defining the uniqie key. + * @param uniqueKeyPropertyName The name of the property defining the unique key. * @param key The unique key property value. * @param session The originating session. * @@ -742,7 +742,7 @@ public Object loadByUniqueKey( Object result = persistenceContext.getEntity( euk ); if ( result == null ) { result = persister.loadByUniqueKey( uniqueKeyPropertyName, key, session ); - + // If the entity was not in the Persistence Context, but was found now, // add it to the Persistence Context if (result != null) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/IdentifierBagType.java b/hibernate-core/src/main/java/org/hibernate/type/IdentifierBagType.java index 4eb3bfb8eb..5e1e7dff49 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/IdentifierBagType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/IdentifierBagType.java @@ -18,7 +18,7 @@ public class IdentifierBagType extends CollectionType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public IdentifierBagType(TypeFactory.TypeScope typeScope, String role, String propertyRef) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/ListType.java b/hibernate-core/src/main/java/org/hibernate/type/ListType.java index 90992bb741..493b85a5ea 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ListType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ListType.java @@ -18,7 +18,7 @@ public class ListType extends CollectionType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public ListType(TypeFactory.TypeScope typeScope, String role, String propertyRef) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/MapType.java b/hibernate-core/src/main/java/org/hibernate/type/MapType.java index 3c9dc75e6c..81ba9caca9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/MapType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/MapType.java @@ -21,7 +21,7 @@ public class MapType extends CollectionType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public MapType(TypeFactory.TypeScope typeScope, String role, String propertyRef) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/OrderedMapType.java b/hibernate-core/src/main/java/org/hibernate/type/OrderedMapType.java index 9c27015b72..6715a06815 100755 --- a/hibernate-core/src/main/java/org/hibernate/type/OrderedMapType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/OrderedMapType.java @@ -13,7 +13,7 @@ public class OrderedMapType extends MapType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public OrderedMapType(TypeFactory.TypeScope typeScope, String role, String propertyRef) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/OrderedSetType.java b/hibernate-core/src/main/java/org/hibernate/type/OrderedSetType.java index a9355906fa..2b0eb34458 100755 --- a/hibernate-core/src/main/java/org/hibernate/type/OrderedSetType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/OrderedSetType.java @@ -13,7 +13,7 @@ public class OrderedSetType extends SetType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public OrderedSetType(TypeFactory.TypeScope typeScope, String role, String propertyRef) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/SerializationException.java b/hibernate-core/src/main/java/org/hibernate/type/SerializationException.java index 2cc6f7033d..c1f796f65c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SerializationException.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SerializationException.java @@ -8,7 +8,7 @@ import org.hibernate.HibernateException; /** - * Thrown when a property cannot be serializaed/deserialized + * Thrown when a property cannot be serialized/deserialized * @author Gavin King */ public class SerializationException extends HibernateException { diff --git a/hibernate-core/src/main/java/org/hibernate/type/SetType.java b/hibernate-core/src/main/java/org/hibernate/type/SetType.java index 2664b3ad4a..c01301c70a 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SetType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SetType.java @@ -17,7 +17,7 @@ public class SetType extends CollectionType { /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public SetType(TypeFactory.TypeScope typeScope, String role, String propertyRef) { @@ -49,5 +49,5 @@ public Object instantiate(int anticipatedSize) { ? new HashSet() : new HashSet( anticipatedSize + (int)( anticipatedSize * .75f ), .75f ); } - + } diff --git a/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java b/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java index b9e9a60c75..9d1a4e82b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SortedMapType.java @@ -21,7 +21,7 @@ public class SortedMapType extends MapType { private final Comparator comparator; /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public SortedMapType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Comparator comparator) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java b/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java index a23476c98e..125ce710e4 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SortedSetType.java @@ -20,7 +20,7 @@ public class SortedSetType extends SetType { private final Comparator comparator; /** - * @deprecated Use the other contructor + * @deprecated Use the other constructor */ @Deprecated public SortedSetType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Comparator comparator) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/Type.java b/hibernate-core/src/main/java/org/hibernate/type/Type.java index 0008c0cc7e..72bf4b9b67 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/Type.java +++ b/hibernate-core/src/main/java/org/hibernate/type/Type.java @@ -269,7 +269,7 @@ boolean isDirty(Object oldState, Object currentState, boolean[] checkable, Share * * @param dbState the database state, in a "hydrated" form, with identifiers unresolved * @param currentState the current state of the object - * @param checkable which columns are actually updatable + * @param checkable which columns are actually checkable * @param session The session from which the request originated. * * @return true if the field has been modified diff --git a/hibernate-core/src/main/java/org/hibernate/type/TypeFactory.java b/hibernate-core/src/main/java/org/hibernate/type/TypeFactory.java index c05b493670..5e8b226f65 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TypeFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TypeFactory.java @@ -419,7 +419,7 @@ public Type any(Type metaType, Type identifierType) { * * @param metaType meta type * @param identifierType identifier type - * @param lazy is teh underlying proeprty lazy + * @param lazy is the underlying property lazy * @return AnyType */ public Type any(Type metaType, Type identifierType, boolean lazy) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/TypeResolver.java b/hibernate-core/src/main/java/org/hibernate/type/TypeResolver.java index 12b6e30698..c652428cbd 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TypeResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TypeResolver.java @@ -99,7 +99,7 @@ public Type heuristicType(String typeName) throws MappingException { *

            1. * look for 'typeName' as a class name and
                *
              1. if it names a {@link Type} implementor, return an instance
              2. - *
              3. if it names a {@link CompositeUserType} or a {@link UserType}, return an instance of class wrapped intot the appropriate {@link Type} adapter
              4. + *
              5. if it names a {@link CompositeUserType} or a {@link UserType}, return an instance of class wrapped into the appropriate {@link Type} adapter
              6. *
              7. if it implements {@link org.hibernate.classic.Lifecycle}, return the corresponding entity type
              8. *
              9. if it implements {@link Serializable}, return the corresponding serializable type
              10. *
              diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterMutabilityPlanImpl.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterMutabilityPlanImpl.java index f3fc0da385..3a7907f46d 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterMutabilityPlanImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterMutabilityPlanImpl.java @@ -10,7 +10,7 @@ import org.hibernate.type.descriptor.java.MutableMutabilityPlan; /** - * The standard aproach for defining a MutabilityPlan for converted (AttributeConverter) + * The standard approach for defining a MutabilityPlan for converted (AttributeConverter) * values is to always assume that they are immutable to make sure that dirty checking, * deep copying and second-level caching all work properly no matter what. That was work * done under https://hibernate.atlassian.net/browse/HHH-10111 diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java index 7bac410216..f99e82949d 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DataHelper.java @@ -239,7 +239,7 @@ public static byte[] extractBytes(InputStream inputStream, long start, int lengt } /** - * Extract a portion of the bytes from the given stream., wrapping them in a new stream. + * Extract a portion of the bytes from the given stream, wrapping them in a new stream. * * @param inputStream The stream of bytes. * @param start The start position/offset (0-based, per general stream/reader contracts). @@ -292,7 +292,7 @@ private static long determineLengthForBufferSizing(Clob value) throws SQLExcepti /** * Make sure we allocate a buffer sized not bigger than 2048, * not higher than what is actually needed, and at least one. - * + * * @param lengthHint the expected size of the full value * @return the buffer size */ diff --git a/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java b/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java index 85130a0bc0..4404356d28 100644 --- a/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java +++ b/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java @@ -145,7 +145,7 @@ public interface CompositeUserType { * * @param value the object to be cached * @param session - * @return a cachable representation of the object + * @return a cacheable representation of the object * @throws HibernateException */ Serializable disassemble(Object value, SharedSessionContractImplementor session) throws HibernateException; @@ -157,7 +157,7 @@ public interface CompositeUserType { * @param cached the object to be cached * @param session * @param owner the owner of the cached object - * @return a reconstructed object from the cachable representation + * @return a reconstructed object from the cacheable representation * @throws HibernateException */ Object assemble(Serializable cached, SharedSessionContractImplementor session, Object owner) throws HibernateException; diff --git a/hibernate-core/src/main/java/org/hibernate/usertype/LoggableUserType.java b/hibernate-core/src/main/java/org/hibernate/usertype/LoggableUserType.java index 51a35fe1ab..15f18fd861 100644 --- a/hibernate-core/src/main/java/org/hibernate/usertype/LoggableUserType.java +++ b/hibernate-core/src/main/java/org/hibernate/usertype/LoggableUserType.java @@ -17,7 +17,7 @@ public interface LoggableUserType { /** * Generate a loggable string representation of the collection (value). * - * @param value The collection to be logged; guarenteed to be non-null and initialized. + * @param value The collection to be logged; guaranteed to be non-null and initialized. * @param factory The factory. * @return The loggable string representation. */ diff --git a/hibernate-core/src/main/java/org/hibernate/usertype/UserCollectionType.java b/hibernate-core/src/main/java/org/hibernate/usertype/UserCollectionType.java index 5856c3534d..e117e6dd6c 100644 --- a/hibernate-core/src/main/java/org/hibernate/usertype/UserCollectionType.java +++ b/hibernate-core/src/main/java/org/hibernate/usertype/UserCollectionType.java @@ -65,7 +65,7 @@ Object replaceElements( * but with the given anticipated size (i.e. accounting for initial size * and perhaps load factor). * - * @param anticipatedSize The anticipated size of the instaniated collection + * @param anticipatedSize The anticipated size of the instantiated collection * after we are done populating it. Note, may be negative to indicate that * we not yet know anything about the anticipated size (i.e., when initializing * from a result set row by row). diff --git a/hibernate-core/src/main/java/org/hibernate/usertype/UserType.java b/hibernate-core/src/main/java/org/hibernate/usertype/UserType.java index 21cac8b61e..7b921f6f2b 100644 --- a/hibernate-core/src/main/java/org/hibernate/usertype/UserType.java +++ b/hibernate-core/src/main/java/org/hibernate/usertype/UserType.java @@ -132,7 +132,7 @@ public interface UserType { * identifier values. (optional operation) * * @param value the object to be cached - * @return a cachable representation of the object + * @return a cacheable representation of the object * @throws HibernateException */ Serializable disassemble(Object value) throws HibernateException; @@ -143,7 +143,7 @@ public interface UserType { * * @param cached the object to be cached * @param owner the owner of the cached object - * @return a reconstructed object from the cachable representation + * @return a reconstructed object from the cacheable representation * @throws HibernateException */ Object assemble(Serializable cached, Object owner) throws HibernateException; From 207c0d68be50317931f1e1c76d12221418634855 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Mon, 6 Jan 2020 16:01:13 -0500 Subject: [PATCH 07/10] HHH-13800 add a new found typo in org.hibernate.graph package's package-info.java --- .../src/main/java/org/hibernate/graph/package-info.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/graph/package-info.java b/hibernate-core/src/main/java/org/hibernate/graph/package-info.java index fd9fd22b5a..dd92634cfe 100644 --- a/hibernate-core/src/main/java/org/hibernate/graph/package-info.java +++ b/hibernate-core/src/main/java/org/hibernate/graph/package-info.java @@ -8,7 +8,7 @@ /** * Hibernate's (extended) support for JPA's entity graphs * - * @apiNote This entire package (including sub-ppackages) is considered incubating + * @apiNote This entire package (including sub-packages) is considered incubating */ @Incubating package org.hibernate.graph; From 0b938bd16b55a0fa57f8e6f823785407987796b4 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Mon, 6 Jan 2020 16:38:35 -0500 Subject: [PATCH 08/10] HHH-13800 fix typo in AbstractGraphNode's verifyMutability() method --- .../java/org/hibernate/graph/internal/AbstractGraphNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/graph/internal/AbstractGraphNode.java b/hibernate-core/src/main/java/org/hibernate/graph/internal/AbstractGraphNode.java index 38a2e97857..1003bf64fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/graph/internal/AbstractGraphNode.java +++ b/hibernate-core/src/main/java/org/hibernate/graph/internal/AbstractGraphNode.java @@ -32,7 +32,7 @@ public boolean isMutable() { protected void verifyMutability() { if ( !isMutable() ) { - throw new IllegalStateException( "Cannot mutable immutable graph node" ); + throw new IllegalStateException( "Cannot mutate immutable graph node" ); } } } From 19b7921d1d2afc1be785e49801c414ac3b10cf13 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Thu, 9 Jan 2020 08:51:50 +0000 Subject: [PATCH 09/10] HHH-13806 CoreMessageLogger#unableToLoadCommand is not printing the cause of the error --- .../main/java/org/hibernate/internal/CoreMessageLogger.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index 55e392a429..7c58938eda 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -1116,8 +1116,8 @@ void unableToInstantiateConfiguredSchemaNameResolver( void unableToJoinTransaction(String transactionStrategy); @LogMessage(level = INFO) - @Message(value = "Error performing load command : %s", id = 327) - void unableToLoadCommand(HibernateException e); + @Message(value = "Error performing load command", id = 327) + void unableToLoadCommand(@Cause HibernateException e); @LogMessage(level = WARN) @Message(value = "Unable to load/access derby driver class sysinfo to check versions : %s", id = 328) From 63a96e335ef425f4329d819d6a1c821df9b98ef3 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Wed, 15 Jan 2020 15:23:47 -0800 Subject: [PATCH 10/10] HHH-13814 : Add tests --- .../proxy/MapsIdProxyBidirectionalTest.java | 173 ++++++++++++++++++ .../proxy/MapsIdProxyUnidirectionalTest.java | 137 ++++++++++++++ 2 files changed, 310 insertions(+) create mode 100644 hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyBidirectionalTest.java create mode 100644 hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyUnidirectionalTest.java diff --git a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyBidirectionalTest.java b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyBidirectionalTest.java new file mode 100644 index 0000000000..39c0900f42 --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyBidirectionalTest.java @@ -0,0 +1,173 @@ +/* + * 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 . + */ +package org.hibernate.test.bytecode.enhancement.lazy.proxy; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; + +import org.hibernate.Hibernate; +import org.hibernate.annotations.LazyToOne; +import org.hibernate.annotations.LazyToOneOption; +import org.hibernate.boot.SessionFactoryBuilder; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.AvailableSettings; +import org.hibernate.stat.Statistics; + +import org.hibernate.testing.FailureExpected; +import org.hibernate.testing.TestForIssue; +import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner; +import org.hibernate.testing.bytecode.enhancement.EnhancementOptions; +import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +/** + * @author Gail Badner + */ + +@TestForIssue(jiraKey = "HHH-13814") +@RunWith( BytecodeEnhancerRunner.class ) +@EnhancementOptions( lazyLoading = true ) +public class MapsIdProxyBidirectionalTest extends BaseNonConfigCoreFunctionalTestCase { + + @Test + @TestForIssue(jiraKey = "HHH-13814") + public void testAssociation() { + inTransaction( + session -> { + final Statistics statistics = sessionFactory().getStatistics(); + statistics.clear(); + EmployerInfo employerInfo = session.get( EmployerInfo.class, 1 ); + + assertEquals( 1, statistics.getPrepareStatementCount() ); + + assertTrue( Hibernate.isPropertyInitialized( employerInfo, "employer" ) ); + final Employer employer = employerInfo.employer; + assertFalse( Hibernate.isInitialized( employer ) ); + Hibernate.initialize( employer ); + assertEquals( "Employer #" + employer.id, employer.name ); + + assertThat( statistics.getEntityLoadCount(), is( 2L ) ); + assertThat( statistics.getPrepareStatementCount(), is( 2L ) ); + } + ); + } + + @Test + @TestForIssue(jiraKey = "HHH-13814") + @FailureExpected( jiraKey = "HHH-13814") + public void testMappedByAssociation() { + inTransaction( + session -> { + final Statistics statistics = sessionFactory().getStatistics(); + statistics.clear(); + Employer employer = session.get( Employer.class, 1 ); + + assertEquals( 1, statistics.getPrepareStatementCount() ); + + assertTrue( Hibernate.isPropertyInitialized( employer, "employerInfo" ) ); + EmployerInfo employerInfo = employer.employerInfo; + assertFalse( Hibernate.isInitialized( employerInfo ) ); + Hibernate.initialize( employerInfo ); + assertTrue( Hibernate.isPropertyInitialized( employerInfo, "employer" ) ); + assertSame( employer, employerInfo.employer ); + + assertThat( statistics.getEntityLoadCount(), is( 2L ) ); + assertThat( statistics.getPrepareStatementCount(), is( 2L ) ); + } + ); + } + + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[] { + EmployerInfo.class, + Employer.class + }; + } + + @Before + public void setUpData() { + inTransaction( + session -> { + final Employer employer = new Employer(); + employer.id = 1; + employer.name = "Employer #" + employer.id; + final EmployerInfo employerInfo = new EmployerInfo(); + employer.employerInfo = employerInfo; + employerInfo.employer = employer; + session.persist( employer ); + } + ); + } + + @After + public void cleanupDate() { + inTransaction( + session -> { + session.createQuery( "delete from EmployerInfo" ).executeUpdate(); + session.createQuery( "delete from Employer" ).executeUpdate(); + } + ); + } + + @Override + protected void configureStandardServiceRegistryBuilder(StandardServiceRegistryBuilder ssrb) { + super.configureStandardServiceRegistryBuilder( ssrb ); + ssrb.applySetting( AvailableSettings.ALLOW_ENHANCEMENT_AS_PROXY, "true" ); + ssrb.applySetting( AvailableSettings.FORMAT_SQL, "false" ); + ssrb.applySetting( AvailableSettings.GENERATE_STATISTICS, "true" ); + ssrb.applySetting( AvailableSettings.SHOW_SQL, true ); + } + + @Override + protected void configureSessionFactoryBuilder(SessionFactoryBuilder sfb) { + super.configureSessionFactoryBuilder( sfb ); + sfb.applyStatisticsSupport( true ); + sfb.applySecondLevelCacheSupport( false ); + sfb.applyQueryCacheSupport( false ); + } + + @Entity(name = "EmployerInfo") + public static class EmployerInfo { + @Id + private int id; + + @MapsId + @OneToOne(optional = false, fetch = FetchType.LAZY) + @LazyToOne(LazyToOneOption.NO_PROXY) + private Employer employer; + + private String info; + } + + @Entity(name = "Employer") + public static class Employer { + @Id + private int id; + + @OneToOne(optional = false, fetch = FetchType.LAZY, mappedBy = "employer", cascade = CascadeType.ALL) + @LazyToOne(LazyToOneOption.NO_PROXY) + private EmployerInfo employerInfo; + + private String name; + } +} \ No newline at end of file diff --git a/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyUnidirectionalTest.java b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyUnidirectionalTest.java new file mode 100644 index 0000000000..8fb188f4a0 --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/test/bytecode/enhancement/lazy/proxy/MapsIdProxyUnidirectionalTest.java @@ -0,0 +1,137 @@ +/* + * 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 . + */ +package org.hibernate.test.bytecode.enhancement.lazy.proxy; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; + +import org.hibernate.Hibernate; +import org.hibernate.annotations.LazyToOne; +import org.hibernate.annotations.LazyToOneOption; +import org.hibernate.boot.SessionFactoryBuilder; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.AvailableSettings; +import org.hibernate.stat.Statistics; + +import org.hibernate.testing.TestForIssue; +import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner; +import org.hibernate.testing.bytecode.enhancement.EnhancementOptions; +import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +/** + * @author Gail Badner + */ + +@TestForIssue(jiraKey = "HHH-13814") +@RunWith( BytecodeEnhancerRunner.class ) +@EnhancementOptions( lazyLoading = true ) +public class MapsIdProxyUnidirectionalTest extends BaseNonConfigCoreFunctionalTestCase { + + @Test + @TestForIssue(jiraKey = "HHH-13814") + public void testBatchAssociation() { + inTransaction( + session -> { + final Statistics statistics = sessionFactory().getStatistics(); + statistics.clear(); + EmployerInfo employerInfo = session.get( EmployerInfo.class, 1 ); + + assertEquals( 1, statistics.getPrepareStatementCount() ); + + assertTrue( Hibernate.isPropertyInitialized( employerInfo, "employer" ) ); + assertFalse( Hibernate.isInitialized( employerInfo.employer ) ); + Hibernate.initialize( employerInfo.employer ); + + assertThat( statistics.getEntityLoadCount(), is( 2L ) ); + assertThat( statistics.getPrepareStatementCount(), is( 2L ) ); + } + ); + } + + @Override + protected Class[] getAnnotatedClasses() { + return new Class[] { + EmployerInfo.class, + Employer.class + }; + } + + @Before + public void setUpData() { + inTransaction( + session -> { + final Employer employer = new Employer(); + employer.id =1; + employer.name = "Employer #" + employer.id; + final EmployerInfo employerInfo = new EmployerInfo(); + employerInfo.employer = employer; + session.persist( employer ); + session.persist( employerInfo ); + } + ); + } + + @After + public void cleanupDate() { + inTransaction( + session -> { + session.createQuery( "delete from EmployerInfo" ).executeUpdate(); + session.createQuery( "delete from Employer" ).executeUpdate(); + } + ); + } + + @Override + protected void configureStandardServiceRegistryBuilder(StandardServiceRegistryBuilder ssrb) { + super.configureStandardServiceRegistryBuilder( ssrb ); + ssrb.applySetting( AvailableSettings.ALLOW_ENHANCEMENT_AS_PROXY, "true" ); + ssrb.applySetting( AvailableSettings.FORMAT_SQL, "false" ); + ssrb.applySetting( AvailableSettings.GENERATE_STATISTICS, "true" ); + ssrb.applySetting( AvailableSettings.SHOW_SQL, true ); + } + + @Override + protected void configureSessionFactoryBuilder(SessionFactoryBuilder sfb) { + super.configureSessionFactoryBuilder( sfb ); + sfb.applyStatisticsSupport( true ); + sfb.applySecondLevelCacheSupport( false ); + sfb.applyQueryCacheSupport( false ); + } + + @Entity(name = "EmployerInfo") + public static class EmployerInfo { + @Id + private int id; + + @MapsId + @OneToOne(optional = false, fetch = FetchType.LAZY) + @LazyToOne(LazyToOneOption.NO_PROXY) + private Employer employer; + + } + + @Entity(name = "Employer") + public static class Employer { + @Id + private int id; + + private String name; + } +} \ No newline at end of file