HHH-5986 - Refactor org.hibernate.util package for spi/internal split

This commit is contained in:
Steve Ebersole 2011-03-05 09:26:31 -06:00
parent 73e85ee761
commit 0816d00e59
382 changed files with 878 additions and 1232 deletions

View File

@ -40,7 +40,7 @@ import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.service.spi.UnknownUnwrapTypeException;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
/**
* A connection provider that uses a C3P0 connection pool. Hibernate will use this by

View File

@ -24,7 +24,7 @@
*/
package org.hibernate;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* A problem occurred accessing a property of an instance of a

View File

@ -24,7 +24,7 @@
*/
package org.hibernate;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Thrown when the (illegal) value of a property can not be persisted.

View File

@ -31,7 +31,7 @@ import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import java.io.IOException;
import java.io.ObjectInputStream;

View File

@ -26,9 +26,9 @@ package org.hibernate.action;
import org.hibernate.AssertionFailure;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.util.StringHelper;
import java.io.IOException;
import java.io.ObjectInputStream;

View File

@ -35,7 +35,7 @@ import org.hibernate.bytecode.BytecodeProvider;
import org.hibernate.bytecode.ProxyFactoryFactory;
import org.hibernate.bytecode.ReflectionOptimizer;
import org.hibernate.bytecode.util.FieldFilter;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Bytecode provider implementation for CGLIB.

View File

@ -34,7 +34,7 @@ import org.hibernate.bytecode.ProxyFactoryFactory;
import org.hibernate.bytecode.ReflectionOptimizer;
import org.hibernate.bytecode.util.ClassFilter;
import org.hibernate.bytecode.util.FieldFilter;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Bytecode provider implementation for Javassist.

View File

@ -33,8 +33,8 @@ import javax.naming.NamingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.jndi.JndiHelper;
import org.hibernate.util.StringHelper;
/**
* Support for CacheProvider implementations which are backed by caches bound

View File

@ -35,10 +35,9 @@ import org.hibernate.engine.RowSelection;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.engine.TypedValue;
import org.hibernate.transform.CacheableResultTransformer;
import org.hibernate.transform.ResultTransformer;
import org.hibernate.type.Type;
import org.hibernate.util.EqualsHelper;
import org.hibernate.util.CollectionHelper;
import org.hibernate.internal.util.compare.EqualsHelper;
import org.hibernate.internal.util.collections.CollectionHelper;
/**
* A key that identifies a particular query with bound parameter values. This is the object Hibernate uses

View File

@ -34,7 +34,7 @@ import org.hibernate.event.PreLoadEvent;
import org.hibernate.event.PreLoadEventListener;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.type.TypeHelper;
import org.hibernate.util.ArrayHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
/**
* A cached instance of a persistent class

View File

@ -27,8 +27,8 @@ package org.hibernate.cache.entry;
import java.io.Serializable;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.util.ArrayHelper;
/**
* @author Gavin King

View File

@ -39,7 +39,7 @@ import org.hibernate.cache.TimestampsRegion;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.access.AccessType;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.Settings;

View File

@ -40,7 +40,7 @@ import org.hibernate.AssertionFailure;
import org.hibernate.annotations.common.reflection.XAnnotatedElement;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* @author Emmanuel Bernard

View File

@ -48,6 +48,7 @@ import org.hibernate.cfg.annotations.Nullability;
import org.hibernate.cfg.annotations.TableBinder;
import org.hibernate.id.MultipleHiLoPerTableGenerator;
import org.hibernate.id.PersistentIdentifierGenerator;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Any;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Column;
@ -62,7 +63,6 @@ import org.hibernate.mapping.Table;
import org.hibernate.mapping.ToOne;
import org.hibernate.mapping.Value;
import org.hibernate.mapping.MappedSuperclass;
import org.hibernate.util.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -42,7 +42,7 @@ import org.hibernate.annotations.JoinFormula;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.cfg.annotations.EntityBinder;
import org.hibernate.cfg.annotations.Nullability;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Do the initial discovery of columns metadata and apply defaults.

View File

@ -129,7 +129,14 @@ import org.hibernate.id.PersistentIdentifierGenerator;
import org.hibernate.id.factory.DefaultIdentifierGeneratorFactory;
import org.hibernate.id.factory.IdentifierGeneratorFactory;
import org.hibernate.impl.SessionFactoryImpl;
import org.hibernate.internal.util.ConfigHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.internal.util.xml.MappingReader;
import org.hibernate.internal.util.xml.OriginImpl;
import org.hibernate.internal.util.xml.XMLHelper;
import org.hibernate.mapping.AuxiliaryDatabaseObject;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Column;
@ -162,19 +169,12 @@ import org.hibernate.type.Type;
import org.hibernate.type.TypeResolver;
import org.hibernate.usertype.CompositeUserType;
import org.hibernate.usertype.UserType;
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.CollectionHelper;
import org.hibernate.util.ConfigHelper;
import org.hibernate.util.JoinedIterator;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.SerializationHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.util.XMLHelper;
import org.hibernate.util.xml.MappingReader;
import org.hibernate.util.xml.Origin;
import org.hibernate.util.xml.OriginImpl;
import org.hibernate.util.xml.XmlDocument;
import org.hibernate.util.xml.XmlDocumentImpl;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.internal.util.collections.JoinedIterator;
import org.hibernate.internal.util.xml.Origin;
import org.hibernate.internal.util.xml.XmlDocument;
import org.hibernate.internal.util.xml.XmlDocumentImpl;
/**
* An instance of <tt>Configuration</tt> allows the application
@ -435,7 +435,7 @@ public class Configuration implements Serializable {
/**
* Set a custom entity resolver. This entity resolver must be
* set before addXXX(misc) call.
* Default value is {@link org.hibernate.util.DTDEntityResolver}
* Default value is {@link org.hibernate.internal.util.xml.DTDEntityResolver}
*
* @param entityResolver entity resolver to use
*/

View File

@ -24,7 +24,7 @@
package org.hibernate.cfg;
import org.hibernate.AssertionFailure;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* @author Emmanuel Bernard

View File

@ -25,7 +25,7 @@ package org.hibernate.cfg;
import java.io.Serializable;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.AssertionFailure;
/**

View File

@ -25,7 +25,7 @@ package org.hibernate.cfg;
import java.io.InputStream;
import org.hibernate.util.DTDEntityResolver;
import org.hibernate.internal.util.xml.DTDEntityResolver;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.slf4j.Logger;

View File

@ -26,7 +26,7 @@ package org.hibernate.cfg;
import java.io.Serializable;
import org.hibernate.AssertionFailure;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Naming strategy implementing the EJB3 standards

View File

@ -32,12 +32,12 @@ import org.hibernate.annotations.ColumnTransformers;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.cfg.annotations.Nullability;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Formula;
import org.hibernate.mapping.Join;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Table;
import org.hibernate.util.StringHelper;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

View File

@ -33,7 +33,7 @@ import javax.persistence.PrimaryKeyJoinColumn;
import org.hibernate.AnnotationException;
import org.hibernate.AssertionFailure;
import org.hibernate.MappingException;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;

View File

@ -39,8 +39,8 @@ import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException;
import org.hibernate.Version;
import org.hibernate.bytecode.BytecodeProvider;
import org.hibernate.internal.util.ConfigHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.util.ConfigHelper;
/**
@ -539,12 +539,12 @@ public final class Environment {
public static final String PREFER_POOLED_VALUES_LO = "hibernate.id.optimizer.pooled.prefer_lo";
/**
* The maximum number of strong references maintained by {@link org.hibernate.util.SoftLimitMRUCache}. Default is 128.
* The maximum number of strong references maintained by {@link org.hibernate.internal.util.collections.SoftLimitMRUCache}. Default is 128.
*/
public static final String QUERY_PLAN_CACHE_MAX_STRONG_REFERENCES = "hibernate.query.plan_cache_max_strong_references";
/**
* The maximum number of soft references maintained by {@link org.hibernate.util.SoftLimitMRUCache}. Default is 2048.
* The maximum number of soft references maintained by {@link org.hibernate.internal.util.collections.SoftLimitMRUCache}. Default is 2048.
*/
public static final String QUERY_PLAN_CACHE_MAX_SOFT_REFERENCES = "hibernate.query.plan_cache_max_soft_references";
@ -611,7 +611,7 @@ public final class Environment {
GLOBAL_PROPERTIES.setProperty( USE_REFLECTION_OPTIMIZER, Boolean.FALSE.toString() );
try {
InputStream stream = ConfigHelper.getResourceAsStream("/hibernate.properties");
InputStream stream = ConfigHelper.getResourceAsStream( "/hibernate.properties" );
try {
GLOBAL_PROPERTIES.load(stream);
log.info( "loaded properties from resource hibernate.properties: " + ConfigurationHelper.maskOut(GLOBAL_PROPERTIES, PASS) );

View File

@ -25,7 +25,7 @@ package org.hibernate.cfg;
import java.util.Set;
import org.hibernate.util.xml.XmlDocument;
import org.hibernate.internal.util.xml.XmlDocument;
/**
* Represents a mapping queued for delayed processing to await

View File

@ -22,10 +22,9 @@
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.util;
package org.hibernate.cfg;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
import java.util.HashMap;
@ -268,7 +267,7 @@ public abstract class ExternalSessionFactoryConfig {
// type=listenerClass
// ({sep}type=listenerClass)*
// where {sep} is any whitespace or comma
if ( StringHelper.isNotEmpty( customListenersString) ) {
if ( StringHelper.isNotEmpty( customListenersString ) ) {
String[] listenerEntries = ConfigurationHelper.toStringArray( customListenersString, " ,\n\t\r\f" );
for ( int i = 0; i < listenerEntries.length; i++ ) {
final int keyValueSepPosition = listenerEntries[i].indexOf( '=' );

View File

@ -43,6 +43,9 @@ import org.hibernate.engine.FilterDefinition;
import org.hibernate.engine.NamedQueryDefinition;
import org.hibernate.engine.Versioning;
import org.hibernate.id.PersistentIdentifierGenerator;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.collections.JoinedIterator;
import org.hibernate.mapping.Any;
import org.hibernate.mapping.Array;
import org.hibernate.mapping.AuxiliaryDatabaseObject;
@ -93,10 +96,7 @@ import org.hibernate.persister.entity.UnionSubclassEntityPersister;
import org.hibernate.type.DiscriminatorType;
import org.hibernate.type.ForeignKeyDirection;
import org.hibernate.type.Type;
import org.hibernate.util.JoinedIterator;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.util.xml.XmlDocument;
import org.hibernate.internal.util.xml.XmlDocument;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -690,8 +690,10 @@ public final class HbmBinder {
Attribute persisterNode = node.attribute( "persister" );
if ( persisterNode != null ) {
try {
entity.setEntityPersisterClass( ReflectHelper.classForName( persisterNode
.getValue() ) );
entity.setEntityPersisterClass( ReflectHelper.classForName(
persisterNode
.getValue()
) );
}
catch (ClassNotFoundException cnfe) {
throw new MappingException( "Could not find persister class: "

View File

@ -25,7 +25,7 @@ package org.hibernate.cfg;
import java.io.Serializable;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.AssertionFailure;
/**

View File

@ -28,7 +28,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import org.hibernate.MappingException;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.engine.NamedSQLQueryDefinition;
import org.hibernate.engine.ResultSetMappingDefinition;
import org.dom4j.Attribute;

View File

@ -23,7 +23,7 @@
*/
package org.hibernate.cfg;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Provides centralized normalization of how database object names are handled.

View File

@ -31,6 +31,7 @@ import org.hibernate.MappingException;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.cfg.annotations.PropertyBinder;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.DependantValue;
import org.hibernate.mapping.Join;
@ -40,7 +41,6 @@ import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.type.ForeignKeyDirection;
import org.hibernate.util.StringHelper;
/**
* We have to handle OneToOne in a second pass because:

View File

@ -48,7 +48,7 @@ import org.hibernate.annotations.Target;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* A helper class to keep the {@code XProperty}s of a class ordered by access type.

View File

@ -39,16 +39,15 @@ import org.hibernate.engine.ResultSetMappingDefinition;
import org.hibernate.engine.query.sql.NativeSQLQueryJoinReturn;
import org.hibernate.engine.query.sql.NativeSQLQueryRootReturn;
import org.hibernate.engine.query.sql.NativeSQLQueryScalarReturn;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Value;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.ToOne;
import org.hibernate.type.Type;
import org.hibernate.type.TypeFactory;
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.CollectionHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.collections.CollectionHelper;
/**
* @author Emmanuel Bernard
@ -102,7 +101,7 @@ public abstract class ResultSetMappingBinder {
private static NativeSQLQueryRootReturn bindReturn(Element returnElem, Mappings mappings, int elementCount) {
String alias = returnElem.attributeValue( "alias" );
if( StringHelper.isEmpty(alias)) {
if( StringHelper.isEmpty( alias )) {
alias = "alias_" + elementCount; // hack/workaround as sqlquery impl depend on having a key.
}
@ -184,7 +183,7 @@ public abstract class ResultSetMappingBinder {
Element discriminatorResult = returnElement.element("return-discriminator");
if(discriminatorResult!=null) {
ArrayList resultColumns = getResultColumns(discriminatorResult);
propertyresults.put("class", ArrayHelper.toStringArray(resultColumns) );
propertyresults.put("class", ArrayHelper.toStringArray( resultColumns ) );
}
Iterator iterator = returnElement.elementIterator("return-property");
List properties = new ArrayList();

View File

@ -43,11 +43,11 @@ import org.hibernate.engine.jdbc.spi.ExtractedDatabaseMetaData;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.transaction.spi.TransactionFactory;
import org.hibernate.hql.QueryTranslatorFactory;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.service.jta.platform.spi.JtaPlatform;
import org.hibernate.service.spi.ServiceRegistry;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Reads configuration properties and builds a {@link Settings} instance.

View File

@ -29,6 +29,7 @@ import org.hibernate.AnnotationException;
import org.hibernate.AssertionFailure;
import org.hibernate.MappingException;
import org.hibernate.cfg.annotations.TableBinder;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.ManyToOne;
import org.hibernate.mapping.OneToOne;
import org.hibernate.mapping.PersistentClass;
@ -36,7 +37,6 @@ import org.hibernate.mapping.Property;
import org.hibernate.mapping.ToOne;
import org.hibernate.mapping.KeyValue;
import org.hibernate.mapping.Component;
import org.hibernate.util.StringHelper;
/**
* Enable a proper set of the FK columns in respect with the id column order

View File

@ -26,7 +26,7 @@ package org.hibernate.cfg;
import org.hibernate.MappingException;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* @author Emmanuel Bernard

View File

@ -95,6 +95,7 @@ import org.hibernate.cfg.PropertyInferredData;
import org.hibernate.cfg.PropertyPreloadedData;
import org.hibernate.cfg.SecondPass;
import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Any;
import org.hibernate.mapping.Backref;
import org.hibernate.mapping.Collection;
@ -111,8 +112,6 @@ import org.hibernate.mapping.Selectable;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Table;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.util.StringHelper;
/**
* Base class for binding different types of collections to Hibernate configuration objects.

View File

@ -75,6 +75,7 @@ import org.hibernate.cfg.UniqueConstraintHolder;
import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
import org.hibernate.engine.FilterDefinition;
import org.hibernate.engine.Versioning;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.DependantValue;
import org.hibernate.mapping.Join;
import org.hibernate.mapping.PersistentClass;
@ -83,8 +84,7 @@ import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Table;
import org.hibernate.mapping.TableOwner;
import org.hibernate.mapping.Value;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -43,7 +43,7 @@ import org.hibernate.mapping.IdentifierCollection;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Table;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* @author Emmanuel Bernard

View File

@ -47,7 +47,7 @@ import org.hibernate.mapping.List;
import org.hibernate.mapping.OneToMany;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Bind a list to the underlying Hibernate configuration

View File

@ -54,6 +54,7 @@ import org.hibernate.cfg.PropertyHolderBuilder;
import org.hibernate.cfg.PropertyPreloadedData;
import org.hibernate.cfg.SecondPass;
import org.hibernate.dialect.HSQLDialect;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
@ -68,7 +69,6 @@ import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.ToOne;
import org.hibernate.mapping.Value;
import org.hibernate.sql.Template;
import org.hibernate.util.StringHelper;
/**
* Implementation to bind a Map

View File

@ -47,6 +47,7 @@ import org.hibernate.cfg.InheritanceState;
import org.hibernate.cfg.Mappings;
import org.hibernate.cfg.PropertyHolder;
import org.hibernate.cfg.PropertyPreloadedData;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.KeyValue;
import org.hibernate.mapping.Property;
@ -54,7 +55,6 @@ import org.hibernate.mapping.PropertyGeneration;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Value;
import org.hibernate.util.StringHelper;
/**
* @author Emmanuel Bernard

View File

@ -48,7 +48,7 @@ import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.ToOne;
import org.hibernate.mapping.Value;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -52,6 +52,7 @@ import org.hibernate.cfg.Mappings;
import org.hibernate.cfg.NotYetImplementedException;
import org.hibernate.cfg.PkDrivenByDefaultMapsIdSecondPass;
import org.hibernate.cfg.SetSimpleValueTypeSecondPass;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.Table;
import org.hibernate.type.CharacterArrayClobType;
@ -59,7 +60,6 @@ import org.hibernate.type.EnumType;
import org.hibernate.type.PrimitiveCharacterArrayClobType;
import org.hibernate.type.SerializableToBlobType;
import org.hibernate.type.WrappedMaterializedBlobType;
import org.hibernate.util.StringHelper;
/**
* @author Emmanuel Bernard

View File

@ -32,8 +32,8 @@ import org.hibernate.AnnotationException;
import org.hibernate.AssertionFailure;
import org.hibernate.annotations.Index;
import org.hibernate.cfg.Mappings;
import org.hibernate.util.StringHelper;
import org.hibernate.util.CollectionHelper;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.cfg.BinderHelper;
import org.hibernate.cfg.Ejb3JoinColumn;
import org.hibernate.cfg.IndexOrUniqueKeySecondPass;

View File

@ -43,7 +43,7 @@ import org.dom4j.Element;
import org.hibernate.annotations.common.reflection.AnnotationReader;
import org.hibernate.annotations.common.reflection.MetadataProvider;
import org.hibernate.annotations.common.reflection.java.JavaMetadataProvider;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
/**
* MetadataProvider aware of the JPA Deployment descriptor

View File

@ -130,8 +130,8 @@ import org.hibernate.annotations.common.annotationfactory.AnnotationFactory;
import org.hibernate.annotations.common.reflection.AnnotationReader;
import org.hibernate.annotations.common.reflection.Filter;
import org.hibernate.annotations.common.reflection.ReflectionUtil;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Encapsulates the overriding of Java annotations from an EJB 3.0 descriptor.

View File

@ -38,7 +38,7 @@ import org.dom4j.Document;
import org.dom4j.Element;
import org.hibernate.AnnotationException;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

View File

@ -33,8 +33,8 @@ import java.util.Set;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Environment;
import org.hibernate.event.EventListeners;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.util.ReflectHelper;
/**
* This class has no hard dependency on Bean Validation APIs

View File

@ -30,7 +30,7 @@ import java.util.Map;
import java.util.HashMap;
import javax.validation.groups.Default;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.HibernateException;
/**

View File

@ -53,13 +53,13 @@ import org.hibernate.event.EventListeners;
import org.hibernate.event.PreDeleteEventListener;
import org.hibernate.event.PreInsertEventListener;
import org.hibernate.event.PreUpdateEventListener;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.ReflectHelper;
/**
* @author Emmanuel Bernard

View File

@ -33,7 +33,7 @@ import org.hibernate.event.PostCollectionUpdateEventListener;
import org.hibernate.event.PostDeleteEventListener;
import org.hibernate.event.PostInsertEventListener;
import org.hibernate.event.PostUpdateEventListener;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -41,13 +41,13 @@ import org.hibernate.engine.ForeignKeys;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.engine.Status;
import org.hibernate.engine.TypedValue;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.internal.util.collections.EmptyIterator;
import org.hibernate.internal.util.collections.IdentitySet;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.type.Type;
import org.hibernate.util.CollectionHelper;
import org.hibernate.util.EmptyIterator;
import org.hibernate.util.IdentitySet;
import org.hibernate.util.MarkerObject;
import org.hibernate.internal.util.MarkerObject;
/**
* Base class implementing {@link PersistentCollection}

View File

@ -35,11 +35,11 @@ import java.util.List;
import org.dom4j.Element;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.loader.CollectionAliases;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.type.Type;
import org.hibernate.util.CollectionHelper;
/**
* A persistent wrapper for an XML element
@ -74,7 +74,7 @@ public class PersistentElementHolder extends AbstractPersistentCollection {
public Collection getOrphans(Serializable snapshot, String entityName)
throws HibernateException {
//orphan delete not supported for EntityMode.DOM4J
return CollectionHelper.EMPTY_COLLECTION;
return CollectionHelper.EMPTY_COLLECTION;
}
public PersistentElementHolder(SessionImplementor session, CollectionPersister persister, Serializable key)

View File

@ -43,7 +43,7 @@ import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.type.Type;
import org.hibernate.type.XmlRepresentableType;
import org.hibernate.util.CollectionHelper;
import org.hibernate.internal.util.collections.CollectionHelper;
/**
* A persistent wrapper for an XML element

View File

@ -28,7 +28,7 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Constrains a property to between two values

View File

@ -33,10 +33,10 @@ import org.hibernate.Criteria;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
/**
* Support for query by example.

View File

@ -24,8 +24,8 @@
*/
package org.hibernate.criterion;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
/**
* @deprecated Use <tt>Restrictions</tt>.

View File

@ -28,7 +28,7 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* An identifier constraint
@ -48,8 +48,8 @@ public class IdentifierEqExpression implements Criterion {
String[] columns = criteriaQuery.getIdentifierColumns(criteria);
String result = StringHelper.join(
" and ",
StringHelper.suffix( columns, " = ?" )
" and ",
StringHelper.suffix( columns, " = ?" )
);
if (columns.length>1) result = '(' + result + ')';
return result;

View File

@ -27,7 +27,7 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* A property value, or grouped property value

View File

@ -29,9 +29,9 @@ import org.hibernate.Criteria;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
/**
* Constrains the property to a specified list of values

View File

@ -31,7 +31,7 @@ import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* A sequence of a logical expressions combined by some

View File

@ -28,7 +28,7 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Constrains a property to be non-null
@ -48,8 +48,8 @@ public class NotNullExpression implements Criterion {
throws HibernateException {
String[] columns = criteriaQuery.findColumns(propertyName, criteria);
String result = StringHelper.join(
" or ",
StringHelper.suffix( columns, " is not null" )
" or ",
StringHelper.suffix( columns, " is not null" )
);
if (columns.length>1) result = '(' + result + ')';
return result;

View File

@ -28,7 +28,7 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Constrains a property to be null
@ -48,8 +48,8 @@ public class NullExpression implements Criterion {
throws HibernateException {
String[] columns = criteriaQuery.findColumns(propertyName, criteria);
String result = StringHelper.join(
" and ",
StringHelper.suffix( columns, " is null" )
" and ",
StringHelper.suffix( columns, " is null" )
);
if (columns.length>1) result = '(' + result + ')';
return result;

View File

@ -29,8 +29,8 @@ import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
/**
* @author Gavin King
@ -152,7 +152,7 @@ public class ProjectionList implements EnhancedProjection {
List result = new ArrayList( getLength() );
for ( int i=0; i<getLength(); i++ ) {
String[] aliases = getProjection(i).getAliases();
ArrayHelper.addAll(result, aliases);
ArrayHelper.addAll( result, aliases );
}
return ArrayHelper.toStringArray(result);

View File

@ -27,7 +27,7 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* superclass for comparisons between two properties (with SQL binary operators)
@ -53,7 +53,7 @@ public class PropertyExpression implements Criterion {
String[] ycols = criteriaQuery.findColumns(otherPropertyName, criteria);
String result = StringHelper.join(
" and ",
StringHelper.add(xcols, getOp(), ycols)
StringHelper.add( xcols, getOp(), ycols )
);
if (xcols.length>1) result = '(' + result + ')';
return result;

View File

@ -26,8 +26,8 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
/**
* A property value, or grouped property value

View File

@ -28,8 +28,8 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
/**
* The <tt>criterion</tt> package may be used by applications as a framework for building

View File

@ -28,8 +28,8 @@ import org.hibernate.Criteria;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
/**
* A SQL fragment. The string {alias} will be replaced by the
@ -44,7 +44,7 @@ public class SQLCriterion implements Criterion {
Criteria criteria,
CriteriaQuery criteriaQuery)
throws HibernateException {
return StringHelper.replace( sql, "{alias}", criteriaQuery.getSQLAlias(criteria) );
return StringHelper.replace( sql, "{alias}", criteriaQuery.getSQLAlias( criteria ) );
}
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)

View File

@ -27,8 +27,8 @@ package org.hibernate.criterion;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
/**
* A SQL fragment. The string {alias} will be replaced by the
@ -53,7 +53,7 @@ public class SQLProjection implements Projection {
public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
return StringHelper.replace( groupBy, "{alias}", criteriaQuery.getSQLAlias(criteria) );
return StringHelper.replace( groupBy, "{alias}", criteriaQuery.getSQLAlias( criteria ) );
}
public Type[] getTypes(Criteria crit, CriteriaQuery criteriaQuery)

View File

@ -45,11 +45,11 @@ import org.hibernate.exception.SQLExceptionConverter;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.id.IdentityGenerator;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.sql.CacheJoinFragment;
import org.hibernate.sql.JoinFragment;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.StringHelper;
/**
* Cach&eacute; 2007.1 dialect. This class is required in order to use Hibernate with Intersystems Cach<EFBFBD> SQL.<br>

View File

@ -31,9 +31,9 @@ import org.slf4j.LoggerFactory;
import org.hibernate.MappingException;
import org.hibernate.dialect.function.AnsiTrimFunction;
import org.hibernate.dialect.function.DerbyConcatFunction;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DerbyCaseFragment;
import org.hibernate.util.ReflectHelper;
/**
* Hibernate Dialect for Cloudscape 10 - aka Derby. This implements both an

View File

@ -59,6 +59,7 @@ import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.id.IdentityGenerator;
import org.hibernate.id.SequenceGenerator;
import org.hibernate.id.TableHiLoGenerator;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.mapping.Column;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.sql.ANSICaseFragment;
@ -70,8 +71,7 @@ import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.descriptor.sql.BlobTypeDescriptor;
import org.hibernate.type.descriptor.sql.ClobTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
import org.hibernate.util.ReflectHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.ReflectHelper;
/**
* Represents a dialect of SQL implemented by a particular RDBMS.

View File

@ -36,8 +36,8 @@ import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.ReflectHelper;
/**
* A dialect compatible with the H2 database.

View File

@ -31,6 +31,7 @@ import org.hibernate.LockMode;
import org.hibernate.StaleObjectStateException;
import org.hibernate.JDBCException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.AvgWithArgumentCastFunction;
@ -39,11 +40,10 @@ import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.dialect.lock.*;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -305,7 +305,7 @@ public class HSQLDialect extends Dialect {
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode( sqle );
int errorCode = JdbcExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -8 ) {
constraintName = extractUsingTemplate(
@ -342,7 +342,7 @@ public class HSQLDialect extends Dialect {
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode( sqle );
int errorCode = JdbcExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -8 ) {
constraintName = extractUsingTemplate(

View File

@ -28,11 +28,11 @@ import java.sql.Types;
import org.hibernate.MappingException;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.StringHelper;
/**
* Informix dialect.<br>
@ -206,7 +206,7 @@ public class InformixDialect extends Dialect {
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode(sqle);
int errorCode = JdbcExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -268 ) {
constraintName = extractUsingTemplate( "Unique constraint (", ") violated.", sqle.getMessage() );
}

View File

@ -32,7 +32,7 @@ import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* An SQL dialect for MySQL (prior to 5.x).

View File

@ -28,6 +28,8 @@ import java.sql.SQLException;
import java.sql.ResultSet;
import java.sql.CallableStatement;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DecodeCaseFragment;
import org.hibernate.sql.JoinFragment;
@ -40,10 +42,8 @@ import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.NvlFunction;
import org.hibernate.HibernateException;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.ReflectHelper;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.JDBCExceptionHelper;
/**
* A dialect for Oracle 8i.
@ -381,7 +381,7 @@ public class Oracle8iDialect extends Dialect {
* @return The extracted constraint name.
*/
public String extractConstraintName(SQLException sqle) {
int errorCode = JDBCExceptionHelper.extractErrorCode(sqle);
int errorCode = JdbcExceptionHelper.extractErrorCode( sqle );
if ( errorCode == 1 || errorCode == 2291 || errorCode == 2292 ) {
return extractUsingTemplate( "constraint (", ") violated", sqle.getMessage() );
}

View File

@ -39,11 +39,11 @@ import org.hibernate.dialect.function.NvlFunction;
import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.ReflectHelper;
import org.hibernate.internal.util.ReflectHelper;
/**
* An SQL dialect for Oracle 9 (uses ANSI-style syntax where possible).
@ -282,7 +282,7 @@ public class Oracle9Dialect extends Dialect {
* @return The extracted constraint name.
*/
public String extractConstraintName(SQLException sqle) {
int errorCode = JDBCExceptionHelper.extractErrorCode(sqle);
int errorCode = JdbcExceptionHelper.extractErrorCode( sqle );
if ( errorCode == 1 || errorCode == 2291 || errorCode == 2292 ) {
return extractUsingTemplate( "constraint (", ") violated", sqle.getMessage() );
}

View File

@ -36,10 +36,10 @@ import org.hibernate.dialect.function.PositionSubstringFunction;
import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.id.SequenceGenerator;
import org.hibernate.internal.util.JdbcExceptionHelper;
import org.hibernate.type.descriptor.sql.BlobTypeDescriptor;
import org.hibernate.type.descriptor.sql.ClobTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
@ -336,7 +336,7 @@ public class PostgreSQLDialect extends Dialect {
private static ViolatedConstraintNameExtracter EXTRACTER = new TemplatedViolatedConstraintNameExtracter() {
public String extractConstraintName(SQLException sqle) {
try {
int sqlState = Integer.valueOf( JDBCExceptionHelper.extractSqlState(sqle)).intValue();
int sqlState = Integer.valueOf( JdbcExceptionHelper.extractSqlState( sqle )).intValue();
switch (sqlState) {
// CHECK VIOLATION
case 23514: return extractUsingTemplate("violates check constraint \"","\"", sqle.getMessage());

View File

@ -30,10 +30,10 @@ import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DecodeCaseFragment;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.StringHelper;
/**
* An SQL dialect compatible with SAP DB.
@ -155,7 +155,7 @@ public class SAPDBDialect extends Dialect {
.append(" foreign key ")
.append(constraintName)
.append(" (")
.append( StringHelper.join(", ", foreignKey) )
.append( StringHelper.join( ", ", foreignKey ) )
.append(") references ")
.append(referencedTable);

View File

@ -28,7 +28,7 @@ import java.util.HashMap;
import java.util.TreeMap;
import org.hibernate.MappingException;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* This class maps a type to names. Associations

View File

@ -35,7 +35,7 @@ import org.hibernate.cache.CacheKey;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.util.MarkerObject;
import org.hibernate.internal.util.MarkerObject;
/**
* Tracks entity and collection keys that are available for batch

View File

@ -35,6 +35,7 @@ import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.event.EventSource;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
@ -43,7 +44,6 @@ import org.hibernate.type.CollectionType;
import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
import org.hibernate.util.CollectionHelper;
/**
* Delegate responsible for, in conjunction with the various

View File

@ -29,7 +29,7 @@ import java.util.HashMap;
import java.util.Map;
import org.hibernate.MappingException;
import org.hibernate.util.ArrayHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
/**
* A contract for defining the aspects of cascading various persistence actions.
@ -99,7 +99,7 @@ public abstract class CascadeStyle implements Serializable {
return false;
}
public String toString() {
return ArrayHelper.toString(styles);
return ArrayHelper.toString( styles );
}
}

View File

@ -24,12 +24,12 @@
*/
package org.hibernate.engine;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.entity.Joinable;
import org.hibernate.persister.entity.OuterJoinLoadable;
import org.hibernate.persister.entity.PropertyMapping;
import org.hibernate.type.AssociationType;
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
/**
* @author Gavin King

View File

@ -30,12 +30,12 @@ import java.util.List;
import java.util.Map;
import org.hibernate.MappingException;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.hibernate.persister.entity.Joinable;
import org.hibernate.persister.collection.QueryableCollection;
import org.hibernate.sql.JoinFragment;
import org.hibernate.sql.QueryJoinFragment;
import org.hibernate.type.AssociationType;
import org.hibernate.util.CollectionHelper;
/**
* @author Gavin King

View File

@ -42,10 +42,10 @@ import org.hibernate.LockOptions;
import org.hibernate.impl.FilterImpl;
import org.hibernate.dialect.Dialect;
import org.hibernate.hql.classic.ParserHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.pretty.Printer;
import org.hibernate.transform.ResultTransformer;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
/**
* @author Gavin King

View File

@ -48,6 +48,7 @@ import org.hibernate.NonUniqueObjectException;
import org.hibernate.PersistentObjectException;
import org.hibernate.TransientObjectException;
import org.hibernate.engine.loading.LoadContexts;
import org.hibernate.internal.util.collections.IdentityMap;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.persister.collection.CollectionPersister;
@ -55,8 +56,7 @@ import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;
import org.hibernate.tuple.ElementWrapper;
import org.hibernate.util.IdentityMap;
import org.hibernate.util.MarkerObject;
import org.hibernate.internal.util.MarkerObject;
/**
* A <tt>PersistenceContext</tt> represents the state of persistent "stuff" which

View File

@ -27,9 +27,9 @@ package org.hibernate.engine;
import java.util.Map;
import java.util.Set;
import org.hibernate.internal.util.StringHelper;
import org.hibernate.persister.entity.Loadable;
import org.hibernate.persister.entity.PropertyMapping;
import org.hibernate.util.StringHelper;
/**
* @author Gavin King

View File

@ -23,6 +23,8 @@
*/
package org.hibernate.engine.jdbc;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.lang.reflect.Method;
@ -33,8 +35,6 @@ import java.sql.SQLException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.util.JDBCExceptionReporter;
/**
* A proxy for a ResultSet delegate, responsible for locally caching the columnName-to-columnIndex resolution that
* has been found to be inefficient in a few vendor's drivers (i.e., Oracle and Postgres).
@ -45,6 +45,7 @@ import org.hibernate.util.JDBCExceptionReporter;
public class ResultSetWrapperProxy implements InvocationHandler {
private static final Logger log = LoggerFactory.getLogger( ResultSetWrapperProxy.class );
private static final Class[] PROXY_INTERFACES = new Class[] { ResultSet.class };
private static final SqlExceptionHelper sqlExceptionHelper = new SqlExceptionHelper();
private final ResultSet rs;
private final ColumnNameCache columnNameCache;
@ -83,12 +84,11 @@ public class ResultSetWrapperProxy implements InvocationHandler {
return cl;
}
/**
* {@inheritDoc}
*/
@Override
@SuppressWarnings( {"UnnecessaryBoxing"})
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ( "findColumn".equals( method.getName() ) ) {
return new Integer( findColumn( ( String ) args[0] ) );
return Integer.valueOf( findColumn( ( String ) args[0] ) );
}
if ( isFirstArgColumnLabel( method, args ) ) {
@ -107,7 +107,7 @@ public class ResultSetWrapperProxy implements InvocationHandler {
.append( "] as first argument for method: [" )
.append( method )
.append( "]" );
JDBCExceptionReporter.logExceptions( ex, buf.toString() );
sqlExceptionHelper.logExceptions( ex, buf.toString() );
}
catch ( NoSuchMethodException ex ) {
StringBuffer buf = new StringBuffer()
@ -176,9 +176,10 @@ public class ResultSetWrapperProxy implements InvocationHandler {
return columnNameMethod.getDeclaringClass().getMethod( columnNameMethod.getName(), actualParameterTypes );
}
@SuppressWarnings( {"UnnecessaryBoxing"})
private Object[] buildColumnIndexMethodArgs(Object[] incomingArgs, int columnIndex) {
Object actualArgs[] = new Object[incomingArgs.length];
actualArgs[0] = new Integer( columnIndex );
actualArgs[0] = Integer.valueOf( columnIndex );
System.arraycopy( incomingArgs, 1, actualArgs, 1, incomingArgs.length - 1 );
return actualArgs;
}

View File

@ -29,7 +29,7 @@ import java.util.LinkedList;
import java.util.Set;
import java.util.StringTokenizer;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Performs formatting of basic SQL statements (DML + query).

View File

@ -39,6 +39,7 @@ import org.slf4j.LoggerFactory;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.service.jdbc.dialect.spi.DialectFactory;
import org.hibernate.engine.jdbc.spi.ExtractedDatabaseMetaData;
@ -48,7 +49,6 @@ import org.hibernate.engine.jdbc.spi.SchemaNameResolver;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.service.spi.Configurable;
import org.hibernate.service.spi.InjectService;
import org.hibernate.util.ReflectHelper;
/**
* Standard implementation of the {@link JdbcServices} contract

View File

@ -33,7 +33,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor;
import org.hibernate.engine.jdbc.spi.NonDurableConnectionObserver;
import org.hibernate.engine.transaction.spi.TransactionContext;
import org.hibernate.util.CollectionHelper;
import org.hibernate.internal.util.collections.CollectionHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -31,7 +31,7 @@ import java.util.LinkedHashSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.util.ArrayHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
/**
* Helper to extract type innformation from {@link DatabaseMetaData JDBC metadata}

View File

@ -27,6 +27,7 @@ import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -35,7 +36,7 @@ import org.hibernate.JDBCException;
import org.hibernate.exception.SQLExceptionConverter;
import org.hibernate.exception.SQLStateConverter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* Helper for handling SQLExceptions in various manners.
@ -94,96 +95,31 @@ public class SqlExceptionHelper implements Serializable {
this.sqlExceptionConverter = ( sqlExceptionConverter == null ? DEFAULT_CONVERTER : sqlExceptionConverter );
}
// SQLException ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* Convert an SQLException using the current converter, doing some logging first.
*
* @param sqle The exception to convert
* @param sqlException The exception to convert
* @param message An error message.
* @return The converted exception
*/
public JDBCException convert(SQLException sqle, String message) {
return convert( sqle, message, "n/a" );
public JDBCException convert(SQLException sqlException, String message) {
return convert( sqlException, message, "n/a" );
}
/**
* Convert an SQLException using the current converter, doing some logging first.
*
* @param sqle The exception to convert
* @param sqlException The exception to convert
* @param message An error message.
* @param sql The SQL being executed when the exception occurred
* @return The converted exception
*/
public JDBCException convert(SQLException sqle, String message, String sql) {
logExceptions( sqle, message + " [" + sql + "]" );
return sqlExceptionConverter.convert( sqle, message, sql );
}
/**
* Log any {@link java.sql.SQLWarning}s registered with the connection.
*
* @param connection The connection to check for warnings.
*/
public void logAndClearWarnings(Connection connection) {
if ( log.isWarnEnabled() ) {
try {
logWarnings( connection.getWarnings() );
}
catch ( SQLException sqle ) {
//workaround for WebLogic
log.debug( "could not log warnings", sqle );
}
}
try {
//Sybase fail if we don't do that, sigh...
connection.clearWarnings();
}
catch ( SQLException sqle ) {
log.debug( "could not clear warnings", sqle );
}
}
/**
* Log the given (and any nested) warning.
*
* @param warning The warning
*/
public void logWarnings(SQLWarning warning) {
logWarnings( warning, null );
}
/**
* Log the given (and any nested) warning.
*
* @param warning The warning
* @param message The message text to use as a preamble.
*/
public void logWarnings(SQLWarning warning, String message) {
if ( log.isWarnEnabled() ) {
if ( log.isDebugEnabled() && warning != null ) {
message = StringHelper.isNotEmpty( message ) ? message : DEFAULT_WARNING_MSG;
log.debug( message, warning );
}
while ( warning != null ) {
StringBuffer buf = new StringBuffer( 30 )
.append( "SQL Warning: " )
.append( warning.getErrorCode() )
.append( ", SQLState: " )
.append( warning.getSQLState() );
log.warn( buf.toString() );
log.warn( warning.getMessage() );
warning = warning.getNextWarning();
}
}
}
/**
* Log the given (and any nested) exception.
*
* @param sqlException The exception to log
*/
public void logExceptions(SQLException sqlException) {
logExceptions( sqlException, null );
public JDBCException convert(SQLException sqlException, String message, String sql) {
logExceptions( sqlException, message + " [" + sql + "]" );
return sqlExceptionConverter.convert( sqlException, message, sql );
}
/**
@ -210,4 +146,154 @@ public class SqlExceptionHelper implements Serializable {
}
}
}
// SQLWarning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* Contract for handling {@link SQLWarning warnings}
*/
public static interface WarningHandler {
/**
* Should processing be done? Allows short-circuiting if not.
*
* @return True to process warnings, false otherwise.
*/
public boolean doProcess();
/**
* Prepare for processing of a {@link SQLWarning warning} stack.
* <p/>
* Note that the warning here is also the first passed to {@link #handleWarning}
*
* @param warning The first warning in the stack.
*/
public void prepare(SQLWarning warning);
/**
* Handle an individual warning in the stack.
*
* @param warning The warning to handle.
*/
public void handleWarning(SQLWarning warning);
}
/**
* Basic support for {@link WarningHandler} implementations which log
*/
public static abstract class WarningHandlerLoggingSupport implements WarningHandler {
public final void handleWarning(SQLWarning warning) {
StringBuffer buf = new StringBuffer( 30 )
.append( "SQL Warning Code: " )
.append( warning.getErrorCode() )
.append( ", SQLState: " )
.append( warning.getSQLState() );
logWarning( buf.toString(), warning.getMessage() );
}
/**
* Delegate to log common details of a {@link SQLWarning warning}
*
* @param description A description of the warning
* @param message The warning message
*/
protected abstract void logWarning(String description, String message);
}
public static class StandardWarningHandler extends WarningHandlerLoggingSupport {
private final String introMessage;
public StandardWarningHandler(String introMessage) {
this.introMessage = introMessage;
}
public boolean doProcess() {
return log.isWarnEnabled();
}
public void prepare(SQLWarning warning) {
log.debug( introMessage, warning );
}
@Override
protected void logWarning(String description, String message) {
log.warn( description );
log.warn( message );
}
}
public static StandardWarningHandler STANDARD_WARNING_HANDLER = new StandardWarningHandler( DEFAULT_WARNING_MSG );
public void walkWarnings(SQLWarning warning, WarningHandler handler) {
if ( warning == null || handler.doProcess() ) {
return;
}
handler.prepare( warning );
while ( warning != null ) {
handler.handleWarning( warning );
warning = warning.getNextWarning();
}
}
/**
* Standard (legacy) behavior for logging warnings associated with a JDBC {@link Connection} and clearing them.
* <p/>
* Calls {@link #handleAndClearWarnings(Connection, WarningHandler)} using {@link #STANDARD_WARNING_HANDLER}
*
* @param connection The JDBC connection potentially containing warnings
*/
public void logAndClearWarnings(Connection connection) {
handleAndClearWarnings( connection, STANDARD_WARNING_HANDLER );
}
/**
* General purpose handling of warnings associated with a JDBC {@link Connection}.
*
* @param connection The JDBC connection potentially containing warnings
* @param handler The handler for each individual warning in the stack.
* @see #walkWarnings
*/
@SuppressWarnings( {"ThrowableResultOfMethodCallIgnored"})
public void handleAndClearWarnings(Connection connection, WarningHandler handler) {
try {
walkWarnings( connection.getWarnings(), handler );
}
catch (SQLException sqle) {
//workaround for WebLogic
log.debug( "could not log warnings", sqle );
}
try {
//Sybase fail if we don't do that, sigh...
connection.clearWarnings();
}
catch (SQLException sqle) {
log.debug( "could not clear warnings", sqle );
}
}
/**
* General purpose handling of warnings associated with a JDBC {@link Statement}.
*
* @param statement The JDBC statement potentially containing warnings
* @param handler The handler for each individual warning in the stack.
* @see #walkWarnings
*/
@SuppressWarnings( {"ThrowableResultOfMethodCallIgnored"})
public void handleAndClearWarnings(Statement statement, WarningHandler handler) {
try {
walkWarnings( statement.getWarnings(), handler );
}
catch (SQLException sqlException) {
//workaround for WebLogic
log.debug( "could not log warnings", sqlException );
}
try {
//Sybase fail if we don't do that, sigh...
statement.clearWarnings();
}
catch (SQLException sqle) {
log.debug( "could not clear warnings", sqle );
}
}
}

View File

@ -34,7 +34,7 @@ import java.io.Serializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.hibernate.util.IdentityMap;
import org.hibernate.internal.util.collections.IdentityMap;
import org.hibernate.engine.PersistenceContext;
import org.hibernate.engine.CollectionKey;
import org.hibernate.engine.SessionImplementor;

View File

@ -28,10 +28,10 @@ import org.hibernate.hql.QuerySplitter;
import org.hibernate.hql.QueryTranslator;
import org.hibernate.hql.ParameterTranslations;
import org.hibernate.hql.FilterTranslator;
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.EmptyIterator;
import org.hibernate.util.JoinedIterator;
import org.hibernate.util.IdentitySet;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.internal.util.collections.EmptyIterator;
import org.hibernate.internal.util.collections.JoinedIterator;
import org.hibernate.internal.util.collections.IdentitySet;
import org.hibernate.HibernateException;
import org.hibernate.ScrollableResults;
import org.hibernate.QueryException;

View File

@ -44,7 +44,7 @@ import org.hibernate.engine.TypedValue;
import org.hibernate.event.EventSource;
import org.hibernate.loader.custom.sql.SQLCustomQuery;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
/**
* Defines a query execution plan for a native-SQL query.

View File

@ -24,7 +24,7 @@
*/
package org.hibernate.engine.query;
import org.hibernate.util.ArrayHelper;
import org.hibernate.internal.util.collections.ArrayHelper;
import java.util.Map;
import java.util.HashMap;

View File

@ -26,7 +26,7 @@ package org.hibernate.engine.query;
import org.hibernate.QueryException;
import org.hibernate.hql.classic.ParserHelper;
import org.hibernate.util.StringHelper;
import org.hibernate.internal.util.StringHelper;
/**
* The single available method {@link #parse} is responsible for parsing a

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