diff --git a/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java b/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java
index dc0539f4c7..88dba86913 100644
--- a/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java
+++ b/annotations/src/main/java/org/hibernate/cfg/annotations/BagBinder.java
@@ -37,6 +37,6 @@ public class BagBinder extends CollectionBinder {
}
protected Collection createCollection(PersistentClass persistentClass) {
- return new org.hibernate.mapping.Bag( persistentClass );
+ return new org.hibernate.mapping.Bag( getMappings(), persistentClass );
}
}
diff --git a/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java b/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java
index d1988f95d3..63a7650a12 100644
--- a/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java
+++ b/annotations/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java
@@ -163,6 +163,10 @@ public abstract class CollectionBinder {
private AccessType accessType;
private boolean hibernateExtensionMapping;
+ protected ExtendedMappings getMappings() {
+ return mappings;
+ }
+
public boolean isMap() {
return false;
}
@@ -700,7 +704,7 @@ public abstract class CollectionBinder {
) {
log.debug("Binding a OneToMany: {}.{} through a foreign key", propertyHolder.getEntityName(), propertyName);
- org.hibernate.mapping.OneToMany oneToMany = new org.hibernate.mapping.OneToMany( collection.getOwner() );
+ org.hibernate.mapping.OneToMany oneToMany = new org.hibernate.mapping.OneToMany( extendedMappings, collection.getOwner() );
collection.setElement( oneToMany );
oneToMany.setReferencedEntityName( collectionType.getName() );
oneToMany.setIgnoreNotFound( ignoreNotFound );
diff --git a/core/src/main/java/org/hibernate/Hibernate.java b/core/src/main/java/org/hibernate/Hibernate.java
index 3993be5863..b582d56fa9 100644
--- a/core/src/main/java/org/hibernate/Hibernate.java
+++ b/core/src/main/java/org/hibernate/Hibernate.java
@@ -26,7 +26,6 @@ package org.hibernate;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-import java.io.Serializable;
import java.io.ByteArrayOutputStream;
import java.sql.Blob;
import java.sql.Clob;
@@ -44,7 +43,6 @@ import org.hibernate.intercept.FieldInterceptionHelper;
import org.hibernate.intercept.FieldInterceptor;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;
-import org.hibernate.type.AnyType;
import org.hibernate.type.BigDecimalType;
import org.hibernate.type.BigIntegerType;
import org.hibernate.type.BinaryType;
@@ -56,16 +54,13 @@ import org.hibernate.type.CalendarType;
import org.hibernate.type.CharacterType;
import org.hibernate.type.ClassType;
import org.hibernate.type.ClobType;
-import org.hibernate.type.CompositeCustomType;
import org.hibernate.type.CurrencyType;
-import org.hibernate.type.CustomType;
import org.hibernate.type.DateType;
import org.hibernate.type.DoubleType;
import org.hibernate.type.FloatType;
import org.hibernate.type.IntegerType;
import org.hibernate.type.LocaleType;
import org.hibernate.type.LongType;
-import org.hibernate.type.ManyToOneType;
import org.hibernate.type.ObjectType;
import org.hibernate.type.SerializableType;
import org.hibernate.type.ShortType;
@@ -76,7 +71,6 @@ import org.hibernate.type.TimeZoneType;
import org.hibernate.type.TimestampType;
import org.hibernate.type.TrueFalseType;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
import org.hibernate.type.YesNoType;
import org.hibernate.type.CharArrayType;
import org.hibernate.type.WrapperBinaryType;
@@ -84,7 +78,6 @@ import org.hibernate.type.CharacterArrayType;
import org.hibernate.type.MaterializedBlobType;
import org.hibernate.type.ImageType;
import org.hibernate.type.MaterializedClobType;
-import org.hibernate.usertype.CompositeUserType;
/**
*
@@ -281,83 +274,76 @@ public final class Hibernate {
/**
* A Hibernate serializable type.
+ *
+ * @param serializableClass The {@link java.io.Serializable} implementor class.
+ *
+ * @return
+ *
* @deprecated Use {@link SerializableType#SerializableType} instead.
*/
+ @SuppressWarnings({ "unchecked" })
public static Type serializable(Class serializableClass) {
return new SerializableType( serializableClass );
}
/**
- * A Hibernate any type.
+ * DO NOT USE!
*
- * @param metaType a type mapping java.lang.Class to a single column
- * @param identifierType the entity identifier type
- * @return the Type
+ * @deprecated Use {@link TypeHelper#any} instead.
*/
+ @SuppressWarnings({ "JavaDoc", "UnusedDeclaration" })
public static Type any(Type metaType, Type identifierType) {
- return new AnyType( metaType, identifierType );
+ throw new HibernateException( "Not supported" );
}
/**
- * A Hibernate persistent object (entity) type.
+ * DO NOT USE!
*
- * @param persistentClass a mapped entity class
+ * @deprecated Use {@link TypeHelper#entity} instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
*/
+ @SuppressWarnings({ "JavaDoc", "UnusedDeclaration" })
public static Type entity(Class persistentClass) {
- // not really a many-to-one association *necessarily*
- return new ManyToOneType( persistentClass.getName() );
+ throw new HibernateException( "Not supported" );
}
/**
- * A Hibernate persistent object (entity) type.
+ * DO NOT USE!
*
- * @param entityName a mapped entity class
+ * @deprecated Use {@link TypeHelper#entity} instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
*/
+ @SuppressWarnings({ "JavaDoc", "UnusedDeclaration" })
public static Type entity(String entityName) {
- // not really a many-to-one association *necessarily*
- return new ManyToOneType( entityName );
+ throw new HibernateException( "Not supported" );
}
/**
- * A Hibernate custom type.
+ * DO NOT USE!
*
- * @param userTypeClass a class that implements UserType
+ * @deprecated Use {@link TypeHelper#custom} instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
*/
- public static Type custom(Class userTypeClass) throws HibernateException {
- return custom( userTypeClass, null );
+ @SuppressWarnings({ "JavaDoc", "UnusedDeclaration" })
+ public static Type custom(Class userTypeClass) {
+ throw new HibernateException( "Not supported" );
}
/**
- * A Hibernate parameterizable custom type.
+ * DO NOT USE!
*
- * @param userTypeClass a class that implements UserType and ParameterizableType
- * @param parameterNames the names of the parameters passed to the type
- * @param parameterValues the values of the parameters passed to the type. They must match
- * up with the order and length of the parameterNames array.
+ * @deprecated Use {@link TypeHelper#custom} instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
*/
- public static Type custom(Class userTypeClass, String[] parameterNames, String[] parameterValues)
- throws HibernateException {
- Properties parameters = new Properties();
- for ( int i = 0; i < parameterNames.length; i++ ) {
- parameters.setProperty( parameterNames[i], parameterValues[i] );
- }
- return custom( userTypeClass, parameters );
+ @SuppressWarnings({ "JavaDoc", "UnusedDeclaration" })
+ public static Type custom(Class userTypeClass, String[] parameterNames, String[] parameterValues) {
+ throw new HibernateException( "Not supported" );
}
/**
- * A Hibernate parameterizable custom type.
+ * DO NOT USE!
*
- * @param userTypeClass a class that implements UserType and ParameterizableType
- * @param parameters the parameters as a collection of name/value pairs
+ * @deprecated Use {@link TypeHelper#custom} instead; see http://opensource.atlassian.com/projects/hibernate/browse/HHH-5182
*/
- public static Type custom(Class userTypeClass, Properties parameters)
- throws HibernateException {
- if ( CompositeUserType.class.isAssignableFrom( userTypeClass ) ) {
- return TypeFactory.customComponent( userTypeClass, parameters );
- }
- else {
- return TypeFactory.custom( userTypeClass, parameters );
- }
+ @SuppressWarnings({ "JavaDoc", "UnusedDeclaration" })
+ public static Type custom(Class userTypeClass, Properties parameters) {
+ throw new HibernateException( "Not supported" );
}
/**
diff --git a/core/src/main/java/org/hibernate/Session.java b/core/src/main/java/org/hibernate/Session.java
index b02324cfa6..3c1798fb4e 100644
--- a/core/src/main/java/org/hibernate/Session.java
+++ b/core/src/main/java/org/hibernate/Session.java
@@ -995,20 +995,26 @@ public interface Session extends Serializable {
*/
public void disableFetchProfile(String name) throws UnknownProfileException;
+ /**
+ * Convenience access to the {@link TypeHelper} associated with this session's {@link SessionFactory}.
+ *
+ * Equivalent to calling {@link #getSessionFactory()}.{@link SessionFactory#getTypeHelper getTypeHelper()}
+ *
+ * @return The {@link TypeHelper} associated with this session's {@link SessionFactory}
+ */
+ public TypeHelper getTypeHelper();
-/**
- * Contains locking details (LockMode, Timeout and Scope).
- *
- */
- public interface LockRequest
- {
-
+ /**
+ * Contains locking details (LockMode, Timeout and Scope).
+ */
+ public interface LockRequest {
static final int PESSIMISTIC_NO_WAIT = 0;
static final int PESSIMISTIC_WAIT_FOREVER = -1;
-
+
/**
* Get the lock mode.
+ *
* @return the lock mode.
*/
LockMode getLockMode();
@@ -1017,6 +1023,7 @@ public interface Session extends Serializable {
* Specify the LockMode to be used. The default is LockMode.none.
*
* @param lockMode
+ *
* @return this LockRequest instance for operation chaining.
*/
LockRequest setLockMode(LockMode lockMode);
@@ -1033,12 +1040,14 @@ public interface Session extends Serializable {
* The default pessimistic lock behavior is to wait forever for the lock.
*
* @param timeout is time in milliseconds to wait for lock. -1 means wait forever and 0 means no wait.
+ *
* @return this LockRequest instance for operation chaining.
*/
LockRequest setTimeOut(int timeout);
/**
* Check if locking is cascaded to owned collections and relationships.
+ *
* @return true if locking will be extended to owned collections and relationships.
*/
boolean getScope();
@@ -1048,6 +1057,7 @@ public interface Session extends Serializable {
* The association must be mapped with cascade="lock" for scope=true to work.
*
* @param scope
+ *
* @return
*/
LockRequest setScope(boolean scope);
@@ -1055,7 +1065,5 @@ public interface Session extends Serializable {
void lock(String entityName, Object object) throws HibernateException;
public void lock(Object object) throws HibernateException;
-
}
-
}
diff --git a/core/src/main/java/org/hibernate/SessionFactory.java b/core/src/main/java/org/hibernate/SessionFactory.java
index 70f1e4db61..cd6b29972b 100644
--- a/core/src/main/java/org/hibernate/SessionFactory.java
+++ b/core/src/main/java/org/hibernate/SessionFactory.java
@@ -386,4 +386,11 @@ public interface SessionFactory extends Referenceable, Serializable {
* @return True if there is such a fetch profile; false otherwise.
*/
public boolean containsFetchProfileDefinition(String name);
+
+ /**
+ * Retrieve this factory's {@link TypeHelper}
+ *
+ * @return The factory's {@link TypeHelper}
+ */
+ public TypeHelper getTypeHelper();
}
diff --git a/core/src/main/java/org/hibernate/TypeHelper.java b/core/src/main/java/org/hibernate/TypeHelper.java
new file mode 100644
index 0000000000..67aec575b5
--- /dev/null
+++ b/core/src/main/java/org/hibernate/TypeHelper.java
@@ -0,0 +1,112 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate;
+
+import java.util.Properties;
+
+import org.hibernate.type.BasicType;
+import org.hibernate.type.Type;
+
+/**
+ * Provides access to the various {@link Type} instances associated with the {@link SessionFactory}.
+ *
+ * This is intended for use by application developers.
+ *
+ * @author Steve Ebersole
+ */
+public interface TypeHelper {
+ /**
+ * Retrieve the basic type registered against the given name.
+ *
+ * @param name The name of the basic type to retrieve
+ *
+ * @return The basic type, or null.
+ */
+ public BasicType basic(String name);
+
+ /**
+ * Convenience form of {@link #basic(String)}. The intended use of this is something like
+ * {@code basic(Integer.class)} or {@code basic(int.class)}
+ *
+ * @param javaType The java type for which to retrieve the type instance.
+ *
+ * @return The basic type, or null.
+ */
+ public BasicType basic(Class javaType);
+
+ /**
+ * Uses heuristics to deduce the proper {@link Type} given a string naming the type or Java class.
+ *
+ * See {@link org.hibernate.type.TypeResolver#heuristicType(java.lang.String)} for a discussion of the
+ * heuristic algorithm.
+ *
+ * @param name The name of the type or Java class
+ *
+ * @return The deduced type, or null.
+ *
+ * @see org.hibernate.type.TypeResolver#heuristicType(java.lang.String)
+ */
+ public Type heuristicType(String name);
+
+ /**
+ * Retrieve a type representing the given entity.
+ *
+ * @param entityClass The entity Java type.
+ *
+ * @return The type, or null
+ */
+ public Type entity(Class entityClass);
+
+ /**
+ * Retrieve a type representing the given entity.
+ *
+ * @param entityName The entity name.
+ *
+ * @return The type, or null
+ */
+ public Type entity(String entityName);
+
+ /**
+ * Retrieve the type for the given user-type class ({@link org.hibernate.usertype.UserType} or
+ * {@link org.hibernate.usertype.CompositeUserType}).
+ *
+ * @param userTypeClass The user type class
+ *
+ * @return The type, or null
+ */
+ public Type custom(Class userTypeClass);
+
+ /**
+ * Retrieve the type for the given user-type class ({@link org.hibernate.usertype.UserType} or
+ * {@link org.hibernate.usertype.CompositeUserType}).
+ *
+ * @param userTypeClass The user type class
+ * @param properties Configuration properties.
+ *
+ * @return The type, or null
+ */
+ public Type custom(Class userTypeClass, Properties properties);
+
+ public Type any(Type metaType, Type identifierType);
+}
diff --git a/core/src/main/java/org/hibernate/action/EntityUpdateAction.java b/core/src/main/java/org/hibernate/action/EntityUpdateAction.java
index 3a9bc00f43..1fc1617e2b 100644
--- a/core/src/main/java/org/hibernate/action/EntityUpdateAction.java
+++ b/core/src/main/java/org/hibernate/action/EntityUpdateAction.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.action;
@@ -43,7 +42,7 @@ import org.hibernate.event.PreUpdateEvent;
import org.hibernate.event.PreUpdateEventListener;
import org.hibernate.event.EventSource;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
public final class EntityUpdateAction extends EntityAction {
private final Object[] state;
@@ -133,7 +132,7 @@ public final class EntityUpdateAction extends EntityAction {
// 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)
// has a reference to the array
- TypeFactory.deepCopy(
+ TypeHelper.deepCopy(
state,
persister.getPropertyTypes(),
persister.getPropertyCheckability(),
diff --git a/core/src/main/java/org/hibernate/cache/StandardQueryCache.java b/core/src/main/java/org/hibernate/cache/StandardQueryCache.java
index a0bf3e81a4..85b211ca6e 100644
--- a/core/src/main/java/org/hibernate/cache/StandardQueryCache.java
+++ b/core/src/main/java/org/hibernate/cache/StandardQueryCache.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.cache;
@@ -38,7 +37,7 @@ import org.hibernate.UnresolvableObjectException;
import org.hibernate.cfg.Settings;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
/**
* The standard implementation of the Hibernate QueryCache interface. This
@@ -78,6 +77,7 @@ public class StandardQueryCache implements QueryCache {
this.updateTimestampsCache = updateTimestampsCache;
}
+ @SuppressWarnings({ "UnnecessaryBoxing", "unchecked" })
public boolean put(
QueryKey key,
Type[] returnTypes,
@@ -88,7 +88,7 @@ public class StandardQueryCache implements QueryCache {
return false;
}
else {
- Long ts = new Long( session.getTimestamp() );
+ Long ts = Long.valueOf( session.getTimestamp() );
if ( log.isDebugEnabled() ) {
log.debug( "caching query results in region: " + cacheRegion.getName() + "; timestamp=" + ts );
@@ -96,27 +96,23 @@ public class StandardQueryCache implements QueryCache {
List cacheable = new ArrayList( result.size() + 1 );
cacheable.add( ts );
- for ( int i = 0; i < result.size(); i++ ) {
+ for ( Object aResult : result ) {
if ( returnTypes.length == 1 ) {
- cacheable.add( returnTypes[0].disassemble( result.get( i ), session, null ) );
+ cacheable.add( returnTypes[0].disassemble( aResult, session, null ) );
}
else {
cacheable.add(
- TypeFactory.disassemble(
- ( Object[] ) result.get( i ), returnTypes, null, session, null
- )
+ TypeHelper.disassemble( (Object[]) aResult, returnTypes, null, session, null )
);
}
}
cacheRegion.put( key, cacheable );
-
return true;
-
}
-
}
+ @SuppressWarnings({ "unchecked" })
public List get(
QueryKey key,
Type[] returnTypes,
@@ -145,7 +141,7 @@ public class StandardQueryCache implements QueryCache {
returnTypes[0].beforeAssemble( ( Serializable ) cacheable.get( i ), session );
}
else {
- TypeFactory.beforeAssemble( ( Serializable[] ) cacheable.get( i ), returnTypes, session );
+ TypeHelper.beforeAssemble( ( Serializable[] ) cacheable.get( i ), returnTypes, session );
}
}
List result = new ArrayList( cacheable.size() - 1 );
@@ -156,9 +152,7 @@ public class StandardQueryCache implements QueryCache {
}
else {
result.add(
- TypeFactory.assemble(
- ( Serializable[] ) cacheable.get( i ), returnTypes, session, null
- )
+ TypeHelper.assemble( ( Serializable[] ) cacheable.get( i ), returnTypes, session, null )
);
}
}
diff --git a/core/src/main/java/org/hibernate/cache/entry/CacheEntry.java b/core/src/main/java/org/hibernate/cache/entry/CacheEntry.java
index 6bd675cbaa..0629d61585 100644
--- a/core/src/main/java/org/hibernate/cache/entry/CacheEntry.java
+++ b/core/src/main/java/org/hibernate/cache/entry/CacheEntry.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.cache.entry;
@@ -34,7 +33,7 @@ import org.hibernate.event.EventSource;
import org.hibernate.event.PreLoadEvent;
import org.hibernate.event.PreLoadEventListener;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
import org.hibernate.util.ArrayHelper;
/**
@@ -66,7 +65,7 @@ public final class CacheEntry implements Serializable {
final Object owner)
throws HibernateException {
//disassembled state gets put in a new array (we write to cache by value!)
- this.disassembledState = TypeFactory.disassemble(
+ this.disassembledState = TypeHelper.disassemble(
state,
persister.getPropertyTypes(),
persister.isLazyPropertiesCacheable() ?
@@ -112,11 +111,10 @@ public final class CacheEntry implements Serializable {
final Serializable id,
final EntityPersister persister,
final Interceptor interceptor,
- final EventSource session)
- throws HibernateException {
+ final EventSource session) throws HibernateException {
//assembled state gets put in a new array (we read from cache by value!)
- Object[] assembledProps = TypeFactory.assemble(
+ Object[] assembledProps = TypeHelper.assemble(
values,
persister.getPropertyTypes(),
session, result
@@ -132,8 +130,8 @@ public final class CacheEntry implements Serializable {
.setPersister(persister);
PreLoadEventListener[] listeners = session.getListeners().getPreLoadEventListeners();
- for ( int i = 0; i < listeners.length; i++ ) {
- listeners[i].onPreLoad(preLoadEvent);
+ for ( PreLoadEventListener listener : listeners ) {
+ listener.onPreLoad( preLoadEvent );
}
persister.setPropertyValues(
diff --git a/core/src/main/java/org/hibernate/cfg/Configuration.java b/core/src/main/java/org/hibernate/cfg/Configuration.java
index cce76303c2..ad8105de68 100644
--- a/core/src/main/java/org/hibernate/cfg/Configuration.java
+++ b/core/src/main/java/org/hibernate/cfg/Configuration.java
@@ -132,6 +132,7 @@ import org.hibernate.secure.JACCConfiguration;
import org.hibernate.tool.hbm2ddl.DatabaseMetadata;
import org.hibernate.tool.hbm2ddl.TableMetadata;
import org.hibernate.tool.hbm2ddl.IndexMetadata;
+import org.hibernate.type.BasicType;
import org.hibernate.type.BasicTypeRegistry;
import org.hibernate.type.SerializationException;
import org.hibernate.type.Type;
@@ -2286,6 +2287,10 @@ public class Configuration implements Serializable {
return typeResolver;
}
+ public void registerTypeOverride(BasicType type) {
+ getTypeResolver().registerTypeOverride( type );
+ }
+
public SessionFactoryObserver getSessionFactoryObserver() {
return sessionFactoryObserver;
}
diff --git a/core/src/main/java/org/hibernate/cfg/HbmBinder.java b/core/src/main/java/org/hibernate/cfg/HbmBinder.java
index 4e6436720b..4e707b0eda 100644
--- a/core/src/main/java/org/hibernate/cfg/HbmBinder.java
+++ b/core/src/main/java/org/hibernate/cfg/HbmBinder.java
@@ -1440,7 +1440,7 @@ public final class HbmBinder {
Element oneToManyNode = node.element( "one-to-many" );
if ( oneToManyNode != null ) {
- OneToMany oneToMany = new OneToMany( collection.getOwner() );
+ OneToMany oneToMany = new OneToMany( mappings, collection.getOwner() );
collection.setElement( oneToMany );
bindOneToMany( oneToManyNode, oneToMany, mappings );
// we have to set up the table later!! yuck
@@ -2840,7 +2840,7 @@ public final class HbmBinder {
private static final CollectionType MAP = new CollectionType( "map" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- Map map = new Map( owner );
+ Map map = new Map( mappings, owner );
bindCollection( node, map, owner.getEntityName(), path, mappings, inheritedMetas );
return map;
}
@@ -2848,7 +2848,7 @@ public final class HbmBinder {
private static final CollectionType SET = new CollectionType( "set" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- Set set = new Set( owner );
+ Set set = new Set( mappings, owner );
bindCollection( node, set, owner.getEntityName(), path, mappings, inheritedMetas );
return set;
}
@@ -2856,7 +2856,7 @@ public final class HbmBinder {
private static final CollectionType LIST = new CollectionType( "list" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- List list = new List( owner );
+ List list = new List( mappings, owner );
bindCollection( node, list, owner.getEntityName(), path, mappings, inheritedMetas );
return list;
}
@@ -2864,7 +2864,7 @@ public final class HbmBinder {
private static final CollectionType BAG = new CollectionType( "bag" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- Bag bag = new Bag( owner );
+ Bag bag = new Bag( mappings, owner );
bindCollection( node, bag, owner.getEntityName(), path, mappings, inheritedMetas );
return bag;
}
@@ -2872,7 +2872,7 @@ public final class HbmBinder {
private static final CollectionType IDBAG = new CollectionType( "idbag" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- IdentifierBag bag = new IdentifierBag( owner );
+ IdentifierBag bag = new IdentifierBag( mappings, owner );
bindCollection( node, bag, owner.getEntityName(), path, mappings, inheritedMetas );
return bag;
}
@@ -2880,7 +2880,7 @@ public final class HbmBinder {
private static final CollectionType ARRAY = new CollectionType( "array" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- Array array = new Array( owner );
+ Array array = new Array( mappings, owner );
bindArray( node, array, owner.getEntityName(), path, mappings, inheritedMetas );
return array;
}
@@ -2888,7 +2888,7 @@ public final class HbmBinder {
private static final CollectionType PRIMITIVE_ARRAY = new CollectionType( "primitive-array" ) {
public Collection create(Element node, String path, PersistentClass owner,
Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
- PrimitiveArray array = new PrimitiveArray( owner );
+ PrimitiveArray array = new PrimitiveArray( mappings, owner );
bindArray( node, array, owner.getEntityName(), path, mappings, inheritedMetas );
return array;
}
diff --git a/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java b/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
index efd10475ad..a38af7df0d 100755
--- a/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
+++ b/core/src/main/java/org/hibernate/engine/TwoPhaseLoad.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.engine;
@@ -44,7 +43,7 @@ import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.property.BackrefPropertyAccessor;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
/**
* Functionality relating to Hibernate's two-phase loading process,
@@ -211,13 +210,13 @@ public final class TwoPhaseLoad {
}
else {
//take a snapshot
- TypeFactory.deepCopy(
+ TypeHelper.deepCopy(
hydratedState,
persister.getPropertyTypes(),
persister.getPropertyUpdateability(),
hydratedState, //after setting values to object, entityMode
session
- );
+ );
persistenceContext.setEntryStatus(entityEntry, Status.MANAGED);
}
diff --git a/core/src/main/java/org/hibernate/event/def/AbstractReassociateEventListener.java b/core/src/main/java/org/hibernate/event/def/AbstractReassociateEventListener.java
index 2378111456..7a39c70e0f 100644
--- a/core/src/main/java/org/hibernate/event/def/AbstractReassociateEventListener.java
+++ b/core/src/main/java/org/hibernate/event/def/AbstractReassociateEventListener.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.event.def;
@@ -38,7 +37,7 @@ import org.hibernate.event.AbstractEvent;
import org.hibernate.event.EventSource;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
/**
* A convenience base class for listeners that respond to requests to reassociate an entity
@@ -77,7 +76,7 @@ public class AbstractReassociateEventListener implements Serializable {
//get a snapshot
Object[] values = persister.getPropertyValues( object, source.getEntityMode() );
- TypeFactory.deepCopy(
+ TypeHelper.deepCopy(
values,
persister.getPropertyTypes(),
persister.getPropertyUpdateability(),
diff --git a/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java b/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java
index 4632c511ac..3ca19f9bea 100644
--- a/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java
+++ b/core/src/main/java/org/hibernate/event/def/AbstractSaveEventListener.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.event.def;
@@ -53,7 +52,7 @@ import org.hibernate.intercept.FieldInterceptor;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
/**
* A convenience bas class for listeners responding to save events.
@@ -300,7 +299,7 @@ public abstract class AbstractSaveEventListener extends AbstractReassociateEvent
persister.setPropertyValues( entity, values, source.getEntityMode() );
}
- TypeFactory.deepCopy(
+ TypeHelper.deepCopy(
values,
types,
persister.getPropertyUpdateability(),
diff --git a/core/src/main/java/org/hibernate/event/def/DefaultDeleteEventListener.java b/core/src/main/java/org/hibernate/event/def/DefaultDeleteEventListener.java
index dfe3b63766..21fbee797f 100644
--- a/core/src/main/java/org/hibernate/event/def/DefaultDeleteEventListener.java
+++ b/core/src/main/java/org/hibernate/event/def/DefaultDeleteEventListener.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.event.def;
@@ -34,7 +33,6 @@ import org.hibernate.CacheMode;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
import org.hibernate.TransientObjectException;
-import org.hibernate.util.IdentitySet;
import org.hibernate.action.EntityDeleteAction;
import org.hibernate.classic.Lifecycle;
import org.hibernate.engine.Cascade;
@@ -51,7 +49,8 @@ import org.hibernate.event.EventSource;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
+import org.hibernate.util.IdentitySet;
/**
* Defines the default delete event listener used by hibernate for deleting entities
@@ -299,7 +298,7 @@ public class DefaultDeleteEventListener implements DeleteEventListener {
// TypeFactory.deepCopy( currentState, propTypes, persister.getPropertyUpdateability(), deletedState, session );
boolean[] copyability = new boolean[propTypes.length];
java.util.Arrays.fill( copyability, true );
- TypeFactory.deepCopy( currentState, propTypes, copyability, deletedState, session );
+ TypeHelper.deepCopy( currentState, propTypes, copyability, deletedState, session );
return deletedState;
}
diff --git a/core/src/main/java/org/hibernate/event/def/DefaultLoadEventListener.java b/core/src/main/java/org/hibernate/event/def/DefaultLoadEventListener.java
index 117a058ee2..504946a7e1 100644
--- a/core/src/main/java/org/hibernate/event/def/DefaultLoadEventListener.java
+++ b/core/src/main/java/org/hibernate/event/def/DefaultLoadEventListener.java
@@ -56,7 +56,7 @@ import org.hibernate.proxy.LazyInitializer;
import org.hibernate.type.EmbeddedComponentType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
/**
* Defines the default load event listeners used by hibernate for loading entities
@@ -648,13 +648,13 @@ public class DefaultLoadEventListener extends AbstractLockUpgradeEventListener i
Type[] types = subclassPersister.getPropertyTypes();
Object[] values = entry.assemble( result, id, subclassPersister, session.getInterceptor(), session ); // intializes result by side-effect
- TypeFactory.deepCopy(
+ TypeHelper.deepCopy(
values,
types,
subclassPersister.getPropertyUpdateability(),
values,
session
- );
+ );
Object version = Versioning.getVersion( values, subclassPersister );
if ( log.isTraceEnabled() ) log.trace( "Cached Version: " + version );
diff --git a/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java b/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
index d2b694783e..441d5eeaf2 100755
--- a/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
+++ b/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java
@@ -55,8 +55,8 @@ import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;
import org.hibernate.type.ForeignKeyDirection;
-import org.hibernate.type.TypeFactory;
import org.hibernate.type.Type;
+import org.hibernate.type.TypeHelper;
/**
* Defines the default copy event listener used by hibernate for copying entities
@@ -492,7 +492,7 @@ public class DefaultMergeEventListener extends AbstractSaveEventListener
final SessionImplementor source,
final Map copyCache
) {
- final Object[] copiedValues = TypeFactory.replace(
+ final Object[] copiedValues = TypeHelper.replace(
persister.getPropertyValues( entity, source.getEntityMode() ),
persister.getPropertyValues( target, source.getEntityMode() ),
persister.getPropertyTypes(),
@@ -518,7 +518,7 @@ public class DefaultMergeEventListener extends AbstractSaveEventListener
// this is the second pass through on a merge op, so here we limit the
// replacement to associations types (value types were already replaced
// during the first pass)
- copiedValues = TypeFactory.replaceAssociations(
+ copiedValues = TypeHelper.replaceAssociations(
persister.getPropertyValues( entity, source.getEntityMode() ),
persister.getPropertyValues( target, source.getEntityMode() ),
persister.getPropertyTypes(),
@@ -529,7 +529,7 @@ public class DefaultMergeEventListener extends AbstractSaveEventListener
);
}
else {
- copiedValues = TypeFactory.replace(
+ copiedValues = TypeHelper.replace(
persister.getPropertyValues( entity, source.getEntityMode() ),
persister.getPropertyValues( target, source.getEntityMode() ),
persister.getPropertyTypes(),
diff --git a/core/src/main/java/org/hibernate/hql/ast/tree/FromElementType.java b/core/src/main/java/org/hibernate/hql/ast/tree/FromElementType.java
index db708c01a0..19b5186e37 100644
--- a/core/src/main/java/org/hibernate/hql/ast/tree/FromElementType.java
+++ b/core/src/main/java/org/hibernate/hql/ast/tree/FromElementType.java
@@ -117,7 +117,10 @@ class FromElementType {
public Type getSelectType() {
if (entityType==null) return null;
boolean shallow = fromElement.getFromClause().getWalker().isShallowQuery();
- return TypeFactory.manyToOne( entityType.getAssociatedEntityName(), shallow );
+ return fromElement.getSessionFactoryHelper()
+ .getFactory()
+ .getTypeResolver()
+ .getTypeFactory().manyToOne( entityType.getAssociatedEntityName(), shallow );
}
/**
diff --git a/core/src/main/java/org/hibernate/hql/classic/PathExpressionParser.java b/core/src/main/java/org/hibernate/hql/classic/PathExpressionParser.java
index f573d43f29..fc1621e667 100644
--- a/core/src/main/java/org/hibernate/hql/classic/PathExpressionParser.java
+++ b/core/src/main/java/org/hibernate/hql/classic/PathExpressionParser.java
@@ -113,7 +113,7 @@ public class PathExpressionParser implements Parser {
q.addType( currentName, entityName );
Queryable classPersister = q.getEntityPersister( entityName );
//QueryJoinFragment join = q.createJoinFragment(useThetaStyleJoin);
- addJoin( currentName, TypeFactory.manyToOne( entityName ), joinColumns );
+ addJoin( currentName, q.getFactory().getTypeResolver().getTypeFactory().manyToOne( entityName ), joinColumns );
currentPropertyMapping = classPersister;
return currentName;
}
diff --git a/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java b/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java
index f635a1dfa6..b162055c9c 100644
--- a/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java
+++ b/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java
@@ -662,7 +662,9 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
int j = 0;
for ( int i = 0; i < persisters.length; i++ ) {
if ( includeInSelect[i] ) {
- actualReturnTypes[j++] = TypeFactory.manyToOne( persisters[i].getEntityName(), shallowQuery );
+ actualReturnTypes[j++] = getFactory().getTypeResolver()
+ .getTypeFactory()
+ .manyToOne( persisters[i].getEntityName(), shallowQuery );
}
}
}
@@ -719,7 +721,9 @@ public class QueryTranslatorImpl extends BasicLoader implements FilterTranslator
int size = returnedTypes.size();
for ( int k = 0; k < size; k++ ) {
- scalarTypes.add( TypeFactory.manyToOne( persisters[k].getEntityName(), shallowQuery ) );
+ scalarTypes.add(
+ getFactory().getTypeResolver().getTypeFactory().manyToOne( persisters[k].getEntityName(), shallowQuery )
+ );
String[] idColumnNames = persisters[k].getIdentifierColumnNames();
for ( int i = 0; i < idColumnNames.length; i++ ) {
diff --git a/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java b/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
index f2cea669fb..25b244a845 100644
--- a/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
+++ b/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
@@ -62,6 +62,7 @@ import org.hibernate.StatelessSession;
import org.hibernate.SessionFactoryObserver;
import org.hibernate.EntityNameResolver;
import org.hibernate.Cache;
+import org.hibernate.TypeHelper;
import org.hibernate.tuple.entity.EntityTuplizer;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.CollectionRegion;
@@ -114,7 +115,6 @@ import org.hibernate.pretty.MessageHelper;
import org.hibernate.proxy.EntityNotFoundDelegate;
import org.hibernate.stat.Statistics;
import org.hibernate.stat.StatisticsImpl;
-import org.hibernate.stat.ConcurrentStatisticsImpl;
import org.hibernate.stat.StatisticsImplementor;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
@@ -191,6 +191,7 @@ public final class SessionFactoryImpl implements SessionFactory, SessionFactoryI
private final transient Cache cacheAccess = new CacheImpl();
private transient boolean isClosed = false;
private final transient TypeResolver typeResolver;
+ private final transient TypeHelper typeHelper;
public SessionFactoryImpl(
Configuration cfg,
@@ -234,6 +235,7 @@ public final class SessionFactoryImpl implements SessionFactory, SessionFactoryI
};
this.typeResolver = cfg.getTypeResolver().scope( this );
+ this.typeHelper = new TypeLocatorImpl( typeResolver );
this.filters = new HashMap();
this.filters.putAll( cfg.getFilterDefinitions() );
@@ -1302,6 +1304,10 @@ public final class SessionFactoryImpl implements SessionFactory, SessionFactoryI
return ( FetchProfile ) fetchProfiles.get( name );
}
+ public TypeHelper getTypeHelper() {
+ return typeHelper;
+ }
+
/**
* Custom serialization hook used during Session serialization.
*
diff --git a/core/src/main/java/org/hibernate/impl/SessionImpl.java b/core/src/main/java/org/hibernate/impl/SessionImpl.java
index e4ab76e735..990080cbb7 100644
--- a/core/src/main/java/org/hibernate/impl/SessionImpl.java
+++ b/core/src/main/java/org/hibernate/impl/SessionImpl.java
@@ -66,6 +66,7 @@ import org.hibernate.SessionException;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.TransientObjectException;
+import org.hibernate.TypeHelper;
import org.hibernate.UnresolvableObjectException;
import org.hibernate.UnknownProfileException;
import org.hibernate.EntityNameResolver;
@@ -2213,6 +2214,13 @@ public final class SessionImpl extends AbstractSessionImpl
}
}
+ /**
+ * {@inheritDoc}
+ */
+ public TypeHelper getTypeHelper() {
+ return getSessionFactory().getTypeHelper();
+ }
+
private class CoordinatingEntityNameResolver implements EntityNameResolver {
public String resolveEntityName(Object entity) {
String entityName = interceptor.getEntityName( entity );
diff --git a/core/src/main/java/org/hibernate/impl/TypeLocatorImpl.java b/core/src/main/java/org/hibernate/impl/TypeLocatorImpl.java
new file mode 100644
index 0000000000..b88858f221
--- /dev/null
+++ b/core/src/main/java/org/hibernate/impl/TypeLocatorImpl.java
@@ -0,0 +1,186 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate.impl;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import org.hibernate.TypeHelper;
+import org.hibernate.type.BasicType;
+import org.hibernate.type.Type;
+import org.hibernate.type.TypeResolver;
+import org.hibernate.usertype.CompositeUserType;
+
+/**
+ * Implementation of {@link org.hibernate.TypeHelper}
+ *
+ * @todo Do we want to cache the results of {@link #entity}, {@link #custom} and {@link #any} ?
+ *
+ * @author Steve Ebersole
+ */
+public class TypeLocatorImpl implements TypeHelper, Serializable {
+ private final TypeResolver typeResolver;
+
+ public TypeLocatorImpl(TypeResolver typeResolver) {
+ this.typeResolver = typeResolver;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BasicType basic(String name) {
+ return typeResolver.basic( name );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BasicType basic(Class javaType) {
+ BasicType type = typeResolver.basic( javaType.getName() );
+ if ( type == null ) {
+ final Class variant = resolvePrimitiveOrPrimitiveWrapperVariantJavaType( javaType );
+ if ( variant != null ) {
+ type = typeResolver.basic( variant.getName() );
+ }
+ }
+ return type;
+ }
+
+ private Class resolvePrimitiveOrPrimitiveWrapperVariantJavaType(Class javaType) {
+ // boolean
+ if ( Boolean.TYPE.equals( javaType ) ) {
+ return Boolean.class;
+ }
+ if ( Boolean.class.equals( javaType ) ) {
+ return Boolean.TYPE;
+ }
+
+ // char
+ if ( Character.TYPE.equals( javaType ) ) {
+ return Character.class;
+ }
+ if ( Character.class.equals( javaType ) ) {
+ return Character.TYPE;
+ }
+
+ // byte
+ if ( Byte.TYPE.equals( javaType ) ) {
+ return Byte.class;
+ }
+ if ( Byte.class.equals( javaType ) ) {
+ return Byte.TYPE;
+ }
+
+ // short
+ if ( Short.TYPE.equals( javaType ) ) {
+ return Short.class;
+ }
+ if ( Short.class.equals( javaType ) ) {
+ return Short.TYPE;
+ }
+
+ // int
+ if ( Integer.TYPE.equals( javaType ) ) {
+ return Integer.class;
+ }
+ if ( Integer.class.equals( javaType ) ) {
+ return Integer.TYPE;
+ }
+
+ // long
+ if ( Long.TYPE.equals( javaType ) ) {
+ return Long.class;
+ }
+ if ( Long.class.equals( javaType ) ) {
+ return Long.TYPE;
+ }
+
+ // float
+ if ( Float.TYPE.equals( javaType ) ) {
+ return Float.class;
+ }
+ if ( Float.class.equals( javaType ) ) {
+ return Float.TYPE;
+ }
+
+ // double
+ if ( Double.TYPE.equals( javaType ) ) {
+ return Double.class;
+ }
+ if ( Double.class.equals( javaType ) ) {
+ return Double.TYPE;
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Type heuristicType(String name) {
+ return typeResolver.heuristicType( name );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Type entity(Class entityClass) {
+ return entity( entityClass.getName() );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Type entity(String entityName) {
+ return typeResolver.getTypeFactory().manyToOne( entityName );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings({ "unchecked" })
+ public Type custom(Class userTypeClass) {
+ return custom( userTypeClass, null );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings({ "unchecked" })
+ public Type custom(Class userTypeClass, Properties parameters) {
+ if ( CompositeUserType.class.isAssignableFrom( userTypeClass ) ) {
+ return typeResolver.getTypeFactory().customComponent( userTypeClass, parameters );
+ }
+ else {
+ return typeResolver.getTypeFactory().custom( userTypeClass, parameters );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Type any(Type metaType, Type identifierType) {
+ return typeResolver.getTypeFactory().any( metaType, identifierType );
+ }
+}
diff --git a/core/src/main/java/org/hibernate/loader/criteria/CriteriaJoinWalker.java b/core/src/main/java/org/hibernate/loader/criteria/CriteriaJoinWalker.java
index 2316243106..aee55d180a 100755
--- a/core/src/main/java/org/hibernate/loader/criteria/CriteriaJoinWalker.java
+++ b/core/src/main/java/org/hibernate/loader/criteria/CriteriaJoinWalker.java
@@ -109,7 +109,7 @@ public class CriteriaJoinWalker extends AbstractEntityJoinWalker {
);
}
else {
- resultTypes = new Type[] { TypeFactory.manyToOne( persister.getEntityName() ) };
+ resultTypes = new Type[] { factory.getTypeResolver().getTypeFactory().manyToOne( persister.getEntityName() ) };
initAll( translator.getWhereCondition(), translator.getOrderBy(), LockOptions.NONE );
}
diff --git a/core/src/main/java/org/hibernate/mapping/AbstractAuxiliaryDatabaseObject.java b/core/src/main/java/org/hibernate/mapping/AbstractAuxiliaryDatabaseObject.java
index 4c0e8af3a0..fc936be5e4 100644
--- a/core/src/main/java/org/hibernate/mapping/AbstractAuxiliaryDatabaseObject.java
+++ b/core/src/main/java/org/hibernate/mapping/AbstractAuxiliaryDatabaseObject.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Any.java b/core/src/main/java/org/hibernate/mapping/Any.java
index b6e0f2888b..8b0c8ea106 100644
--- a/core/src/main/java/org/hibernate/mapping/Any.java
+++ b/core/src/main/java/org/hibernate/mapping/Any.java
@@ -55,7 +55,8 @@ public class Any extends SimpleValue {
public Type getType() throws MappingException {
final Type metaType = getMappings().getTypeResolver().heuristicType( metaTypeName );
- return new AnyType(
+
+ return getMappings().getTypeResolver().getTypeFactory().any(
metaValues == null ? metaType : new MetaType( metaValues, metaType ),
getMappings().getTypeResolver().heuristicType( identifierTypeName )
);
diff --git a/core/src/main/java/org/hibernate/mapping/Array.java b/core/src/main/java/org/hibernate/mapping/Array.java
index 7be9a545d9..0cfc419119 100644
--- a/core/src/main/java/org/hibernate/mapping/Array.java
+++ b/core/src/main/java/org/hibernate/mapping/Array.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,31 +20,27 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.type.CollectionType;
import org.hibernate.type.PrimitiveType;
import org.hibernate.type.TypeFactory;
import org.hibernate.util.ReflectHelper;
/**
- * An array mapping has a primary key consisting of
- * the key columns + index column.
+ * An array mapping has a primary key consisting of the key columns + index column.
+ *
* @author Gavin King
*/
public class Array extends List {
private String elementClassName;
- /**
- * Constructor for Array.
- * @param owner
- */
- public Array(PersistentClass owner) {
- super(owner);
+ public Array(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public Class getElementClass() throws MappingException {
@@ -65,7 +61,9 @@ public class Array extends List {
}
public CollectionType getDefaultCollectionType() throws MappingException {
- return TypeFactory.array( getRole(), getReferencedPropertyName(), isEmbedded(), getElementClass() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .array( getRole(), getReferencedPropertyName(), isEmbedded(), getElementClass() );
}
public boolean isArray() {
diff --git a/core/src/main/java/org/hibernate/mapping/AuxiliaryDatabaseObject.java b/core/src/main/java/org/hibernate/mapping/AuxiliaryDatabaseObject.java
index eaabc8e7aa..2f91afcf17 100644
--- a/core/src/main/java/org/hibernate/mapping/AuxiliaryDatabaseObject.java
+++ b/core/src/main/java/org/hibernate/mapping/AuxiliaryDatabaseObject.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Bag.java b/core/src/main/java/org/hibernate/mapping/Bag.java
index d67d6312d0..51558e00dd 100644
--- a/core/src/main/java/org/hibernate/mapping/Bag.java
+++ b/core/src/main/java/org/hibernate/mapping/Bag.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,12 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
+import org.hibernate.cfg.Mappings;
import org.hibernate.type.CollectionType;
-import org.hibernate.type.TypeFactory;
/**
* A bag permits duplicates, so it has no primary key
@@ -34,12 +33,14 @@ import org.hibernate.type.TypeFactory;
*/
public class Bag extends Collection {
- public Bag(PersistentClass owner) {
- super(owner);
+ public Bag(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public CollectionType getDefaultCollectionType() {
- return TypeFactory.bag( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .bag( getRole(), getReferencedPropertyName(), isEmbedded() );
}
void createPrimaryKey() {
diff --git a/core/src/main/java/org/hibernate/mapping/Collection.java b/core/src/main/java/org/hibernate/mapping/Collection.java
index 7cb9cb939d..eab7e52989 100644
--- a/core/src/main/java/org/hibernate/mapping/Collection.java
+++ b/core/src/main/java/org/hibernate/mapping/Collection.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
@@ -32,6 +31,7 @@ import java.util.Properties;
import org.hibernate.FetchMode;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.engine.Mapping;
import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
import org.hibernate.type.CollectionType;
@@ -51,6 +51,9 @@ public abstract class Collection implements Fetchable, Value, Filterable {
public static final String DEFAULT_ELEMENT_COLUMN_NAME = "elt";
public static final String DEFAULT_KEY_COLUMN_NAME = "id";
+ private final Mappings mappings;
+ private PersistentClass owner;
+
private KeyValue key;
private Value element;
private Table collectionTable;
@@ -66,7 +69,6 @@ public abstract class Collection implements Fetchable, Value, Filterable {
private String where;
private String manyToManyWhere;
private String manyToManyOrderBy;
- private PersistentClass owner;
private String referencedPropertyName;
private String nodeName;
private String elementNodeName;
@@ -100,10 +102,15 @@ public abstract class Collection implements Fetchable, Value, Filterable {
private String loaderName;
- protected Collection(PersistentClass owner) {
+ protected Collection(Mappings mappings, PersistentClass owner) {
+ this.mappings = mappings;
this.owner = owner;
}
+ public Mappings getMappings() {
+ return mappings;
+ }
+
public boolean isSet() {
return false;
}
@@ -221,6 +228,11 @@ public abstract class Collection implements Fetchable, Value, Filterable {
return owner;
}
+ /**
+ * @deprecated Inject the owner into constructor.
+ *
+ * @param owner The owner
+ */
public void setOwner(PersistentClass owner) {
this.owner = owner;
}
diff --git a/core/src/main/java/org/hibernate/mapping/Column.java b/core/src/main/java/org/hibernate/mapping/Column.java
index ff98f8147b..e3170a1907 100644
--- a/core/src/main/java/org/hibernate/mapping/Column.java
+++ b/core/src/main/java/org/hibernate/mapping/Column.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Component.java b/core/src/main/java/org/hibernate/mapping/Component.java
index 47bd5769e3..25ab57a6e0 100644
--- a/core/src/main/java/org/hibernate/mapping/Component.java
+++ b/core/src/main/java/org/hibernate/mapping/Component.java
@@ -183,10 +183,10 @@ public class Component extends SimpleValue implements MetaAttributable {
// TODO : temporary initial step towards HHH-1907
ComponentMetamodel metamodel = new ComponentMetamodel( this );
if ( isEmbedded() ) {
- return new EmbeddedComponentType( metamodel );
+ return getMappings().getTypeResolver().getTypeFactory().embeddedComponent( metamodel );
}
else {
- return new ComponentType( metamodel );
+ return getMappings().getTypeResolver().getTypeFactory().component( metamodel );
}
}
diff --git a/core/src/main/java/org/hibernate/mapping/Constraint.java b/core/src/main/java/org/hibernate/mapping/Constraint.java
index d94070af7c..da484a9ac0 100644
--- a/core/src/main/java/org/hibernate/mapping/Constraint.java
+++ b/core/src/main/java/org/hibernate/mapping/Constraint.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/DenormalizedTable.java b/core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
index 6b26c31cf0..b2f1cd2aaa 100644
--- a/core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
+++ b/core/src/main/java/org/hibernate/mapping/DenormalizedTable.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/DependantValue.java b/core/src/main/java/org/hibernate/mapping/DependantValue.java
index 567396981d..c8acaf0e57 100644
--- a/core/src/main/java/org/hibernate/mapping/DependantValue.java
+++ b/core/src/main/java/org/hibernate/mapping/DependantValue.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/FetchProfile.java b/core/src/main/java/org/hibernate/mapping/FetchProfile.java
index 3d84998f64..8148be067e 100644
--- a/core/src/main/java/org/hibernate/mapping/FetchProfile.java
+++ b/core/src/main/java/org/hibernate/mapping/FetchProfile.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Fetchable.java b/core/src/main/java/org/hibernate/mapping/Fetchable.java
index 31e5a01076..2a1bb03915 100644
--- a/core/src/main/java/org/hibernate/mapping/Fetchable.java
+++ b/core/src/main/java/org/hibernate/mapping/Fetchable.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Filterable.java b/core/src/main/java/org/hibernate/mapping/Filterable.java
index 346996d008..39585bc96b 100644
--- a/core/src/main/java/org/hibernate/mapping/Filterable.java
+++ b/core/src/main/java/org/hibernate/mapping/Filterable.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/ForeignKey.java b/core/src/main/java/org/hibernate/mapping/ForeignKey.java
index f136229625..9993b9dd5f 100644
--- a/core/src/main/java/org/hibernate/mapping/ForeignKey.java
+++ b/core/src/main/java/org/hibernate/mapping/ForeignKey.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Formula.java b/core/src/main/java/org/hibernate/mapping/Formula.java
index f8f2d17e27..808eaad224 100644
--- a/core/src/main/java/org/hibernate/mapping/Formula.java
+++ b/core/src/main/java/org/hibernate/mapping/Formula.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/IdentifierBag.java b/core/src/main/java/org/hibernate/mapping/IdentifierBag.java
index 8afb0eac4c..07324c3507 100644
--- a/core/src/main/java/org/hibernate/mapping/IdentifierBag.java
+++ b/core/src/main/java/org/hibernate/mapping/IdentifierBag.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,10 +20,10 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
+import org.hibernate.cfg.Mappings;
import org.hibernate.type.CollectionType;
import org.hibernate.type.TypeFactory;
@@ -33,12 +33,14 @@ import org.hibernate.type.TypeFactory;
*/
public class IdentifierBag extends IdentifierCollection {
- public IdentifierBag(PersistentClass owner) {
- super(owner);
+ public IdentifierBag(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public CollectionType getDefaultCollectionType() {
- return TypeFactory.idbag( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .idbag( getRole(), getReferencedPropertyName(), isEmbedded() );
}
public Object accept(ValueVisitor visitor) {
diff --git a/core/src/main/java/org/hibernate/mapping/IdentifierCollection.java b/core/src/main/java/org/hibernate/mapping/IdentifierCollection.java
index 8f8f051d7b..54249723ae 100644
--- a/core/src/main/java/org/hibernate/mapping/IdentifierCollection.java
+++ b/core/src/main/java/org/hibernate/mapping/IdentifierCollection.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,11 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.engine.Mapping;
/**
@@ -36,8 +36,8 @@ public abstract class IdentifierCollection extends Collection {
private KeyValue identifier;
- public IdentifierCollection(PersistentClass owner) {
- super(owner);
+ public IdentifierCollection(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public KeyValue getIdentifier() {
diff --git a/core/src/main/java/org/hibernate/mapping/Index.java b/core/src/main/java/org/hibernate/mapping/Index.java
index c070e2ff26..d3037df798 100644
--- a/core/src/main/java/org/hibernate/mapping/Index.java
+++ b/core/src/main/java/org/hibernate/mapping/Index.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/IndexedCollection.java b/core/src/main/java/org/hibernate/mapping/IndexedCollection.java
index 4d7c7b4d7a..2ebd79f31f 100644
--- a/core/src/main/java/org/hibernate/mapping/IndexedCollection.java
+++ b/core/src/main/java/org/hibernate/mapping/IndexedCollection.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,13 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
import java.util.Iterator;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.engine.Mapping;
/**
@@ -41,8 +41,8 @@ public abstract class IndexedCollection extends Collection {
private Value index;
private String indexNodeName;
- public IndexedCollection(PersistentClass owner) {
- super(owner);
+ public IndexedCollection(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public Value getIndex() {
diff --git a/core/src/main/java/org/hibernate/mapping/Join.java b/core/src/main/java/org/hibernate/mapping/Join.java
index 365ffd6891..ee7b607797 100644
--- a/core/src/main/java/org/hibernate/mapping/Join.java
+++ b/core/src/main/java/org/hibernate/mapping/Join.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/JoinedSubclass.java b/core/src/main/java/org/hibernate/mapping/JoinedSubclass.java
index b3bc1d71ec..e16be6b51f 100644
--- a/core/src/main/java/org/hibernate/mapping/JoinedSubclass.java
+++ b/core/src/main/java/org/hibernate/mapping/JoinedSubclass.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/KeyValue.java b/core/src/main/java/org/hibernate/mapping/KeyValue.java
index 0413402f3c..d6fb83da35 100755
--- a/core/src/main/java/org/hibernate/mapping/KeyValue.java
+++ b/core/src/main/java/org/hibernate/mapping/KeyValue.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/List.java b/core/src/main/java/org/hibernate/mapping/List.java
index 36959a2f34..5e31e3c25c 100644
--- a/core/src/main/java/org/hibernate/mapping/List.java
+++ b/core/src/main/java/org/hibernate/mapping/List.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,17 +20,17 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.type.CollectionType;
import org.hibernate.type.TypeFactory;
/**
- * A list mapping has a primary key consisting of
- * the key columns + index column.
+ * A list mapping has a primary key consisting of the key columns + index column.
+ *
* @author Gavin King
*/
public class List extends IndexedCollection {
@@ -41,12 +41,14 @@ public class List extends IndexedCollection {
return true;
}
- public List(PersistentClass owner) {
- super(owner);
+ public List(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public CollectionType getDefaultCollectionType() throws MappingException {
- return TypeFactory.list( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .list( getRole(), getReferencedPropertyName(), isEmbedded() );
}
public Object accept(ValueVisitor visitor) {
diff --git a/core/src/main/java/org/hibernate/mapping/ManyToOne.java b/core/src/main/java/org/hibernate/mapping/ManyToOne.java
index 197c9b3f21..f2597f6931 100644
--- a/core/src/main/java/org/hibernate/mapping/ManyToOne.java
+++ b/core/src/main/java/org/hibernate/mapping/ManyToOne.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
@@ -47,7 +46,7 @@ public class ManyToOne extends ToOne {
}
public Type getType() throws MappingException {
- return TypeFactory.manyToOne(
+ return getMappings().getTypeResolver().getTypeFactory().manyToOne(
getReferencedEntityName(),
getReferencedPropertyName(),
isLazy(),
diff --git a/core/src/main/java/org/hibernate/mapping/Map.java b/core/src/main/java/org/hibernate/mapping/Map.java
index b0ad3247c9..50fc8f420e 100644
--- a/core/src/main/java/org/hibernate/mapping/Map.java
+++ b/core/src/main/java/org/hibernate/mapping/Map.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,11 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.type.CollectionType;
import org.hibernate.type.TypeFactory;
@@ -34,8 +34,8 @@ import org.hibernate.type.TypeFactory;
*/
public class Map extends IndexedCollection {
- public Map(PersistentClass owner) {
- super(owner);
+ public Map(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public boolean isMap() {
@@ -44,13 +44,19 @@ public class Map extends IndexedCollection {
public CollectionType getDefaultCollectionType() {
if ( isSorted() ) {
- return TypeFactory.sortedMap( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .sortedMap( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() );
}
else if ( hasOrder() ) {
- return TypeFactory.orderedMap( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .orderedMap( getRole(), getReferencedPropertyName(), isEmbedded() );
}
else {
- return TypeFactory.map( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .map( getRole(), getReferencedPropertyName(), isEmbedded() );
}
}
diff --git a/core/src/main/java/org/hibernate/mapping/MappedSuperclass.java b/core/src/main/java/org/hibernate/mapping/MappedSuperclass.java
index 32e5dad0af..426ca29e8f 100644
--- a/core/src/main/java/org/hibernate/mapping/MappedSuperclass.java
+++ b/core/src/main/java/org/hibernate/mapping/MappedSuperclass.java
@@ -1,3 +1,26 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
package org.hibernate.mapping;
import java.util.*;
diff --git a/core/src/main/java/org/hibernate/mapping/MetaAttributable.java b/core/src/main/java/org/hibernate/mapping/MetaAttributable.java
index 4e56939018..70234f864c 100644
--- a/core/src/main/java/org/hibernate/mapping/MetaAttributable.java
+++ b/core/src/main/java/org/hibernate/mapping/MetaAttributable.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/MetaAttribute.java b/core/src/main/java/org/hibernate/mapping/MetaAttribute.java
index ea91da2a06..00a602d1ae 100644
--- a/core/src/main/java/org/hibernate/mapping/MetaAttribute.java
+++ b/core/src/main/java/org/hibernate/mapping/MetaAttribute.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/OneToMany.java b/core/src/main/java/org/hibernate/mapping/OneToMany.java
index 656b4f82c2..074bf2ba7d 100644
--- a/core/src/main/java/org/hibernate/mapping/OneToMany.java
+++ b/core/src/main/java/org/hibernate/mapping/OneToMany.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
@@ -28,6 +27,7 @@ import java.util.Iterator;
import org.hibernate.FetchMode;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.engine.Mapping;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
@@ -39,24 +39,28 @@ import org.hibernate.type.TypeFactory;
*/
public class OneToMany implements Value {
+ private final Mappings mappings;
+ private final Table referencingTable;
+
private String referencedEntityName;
- private Table referencingTable;
private PersistentClass associatedClass;
private boolean embedded;
private boolean ignoreNotFound;
private EntityType getEntityType() {
- return TypeFactory.manyToOne(
+ return mappings.getTypeResolver().getTypeFactory().manyToOne(
getReferencedEntityName(),
null,
false,
false,
isEmbedded(),
- isIgnoreNotFound()
+ isIgnoreNotFound(),
+ false
);
}
- public OneToMany(PersistentClass owner) throws MappingException {
+ public OneToMany(Mappings mappings, PersistentClass owner) throws MappingException {
+ this.mappings = mappings;
this.referencingTable = (owner==null) ? null : owner.getTable();
}
diff --git a/core/src/main/java/org/hibernate/mapping/OneToOne.java b/core/src/main/java/org/hibernate/mapping/OneToOne.java
index 300b43a328..8567a3c057 100644
--- a/core/src/main/java/org/hibernate/mapping/OneToOne.java
+++ b/core/src/main/java/org/hibernate/mapping/OneToOne.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
@@ -71,7 +70,7 @@ public class OneToOne extends ToOne {
public Type getType() throws MappingException {
if ( getColumnIterator().hasNext() ) {
- return new SpecialOneToOneType(
+ return getMappings().getTypeResolver().getTypeFactory().specialOneToOne(
getReferencedEntityName(),
foreignKeyType,
referencedPropertyName,
@@ -79,10 +78,10 @@ public class OneToOne extends ToOne {
isUnwrapProxy(),
entityName,
propertyName
- );
+ );
}
else {
- return TypeFactory.oneToOne(
+ return getMappings().getTypeResolver().getTypeFactory().oneToOne(
getReferencedEntityName(),
foreignKeyType,
referencedPropertyName,
@@ -91,7 +90,7 @@ public class OneToOne extends ToOne {
isEmbedded(),
entityName,
propertyName
- );
+ );
}
}
diff --git a/core/src/main/java/org/hibernate/mapping/PersistentClass.java b/core/src/main/java/org/hibernate/mapping/PersistentClass.java
index a1cedb994a..d27d30f7e7 100644
--- a/core/src/main/java/org/hibernate/mapping/PersistentClass.java
+++ b/core/src/main/java/org/hibernate/mapping/PersistentClass.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/PersistentClassVisitor.java b/core/src/main/java/org/hibernate/mapping/PersistentClassVisitor.java
index dab6ec4bb6..22e67beb74 100644
--- a/core/src/main/java/org/hibernate/mapping/PersistentClassVisitor.java
+++ b/core/src/main/java/org/hibernate/mapping/PersistentClassVisitor.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/PrimaryKey.java b/core/src/main/java/org/hibernate/mapping/PrimaryKey.java
index 5a1cd278d4..b8ff4d1e71 100644
--- a/core/src/main/java/org/hibernate/mapping/PrimaryKey.java
+++ b/core/src/main/java/org/hibernate/mapping/PrimaryKey.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/PrimitiveArray.java b/core/src/main/java/org/hibernate/mapping/PrimitiveArray.java
index 46ba5bb637..7b824d7395 100644
--- a/core/src/main/java/org/hibernate/mapping/PrimitiveArray.java
+++ b/core/src/main/java/org/hibernate/mapping/PrimitiveArray.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,18 +20,18 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
+import org.hibernate.cfg.Mappings;
+
/**
- * A primitive array has a primary key consisting
- * of the key columns + index column.
+ * A primitive array has a primary key consisting of the key columns + index column.
*/
public class PrimitiveArray extends Array {
- public PrimitiveArray(PersistentClass owner) {
- super(owner);
+ public PrimitiveArray(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public boolean isPrimitiveArray() {
@@ -42,10 +42,3 @@ public class PrimitiveArray extends Array {
return visitor.accept(this);
}
}
-
-
-
-
-
-
-
diff --git a/core/src/main/java/org/hibernate/mapping/PropertyGeneration.java b/core/src/main/java/org/hibernate/mapping/PropertyGeneration.java
index 355b3a944a..2fc3e65c61 100644
--- a/core/src/main/java/org/hibernate/mapping/PropertyGeneration.java
+++ b/core/src/main/java/org/hibernate/mapping/PropertyGeneration.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/RelationalModel.java b/core/src/main/java/org/hibernate/mapping/RelationalModel.java
index 3980075089..58f9c77733 100644
--- a/core/src/main/java/org/hibernate/mapping/RelationalModel.java
+++ b/core/src/main/java/org/hibernate/mapping/RelationalModel.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/RootClass.java b/core/src/main/java/org/hibernate/mapping/RootClass.java
index 718e54138c..70ab74165a 100644
--- a/core/src/main/java/org/hibernate/mapping/RootClass.java
+++ b/core/src/main/java/org/hibernate/mapping/RootClass.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Selectable.java b/core/src/main/java/org/hibernate/mapping/Selectable.java
index b8c31826a6..f62ddcd866 100755
--- a/core/src/main/java/org/hibernate/mapping/Selectable.java
+++ b/core/src/main/java/org/hibernate/mapping/Selectable.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Set.java b/core/src/main/java/org/hibernate/mapping/Set.java
index f020241ecc..e1d1afc999 100644
--- a/core/src/main/java/org/hibernate/mapping/Set.java
+++ b/core/src/main/java/org/hibernate/mapping/Set.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,13 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
import java.util.Iterator;
import org.hibernate.MappingException;
+import org.hibernate.cfg.Mappings;
import org.hibernate.engine.Mapping;
import org.hibernate.type.CollectionType;
import org.hibernate.type.TypeFactory;
@@ -51,12 +51,8 @@ public class Set extends Collection {
throw new MappingException("set element mappings must have at least one non-nullable column: " + getRole() );*/
}
- /**
- * Constructor for Set.
- * @param owner
- */
- public Set(PersistentClass owner) {
- super(owner);
+ public Set(Mappings mappings, PersistentClass owner) {
+ super( mappings, owner );
}
public boolean isSet() {
@@ -65,13 +61,19 @@ public class Set extends Collection {
public CollectionType getDefaultCollectionType() {
if ( isSorted() ) {
- return TypeFactory.sortedSet( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .sortedSet( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() );
}
else if ( hasOrder() ) {
- return TypeFactory.orderedSet( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .orderedSet( getRole(), getReferencedPropertyName(), isEmbedded() );
}
else {
- return TypeFactory.set( getRole(), getReferencedPropertyName(), isEmbedded() );
+ return getMappings().getTypeResolver()
+ .getTypeFactory()
+ .set( getRole(), getReferencedPropertyName(), isEmbedded() );
}
}
diff --git a/core/src/main/java/org/hibernate/mapping/SimpleAuxiliaryDatabaseObject.java b/core/src/main/java/org/hibernate/mapping/SimpleAuxiliaryDatabaseObject.java
index 93a2bd49a2..3f61bb40d7 100644
--- a/core/src/main/java/org/hibernate/mapping/SimpleAuxiliaryDatabaseObject.java
+++ b/core/src/main/java/org/hibernate/mapping/SimpleAuxiliaryDatabaseObject.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/SingleTableSubclass.java b/core/src/main/java/org/hibernate/mapping/SingleTableSubclass.java
index 801fdf649c..cb83388b7c 100755
--- a/core/src/main/java/org/hibernate/mapping/SingleTableSubclass.java
+++ b/core/src/main/java/org/hibernate/mapping/SingleTableSubclass.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Subclass.java b/core/src/main/java/org/hibernate/mapping/Subclass.java
index b7ecbaf1e6..40f7b42658 100644
--- a/core/src/main/java/org/hibernate/mapping/Subclass.java
+++ b/core/src/main/java/org/hibernate/mapping/Subclass.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Table.java b/core/src/main/java/org/hibernate/mapping/Table.java
index 8f5f2adb70..9ca5df65cb 100644
--- a/core/src/main/java/org/hibernate/mapping/Table.java
+++ b/core/src/main/java/org/hibernate/mapping/Table.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/TableOwner.java b/core/src/main/java/org/hibernate/mapping/TableOwner.java
index 93c0189c24..53d952fe5f 100644
--- a/core/src/main/java/org/hibernate/mapping/TableOwner.java
+++ b/core/src/main/java/org/hibernate/mapping/TableOwner.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/ToOne.java b/core/src/main/java/org/hibernate/mapping/ToOne.java
index ef087d8428..bd3cfb34fe 100644
--- a/core/src/main/java/org/hibernate/mapping/ToOne.java
+++ b/core/src/main/java/org/hibernate/mapping/ToOne.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/TypeDef.java b/core/src/main/java/org/hibernate/mapping/TypeDef.java
index a985d4b217..eb8ff7083a 100644
--- a/core/src/main/java/org/hibernate/mapping/TypeDef.java
+++ b/core/src/main/java/org/hibernate/mapping/TypeDef.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/UnionSubclass.java b/core/src/main/java/org/hibernate/mapping/UnionSubclass.java
index 90860db2dc..c927d1136f 100644
--- a/core/src/main/java/org/hibernate/mapping/UnionSubclass.java
+++ b/core/src/main/java/org/hibernate/mapping/UnionSubclass.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/UniqueKey.java b/core/src/main/java/org/hibernate/mapping/UniqueKey.java
index 22dc539e02..f42a0b1531 100644
--- a/core/src/main/java/org/hibernate/mapping/UniqueKey.java
+++ b/core/src/main/java/org/hibernate/mapping/UniqueKey.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/Value.java b/core/src/main/java/org/hibernate/mapping/Value.java
index 1d74723e86..41884f5324 100644
--- a/core/src/main/java/org/hibernate/mapping/Value.java
+++ b/core/src/main/java/org/hibernate/mapping/Value.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/ValueVisitor.java b/core/src/main/java/org/hibernate/mapping/ValueVisitor.java
index 45da0a39ab..0457ee4728 100644
--- a/core/src/main/java/org/hibernate/mapping/ValueVisitor.java
+++ b/core/src/main/java/org/hibernate/mapping/ValueVisitor.java
@@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.mapping;
diff --git a/core/src/main/java/org/hibernate/mapping/package.html b/core/src/main/java/org/hibernate/mapping/package.html
index 7757cc009f..ada70781a1 100755
--- a/core/src/main/java/org/hibernate/mapping/package.html
+++ b/core/src/main/java/org/hibernate/mapping/package.html
@@ -1,10 +1,10 @@
diff --git a/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
index 429b27cd75..65e6c3faca 100644
--- a/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
+++ b/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
@@ -107,7 +107,7 @@ import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.AssociationType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
+import org.hibernate.type.TypeHelper;
import org.hibernate.type.VersionType;
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.FilterHelper;
@@ -3377,7 +3377,7 @@ public abstract class AbstractEntityPersister
*/
public int[] findDirty(Object[] currentState, Object[] previousState, Object entity, SessionImplementor session)
throws HibernateException {
- int[] props = TypeFactory.findDirty(
+ int[] props = TypeHelper.findDirty(
entityMetamodel.getProperties(),
currentState,
previousState,
@@ -3406,7 +3406,7 @@ public abstract class AbstractEntityPersister
*/
public int[] findModified(Object[] old, Object[] current, Object entity, SessionImplementor session)
throws HibernateException {
- int[] props = TypeFactory.findModified(
+ int[] props = TypeHelper.findModified(
entityMetamodel.getProperties(),
current,
old,
diff --git a/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java b/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
index 2bda01cf07..1c6e4b291b 100644
--- a/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
+++ b/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
@@ -131,7 +131,7 @@ public class EntityMetamodel implements Serializable {
name = persistentClass.getEntityName();
rootName = persistentClass.getRootClass().getEntityName();
- entityType = TypeFactory.manyToOne( name );
+ entityType = sessionFactory.getTypeResolver().getTypeFactory().manyToOne( name );
identifierProperty = PropertyFactory.buildIdentifierProperty(
persistentClass,
diff --git a/core/src/main/java/org/hibernate/type/ArrayType.java b/core/src/main/java/org/hibernate/type/ArrayType.java
index 3cb8ae6f18..aedb3b1e27 100644
--- a/core/src/main/java/org/hibernate/type/ArrayType.java
+++ b/core/src/main/java/org/hibernate/type/ArrayType.java
@@ -48,8 +48,8 @@ public class ArrayType extends CollectionType {
private final Class elementClass;
private final Class arrayClass;
- public ArrayType(String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public ArrayType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
this.elementClass = elementClass;
arrayClass = Array.newInstance(elementClass, 0).getClass();
}
diff --git a/core/src/main/java/org/hibernate/type/BagType.java b/core/src/main/java/org/hibernate/type/BagType.java
index 5b0e558eb7..f50208aecc 100644
--- a/core/src/main/java/org/hibernate/type/BagType.java
+++ b/core/src/main/java/org/hibernate/type/BagType.java
@@ -38,8 +38,8 @@ import org.hibernate.persister.collection.CollectionPersister;
public class BagType extends CollectionType {
- public BagType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public BagType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
diff --git a/core/src/main/java/org/hibernate/type/CollectionType.java b/core/src/main/java/org/hibernate/type/CollectionType.java
index b4500a1138..a0ec274a1a 100644
--- a/core/src/main/java/org/hibernate/type/CollectionType.java
+++ b/core/src/main/java/org/hibernate/type/CollectionType.java
@@ -66,11 +66,13 @@ public abstract class CollectionType extends AbstractType implements Association
private static final Object NOT_NULL_COLLECTION = new MarkerObject( "NOT NULL COLLECTION" );
public static final Object UNFETCHED_COLLECTION = new MarkerObject( "UNFETCHED COLLECTION" );
+ private final TypeFactory.TypeScope typeScope;
private final String role;
private final String foreignKeyPropertyName;
private final boolean isEmbeddedInXML;
- public CollectionType(String role, String foreignKeyPropertyName, boolean isEmbeddedInXML) {
+ public CollectionType(TypeFactory.TypeScope typeScope, String role, String foreignKeyPropertyName, boolean isEmbeddedInXML) {
+ this.typeScope = typeScope;
this.role = role;
this.foreignKeyPropertyName = foreignKeyPropertyName;
this.isEmbeddedInXML = isEmbeddedInXML;
diff --git a/core/src/main/java/org/hibernate/type/ComponentType.java b/core/src/main/java/org/hibernate/type/ComponentType.java
index e42a316add..2d8bfe435b 100644
--- a/core/src/main/java/org/hibernate/type/ComponentType.java
+++ b/core/src/main/java/org/hibernate/type/ComponentType.java
@@ -56,6 +56,7 @@ import org.hibernate.util.StringHelper;
*/
public class ComponentType extends AbstractType implements AbstractComponentType {
+ private final TypeFactory.TypeScope typeScope;
private final String[] propertyNames;
private final Type[] propertyTypes;
private final boolean[] propertyNullability;
@@ -66,7 +67,8 @@ public class ComponentType extends AbstractType implements AbstractComponentType
protected final EntityModeToTuplizerMapping tuplizerMapping;
- public ComponentType(ComponentMetamodel metamodel) {
+ public ComponentType(TypeFactory.TypeScope typeScope, ComponentMetamodel metamodel) {
+ this.typeScope = typeScope;
// for now, just "re-flatten" the metamodel since this is temporary stuff anyway (HHH-1907)
this.isKey = metamodel.isKey();
this.propertySpan = metamodel.getPropertySpan();
@@ -456,7 +458,7 @@ public class ComponentType extends AbstractType implements AbstractComponentType
: target;
final EntityMode entityMode = session.getEntityMode();
- Object[] values = TypeFactory.replace(
+ Object[] values = TypeHelper.replace(
getPropertyValues( original, entityMode ),
getPropertyValues( result, entityMode ),
propertyTypes,
@@ -488,7 +490,7 @@ public class ComponentType extends AbstractType implements AbstractComponentType
target;
final EntityMode entityMode = session.getEntityMode();
- Object[] values = TypeFactory.replace(
+ Object[] values = TypeHelper.replace(
getPropertyValues( original, entityMode ),
getPropertyValues( result, entityMode ),
propertyTypes,
diff --git a/core/src/main/java/org/hibernate/type/CustomCollectionType.java b/core/src/main/java/org/hibernate/type/CustomCollectionType.java
index 3759d85de6..f6072c5e99 100755
--- a/core/src/main/java/org/hibernate/type/CustomCollectionType.java
+++ b/core/src/main/java/org/hibernate/type/CustomCollectionType.java
@@ -48,8 +48,13 @@ public class CustomCollectionType extends CollectionType {
private final UserCollectionType userType;
private final boolean customLogging;
- public CustomCollectionType(Class userTypeClass, String role, String foreignKeyPropertyName, boolean isEmbeddedInXML) {
- super(role, foreignKeyPropertyName, isEmbeddedInXML);
+ public CustomCollectionType(
+ TypeFactory.TypeScope typeScope,
+ Class userTypeClass,
+ String role,
+ String foreignKeyPropertyName,
+ boolean isEmbeddedInXML) {
+ super( typeScope, role, foreignKeyPropertyName, isEmbeddedInXML );
if ( !UserCollectionType.class.isAssignableFrom( userTypeClass ) ) {
throw new MappingException( "Custom type does not implement UserCollectionType: " + userTypeClass.getName() );
diff --git a/core/src/main/java/org/hibernate/type/EmbeddedComponentType.java b/core/src/main/java/org/hibernate/type/EmbeddedComponentType.java
index b620823141..792b87db4b 100755
--- a/core/src/main/java/org/hibernate/type/EmbeddedComponentType.java
+++ b/core/src/main/java/org/hibernate/type/EmbeddedComponentType.java
@@ -40,8 +40,8 @@ public class EmbeddedComponentType extends ComponentType {
return true;
}
- public EmbeddedComponentType(ComponentMetamodel metamodel) {
- super( metamodel );
+ public EmbeddedComponentType(TypeFactory.TypeScope typeScope, ComponentMetamodel metamodel) {
+ super( typeScope, metamodel );
}
public boolean isMethodOf(Method method) {
diff --git a/core/src/main/java/org/hibernate/type/EntityType.java b/core/src/main/java/org/hibernate/type/EntityType.java
index c6887ba4af..8ea15ef318 100644
--- a/core/src/main/java/org/hibernate/type/EntityType.java
+++ b/core/src/main/java/org/hibernate/type/EntityType.java
@@ -55,6 +55,7 @@ import org.hibernate.util.ReflectHelper;
*/
public abstract class EntityType extends AbstractType implements AssociationType {
+ private final TypeFactory.TypeScope scope;
private final String associatedEntityName;
protected final String uniqueKeyPropertyName;
protected final boolean isEmbeddedInXML;
@@ -66,6 +67,7 @@ public abstract class EntityType extends AbstractType implements AssociationType
/**
* Constructs the requested entity type mapping.
*
+ * @param scope The type scope
* @param entityName The name of the associated entity.
* @param uniqueKeyPropertyName The property-ref name, or null if we
* reference the PK of the associated entity.
@@ -76,11 +78,13 @@ public abstract class EntityType extends AbstractType implements AssociationType
* with lazy="no-proxy".
*/
protected EntityType(
+ TypeFactory.TypeScope scope,
String entityName,
String uniqueKeyPropertyName,
boolean eager,
boolean isEmbeddedInXML,
boolean unwrapProxy) {
+ this.scope = scope;
this.associatedEntityName = entityName;
this.uniqueKeyPropertyName = uniqueKeyPropertyName;
this.isEmbeddedInXML = isEmbeddedInXML;
@@ -88,6 +92,10 @@ public abstract class EntityType extends AbstractType implements AssociationType
this.unwrapProxy = unwrapProxy;
}
+ protected TypeFactory.TypeScope scope() {
+ return scope;
+ }
+
/**
* An entity type is a type of association type
*
diff --git a/core/src/main/java/org/hibernate/type/IdentifierBagType.java b/core/src/main/java/org/hibernate/type/IdentifierBagType.java
index 820cc73ff3..896a4406bd 100644
--- a/core/src/main/java/org/hibernate/type/IdentifierBagType.java
+++ b/core/src/main/java/org/hibernate/type/IdentifierBagType.java
@@ -34,8 +34,8 @@ import org.hibernate.persister.collection.CollectionPersister;
public class IdentifierBagType extends CollectionType {
- public IdentifierBagType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public IdentifierBagType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
public PersistentCollection instantiate(
diff --git a/core/src/main/java/org/hibernate/type/ListType.java b/core/src/main/java/org/hibernate/type/ListType.java
index 8c55e929ea..6c0c28b5d8 100644
--- a/core/src/main/java/org/hibernate/type/ListType.java
+++ b/core/src/main/java/org/hibernate/type/ListType.java
@@ -37,8 +37,8 @@ import org.hibernate.persister.collection.CollectionPersister;
public class ListType extends CollectionType {
- public ListType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public ListType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
diff --git a/core/src/main/java/org/hibernate/type/ManyToOneType.java b/core/src/main/java/org/hibernate/type/ManyToOneType.java
index 2abb77f959..04c320277d 100644
--- a/core/src/main/java/org/hibernate/type/ManyToOneType.java
+++ b/core/src/main/java/org/hibernate/type/ManyToOneType.java
@@ -50,38 +50,27 @@ public class ManyToOneType extends EntityType {
/**
* Creates a many-to-one association type with the given referenced entity.
*
+ * @param scope The scope for this instance.
* @param referencedEntityName The name iof the referenced entity
*/
- public ManyToOneType(String referencedEntityName) {
- this( referencedEntityName, false );
+ public ManyToOneType(TypeFactory.TypeScope scope, String referencedEntityName) {
+ this( scope, referencedEntityName, false );
}
/**
* Creates a many-to-one association type with the given referenced entity and the
* given laziness characteristic
*
+ * @param scope The scope for this instance.
* @param referencedEntityName The name iof the referenced entity
* @param lazy Should the association be handled lazily
*/
- public ManyToOneType(String referencedEntityName, boolean lazy) {
- this( referencedEntityName, null, lazy, true, false, false );
- }
-
- /**
- * @deprecated use {@link #ManyToOneType(String, String, boolean, boolean, boolean, boolean, boolean)}
- * @noinspection JavaDoc
- */
- public ManyToOneType(
- String referencedEntityName,
- String uniqueKeyPropertyName,
- boolean lazy,
- boolean unwrapProxy,
- boolean isEmbeddedInXML,
- boolean ignoreNotFound) {
- this( referencedEntityName, uniqueKeyPropertyName, lazy, unwrapProxy, isEmbeddedInXML, ignoreNotFound, false );
+ public ManyToOneType(TypeFactory.TypeScope scope, String referencedEntityName, boolean lazy) {
+ this( scope, referencedEntityName, null, lazy, true, false, false, false );
}
public ManyToOneType(
+ TypeFactory.TypeScope scope,
String referencedEntityName,
String uniqueKeyPropertyName,
boolean lazy,
@@ -89,7 +78,7 @@ public class ManyToOneType extends EntityType {
boolean isEmbeddedInXML,
boolean ignoreNotFound,
boolean isLogicalOneToOne) {
- super( referencedEntityName, uniqueKeyPropertyName, !lazy, isEmbeddedInXML, unwrapProxy );
+ super( scope, referencedEntityName, uniqueKeyPropertyName, !lazy, isEmbeddedInXML, unwrapProxy );
this.ignoreNotFound = ignoreNotFound;
this.isLogicalOneToOne = isLogicalOneToOne;
}
@@ -162,17 +151,14 @@ public class ManyToOneType extends EntityType {
/**
* Register the entity as batch loadable, if enabled
*/
- private void scheduleBatchLoadIfNeeded(
- Serializable id,
- SessionImplementor session) throws MappingException {
+ @SuppressWarnings({ "JavaDoc" })
+ private void scheduleBatchLoadIfNeeded(Serializable id, SessionImplementor session) throws MappingException {
//cannot batch fetch by unique key (property-ref associations)
if ( uniqueKeyPropertyName == null && id != null ) {
EntityPersister persister = session.getFactory().getEntityPersister( getAssociatedEntityName() );
EntityKey entityKey = new EntityKey( id, persister, session.getEntityMode() );
if ( !session.getPersistenceContext().containsEntity( entityKey ) ) {
- session.getPersistenceContext()
- .getBatchFetchQueue()
- .addBatchLoadableEntityKey( entityKey );
+ session.getPersistenceContext().getBatchFetchQueue().addBatchLoadableEntityKey( entityKey );
}
}
}
diff --git a/core/src/main/java/org/hibernate/type/MapType.java b/core/src/main/java/org/hibernate/type/MapType.java
index 8311b606cd..287c12059b 100644
--- a/core/src/main/java/org/hibernate/type/MapType.java
+++ b/core/src/main/java/org/hibernate/type/MapType.java
@@ -40,8 +40,8 @@ import org.hibernate.persister.collection.CollectionPersister;
public class MapType extends CollectionType {
- public MapType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public MapType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
diff --git a/core/src/main/java/org/hibernate/type/OneToOneType.java b/core/src/main/java/org/hibernate/type/OneToOneType.java
index 6fa45ccf81..49e22f9f50 100644
--- a/core/src/main/java/org/hibernate/type/OneToOneType.java
+++ b/core/src/main/java/org/hibernate/type/OneToOneType.java
@@ -45,6 +45,22 @@ public class OneToOneType extends EntityType {
private final ForeignKeyDirection foreignKeyType;
private final String propertyName;
private final String entityName;
+
+ public OneToOneType(
+ TypeFactory.TypeScope scope,
+ String referencedEntityName,
+ ForeignKeyDirection foreignKeyType,
+ String uniqueKeyPropertyName,
+ boolean lazy,
+ boolean unwrapProxy,
+ boolean isEmbeddedInXML,
+ String entityName,
+ String propertyName) {
+ super( scope, referencedEntityName, uniqueKeyPropertyName, !lazy, isEmbeddedInXML, unwrapProxy );
+ this.foreignKeyType = foreignKeyType;
+ this.propertyName = propertyName;
+ this.entityName = entityName;
+ }
public String getPropertyName() {
return propertyName;
@@ -82,28 +98,6 @@ public class OneToOneType extends EntityType {
return ArrayHelper.EMPTY_BOOLEAN_ARRAY;
}
- public OneToOneType(
- String referencedEntityName,
- ForeignKeyDirection foreignKeyType,
- String uniqueKeyPropertyName,
- boolean lazy,
- boolean unwrapProxy,
- boolean isEmbeddedInXML,
- String entityName,
- String propertyName
- ) {
- super(
- referencedEntityName,
- uniqueKeyPropertyName,
- !lazy,
- isEmbeddedInXML,
- unwrapProxy
- );
- this.foreignKeyType = foreignKeyType;
- this.propertyName = propertyName;
- this.entityName = entityName;
- }
-
public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) {
//nothing to do
}
diff --git a/core/src/main/java/org/hibernate/type/OrderedMapType.java b/core/src/main/java/org/hibernate/type/OrderedMapType.java
index 0bb23dda7c..e5ea44377f 100755
--- a/core/src/main/java/org/hibernate/type/OrderedMapType.java
+++ b/core/src/main/java/org/hibernate/type/OrderedMapType.java
@@ -38,8 +38,8 @@ public class OrderedMapType extends MapType {
* @param propertyRef The property ref name.
* @param isEmbeddedInXML Is this collection to embed itself in xml
*/
- public OrderedMapType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super( role, propertyRef, isEmbeddedInXML );
+ public OrderedMapType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
/**
diff --git a/core/src/main/java/org/hibernate/type/OrderedSetType.java b/core/src/main/java/org/hibernate/type/OrderedSetType.java
index 4d3168fbd8..9f2736901c 100755
--- a/core/src/main/java/org/hibernate/type/OrderedSetType.java
+++ b/core/src/main/java/org/hibernate/type/OrderedSetType.java
@@ -34,12 +34,13 @@ public class OrderedSetType extends SetType {
* Constructs a set type capable of creating ordered sets of the given
* role.
*
+ * @param typeScope The scope for this type instance.
* @param role The collection role name.
* @param propertyRef The property ref name.
* @param isEmbeddedInXML Is this collection to embed itself in xml
*/
- public OrderedSetType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super( role, propertyRef, isEmbeddedInXML );
+ public OrderedSetType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
/**
diff --git a/core/src/main/java/org/hibernate/type/SetType.java b/core/src/main/java/org/hibernate/type/SetType.java
index 9988498c6c..b95fad7fd0 100644
--- a/core/src/main/java/org/hibernate/type/SetType.java
+++ b/core/src/main/java/org/hibernate/type/SetType.java
@@ -36,8 +36,8 @@ import org.hibernate.persister.collection.CollectionPersister;
public class SetType extends CollectionType {
- public SetType(String role, String propertyRef, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public SetType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
}
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
diff --git a/core/src/main/java/org/hibernate/type/SortedMapType.java b/core/src/main/java/org/hibernate/type/SortedMapType.java
index 37803e23ec..a18509d871 100644
--- a/core/src/main/java/org/hibernate/type/SortedMapType.java
+++ b/core/src/main/java/org/hibernate/type/SortedMapType.java
@@ -41,8 +41,8 @@ public class SortedMapType extends MapType {
private final Comparator comparator;
- public SortedMapType(String role, String propertyRef, Comparator comparator, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public SortedMapType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Comparator comparator, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
this.comparator = comparator;
}
diff --git a/core/src/main/java/org/hibernate/type/SortedSetType.java b/core/src/main/java/org/hibernate/type/SortedSetType.java
index bf47935c5a..53ee345c52 100644
--- a/core/src/main/java/org/hibernate/type/SortedSetType.java
+++ b/core/src/main/java/org/hibernate/type/SortedSetType.java
@@ -39,8 +39,8 @@ public class SortedSetType extends SetType {
private final Comparator comparator;
- public SortedSetType(String role, String propertyRef, Comparator comparator, boolean isEmbeddedInXML) {
- super(role, propertyRef, isEmbeddedInXML);
+ public SortedSetType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Comparator comparator, boolean isEmbeddedInXML) {
+ super( typeScope, role, propertyRef, isEmbeddedInXML );
this.comparator = comparator;
}
diff --git a/core/src/main/java/org/hibernate/type/SpecialOneToOneType.java b/core/src/main/java/org/hibernate/type/SpecialOneToOneType.java
index 9aa6b6b7da..70f4db4b59 100755
--- a/core/src/main/java/org/hibernate/type/SpecialOneToOneType.java
+++ b/core/src/main/java/org/hibernate/type/SpecialOneToOneType.java
@@ -43,15 +43,16 @@ import org.hibernate.engine.SessionImplementor;
public class SpecialOneToOneType extends OneToOneType {
public SpecialOneToOneType(
+ TypeFactory.TypeScope scope,
String referencedEntityName,
ForeignKeyDirection foreignKeyType,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
String entityName,
- String propertyName
- ) {
+ String propertyName) {
super(
+ scope,
referencedEntityName,
foreignKeyType,
uniqueKeyPropertyName,
diff --git a/core/src/main/java/org/hibernate/type/TypeFactory.java b/core/src/main/java/org/hibernate/type/TypeFactory.java
index 5492779ceb..600b24ae5b 100644
--- a/core/src/main/java/org/hibernate/type/TypeFactory.java
+++ b/core/src/main/java/org/hibernate/type/TypeFactory.java
@@ -25,7 +25,6 @@ package org.hibernate.type;
import java.io.Serializable;
import java.util.Comparator;
-import java.util.Map;
import java.util.Properties;
import org.slf4j.Logger;
@@ -34,15 +33,18 @@ import org.slf4j.LoggerFactory;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
import org.hibernate.classic.Lifecycle;
+import org.hibernate.classic.Validatable;
import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.engine.SessionImplementor;
-import org.hibernate.tuple.StandardProperty;
+import org.hibernate.tuple.component.ComponentMetamodel;
import org.hibernate.usertype.CompositeUserType;
import org.hibernate.usertype.ParameterizedType;
import org.hibernate.usertype.UserType;
import org.hibernate.util.ReflectHelper;
/**
+ * Used internally to build instances of {@link Type}, specifically it builds instances of
+ *
+ *
* Used internally to obtain instances of Type. Applications should use static methods
* and constants on org.hibernate.Hibernate.
*
@@ -97,9 +99,9 @@ public final class TypeFactory implements Serializable {
return custom( (Class) clazz, parameters );
}
- if ( Lifecycle.class.isAssignableFrom( clazz ) ) {
+ if ( Lifecycle.class.isAssignableFrom( clazz ) || Validatable.class.isAssignableFrom( clazz ) ) {
// not really a many-to-one association *necessarily*
- return new ManyToOneType( clazz.getName() );
+ return manyToOne( clazz.getName() );
}
if ( Serializable.class.isAssignableFrom( clazz ) ) {
@@ -120,7 +122,7 @@ public final class TypeFactory implements Serializable {
}
}
- public static void injectParameters(Object type, Properties parameters) {
+ public void injectParameters(Object type, Properties parameters) {
if ( ParameterizedType.class.isInstance( type ) ) {
( (ParameterizedType) type ).setParameterValues(parameters);
}
@@ -129,7 +131,7 @@ public final class TypeFactory implements Serializable {
}
}
- public static CompositeCustomType customComponent(Class typeClass, Properties parameters) {
+ public CompositeCustomType customComponent(Class typeClass, Properties parameters) {
try {
CompositeUserType userType = typeClass.newInstance();
injectParameters( userType, parameters );
@@ -140,7 +142,27 @@ public final class TypeFactory implements Serializable {
}
}
- public static CustomType custom(Class typeClass, Properties parameters) {
+ public CollectionType customCollection(
+ String typeName,
+ Properties typeParameters,
+ String role,
+ String propertyRef,
+ boolean embedded) {
+ Class typeClass;
+ try {
+ typeClass = ReflectHelper.classForName( typeName );
+ }
+ catch ( ClassNotFoundException cnfe ) {
+ throw new MappingException( "user collection type class not found: " + typeName, cnfe );
+ }
+ CustomCollectionType result = new CustomCollectionType( typeScope, typeClass, role, propertyRef, embedded );
+ if ( typeParameters != null ) {
+ injectParameters( result.getUserType(), typeParameters );
+ }
+ return result;
+ }
+
+ public CustomType custom(Class typeClass, Properties parameters) {
try {
UserType userType = typeClass.newInstance();
injectParameters( userType, parameters );
@@ -164,10 +186,9 @@ public final class TypeFactory implements Serializable {
}
- /**
- * A one-to-one association type for the given class
- */
- public static EntityType oneToOne(
+ // one-to-one type builders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ public EntityType oneToOne(
String persistentClass,
ForeignKeyDirection foreignKeyType,
String uniqueKeyPropertyName,
@@ -175,61 +196,35 @@ public final class TypeFactory implements Serializable {
boolean unwrapProxy,
boolean isEmbeddedInXML,
String entityName,
- String propertyName
- ) {
- return new OneToOneType(
- persistentClass,
- foreignKeyType,
- uniqueKeyPropertyName,
- lazy,
- unwrapProxy,
- isEmbeddedInXML,
- entityName,
- propertyName
- );
+ String propertyName) {
+ return new OneToOneType( typeScope, persistentClass, foreignKeyType, uniqueKeyPropertyName,
+ lazy, unwrapProxy, isEmbeddedInXML, entityName, propertyName );
}
- /**
- * A many-to-one association type for the given class
- */
- public static EntityType manyToOne(String persistentClass) {
- return new ManyToOneType( persistentClass );
- }
-
- /**
- * A many-to-one association type for the given class
- */
- public static EntityType manyToOne(String persistentClass, boolean lazy) {
- return new ManyToOneType( persistentClass, lazy );
- }
-
- /**
- * A many-to-one association type for the given class
- *
- * @deprecated Use {@link #manyToOne(String, String, boolean, boolean, boolean, boolean, boolean)}
- */
- public static EntityType manyToOne(
+ public EntityType specialOneToOne(
String persistentClass,
+ ForeignKeyDirection foreignKeyType,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
- boolean isEmbeddedInXML,
- boolean ignoreNotFound) {
- //noinspection deprecation
- return new ManyToOneType(
- persistentClass,
- uniqueKeyPropertyName,
- lazy,
- unwrapProxy,
- isEmbeddedInXML,
- ignoreNotFound
- );
+ String entityName,
+ String propertyName) {
+ return new SpecialOneToOneType( typeScope, persistentClass, foreignKeyType, uniqueKeyPropertyName,
+ lazy, unwrapProxy, entityName, propertyName );
}
- /**
- * A many-to-one association type for the given class
- */
- public static EntityType manyToOne(
+
+ // many-to-one type builders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ public EntityType manyToOne(String persistentClass) {
+ return new ManyToOneType( typeScope, persistentClass );
+ }
+
+ public EntityType manyToOne(String persistentClass, boolean lazy) {
+ return new ManyToOneType( typeScope, persistentClass, lazy );
+ }
+
+ public EntityType manyToOne(
String persistentClass,
String uniqueKeyPropertyName,
boolean lazy,
@@ -238,6 +233,7 @@ public final class TypeFactory implements Serializable {
boolean ignoreNotFound,
boolean isLogicalOneToOne) {
return new ManyToOneType(
+ typeScope,
persistentClass,
uniqueKeyPropertyName,
lazy,
@@ -248,299 +244,64 @@ public final class TypeFactory implements Serializable {
);
}
- /**
- * The legacy contract.
- *
- * @deprecated Use {@link #customCollection(String, java.util.Properties, String, String, boolean)} instead
- */
- public static CollectionType customCollection(
- String typeName,
- String role,
- String propertyRef,
- boolean embedded) {
- return customCollection( typeName, null, role, propertyRef, embedded );
+
+ // collection type builders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ public CollectionType array(String role, String propertyRef, boolean embedded, Class elementClass) {
+ return new ArrayType( typeScope, role, propertyRef, elementClass, embedded );
}
- public static CollectionType customCollection(
- String typeName,
- Properties typeParameters,
- String role,
- String propertyRef,
- boolean embedded) {
- Class typeClass;
- try {
- typeClass = ReflectHelper.classForName( typeName );
- }
- catch ( ClassNotFoundException cnfe ) {
- throw new MappingException( "user collection type class not found: " + typeName, cnfe );
- }
- CustomCollectionType result = new CustomCollectionType( typeClass, role, propertyRef, embedded );
- if ( typeParameters != null ) {
- TypeFactory.injectParameters( result.getUserType(), typeParameters );
- }
- return result;
+ public CollectionType list(String role, String propertyRef, boolean embedded) {
+ return new ListType( typeScope, role, propertyRef, embedded );
}
- // Collection Types:
-
- public static CollectionType array(String role, String propertyRef, boolean embedded,
- Class elementClass) {
- return new ArrayType( role, propertyRef, elementClass, embedded );
+ public CollectionType bag(String role, String propertyRef, boolean embedded) {
+ return new BagType( typeScope, role, propertyRef, embedded );
}
- public static CollectionType list(String role, String propertyRef, boolean embedded) {
- return new ListType( role, propertyRef, embedded );
+ public CollectionType idbag(String role, String propertyRef, boolean embedded) {
+ return new IdentifierBagType( typeScope, role, propertyRef, embedded );
}
- public static CollectionType bag(String role, String propertyRef, boolean embedded) {
- return new BagType( role, propertyRef, embedded );
+ public CollectionType map(String role, String propertyRef, boolean embedded) {
+ return new MapType( typeScope, role, propertyRef, embedded );
}
- public static CollectionType idbag(String role, String propertyRef, boolean embedded) {
- return new IdentifierBagType( role, propertyRef, embedded );
+ public CollectionType orderedMap(String role, String propertyRef, boolean embedded) {
+ return new OrderedMapType( typeScope, role, propertyRef, embedded );
}
- public static CollectionType map(String role, String propertyRef, boolean embedded) {
- return new MapType( role, propertyRef, embedded );
+ public CollectionType sortedMap(String role, String propertyRef, boolean embedded, Comparator comparator) {
+ return new SortedMapType( typeScope, role, propertyRef, comparator, embedded );
}
- public static CollectionType orderedMap(String role, String propertyRef, boolean embedded) {
- return new OrderedMapType( role, propertyRef, embedded );
+ public CollectionType set(String role, String propertyRef, boolean embedded) {
+ return new SetType( typeScope, role, propertyRef, embedded );
}
- public static CollectionType set(String role, String propertyRef, boolean embedded) {
- return new SetType( role, propertyRef, embedded );
+ public CollectionType orderedSet(String role, String propertyRef, boolean embedded) {
+ return new OrderedSetType( typeScope, role, propertyRef, embedded );
}
- public static CollectionType orderedSet(String role, String propertyRef, boolean embedded) {
- return new OrderedSetType( role, propertyRef, embedded );
- }
-
- public static CollectionType sortedMap(String role, String propertyRef, boolean embedded,
- Comparator comparator) {
- return new SortedMapType( role, propertyRef, comparator, embedded );
- }
-
- public static CollectionType sortedSet(String role, String propertyRef, boolean embedded,
- Comparator comparator) {
- return new SortedSetType( role, propertyRef, comparator, embedded );
+ public CollectionType sortedSet(String role, String propertyRef, boolean embedded, Comparator comparator) {
+ return new SortedSetType( typeScope, role, propertyRef, comparator, embedded );
}
- // convenience methods relating to operations across arrays of types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ // component type builders ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- /**
- * Deep copy a series of values from one array to another...
- *
- * @param values The values to copy (the source)
- * @param types The value types
- * @param copy an array indicating which values to include in the copy
- * @param target The array into which to copy the values
- * @param session The originating session
- *
- * @deprecated Use {@link TypeHelper#deepCopy} instead
- */
- public static void deepCopy(
- final Object[] values,
- final Type[] types,
- final boolean[] copy,
- final Object[] target,
- final SessionImplementor session) {
- TypeHelper.deepCopy( values, types, copy, target, session );
+ public ComponentType component(ComponentMetamodel metamodel) {
+ return new ComponentType( typeScope, metamodel );
}
- /**
- * Apply the {@link Type#beforeAssemble} operation across a series of values.
- *
- * @param row The values
- * @param types The value types
- * @param session The originating session
- *
- * @deprecated Use {@link TypeHelper#beforeAssemble} instead
- */
- public static void beforeAssemble(
- final Serializable[] row,
- final Type[] types,
- final SessionImplementor session) {
- TypeHelper.beforeAssemble( row, types, session );
+ public EmbeddedComponentType embeddedComponent(ComponentMetamodel metamodel) {
+ return new EmbeddedComponentType( typeScope, metamodel );
}
- /**
- * Apply the {@link Type#assemble} operation across a series of values.
- *
- * @param row The values
- * @param types The value types
- * @param session The originating session
- * @param owner The entity "owning" the values
- *
- * @return The assembled state
- *
- * @deprecated Use {@link TypeHelper#assemble} instead
- */
- public static Object[] assemble(
- final Serializable[] row,
- final Type[] types,
- final SessionImplementor session,
- final Object owner) {
- return TypeHelper.assemble( row, types, session, owner );
- }
- /**
- * Apply the {@link Type#disassemble} operation across a series of values.
- *
- * @param row The values
- * @param types The value types
- * @param nonCacheable An array indicating which values to include in the disassembled state
- * @param session The originating session
- * @param owner The entity "owning" the values
- *
- * @return The disassembled state
- *
- * @deprecated Use {@link TypeHelper#disassemble} instead
- */
- public static Serializable[] disassemble(
- final Object[] row,
- final Type[] types,
- final boolean[] nonCacheable,
- final SessionImplementor session,
- final Object owner) {
- return TypeHelper.disassemble( row, types, nonCacheable, session, owner );
- }
+ // any type builder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- /**
- * Apply the {@link Type#replace} operation across a series of values.
- *
- * @param original The source of the state
- * @param target The target into which to replace the source values.
- * @param types The value types
- * @param session The originating session
- * @param owner The entity "owning" the values
- * @param copyCache A map representing a cache of already replaced state
- *
- * @return The replaced state
- *
- * @deprecated Use {@link TypeHelper#replace} instead
- */
- public static Object[] replace(
- final Object[] original,
- final Object[] target,
- final Type[] types,
- final SessionImplementor session,
- final Object owner,
- final Map copyCache) {
- return TypeHelper.replace( original, target, types, session, owner, copyCache );
+ public Type any(Type metaType, Type identifierType) {
+ return new AnyType( metaType, identifierType );
}
-
- /**
- * Apply the {@link Type#replace} operation across a series of values.
- *
- * @param original The source of the state
- * @param target The target into which to replace the source values.
- * @param types The value types
- * @param session The originating session
- * @param owner The entity "owning" the values
- * @param copyCache A map representing a cache of already replaced state
- * @param foreignKeyDirection FK directionality to be applied to the replacement
- *
- * @return The replaced state
- *
- * @deprecated Use {@link TypeHelper#replace} instead
- */
- public static Object[] replace(
- final Object[] original,
- final Object[] target,
- final Type[] types,
- final SessionImplementor session,
- final Object owner,
- final Map copyCache,
- final ForeignKeyDirection foreignKeyDirection) {
- return TypeHelper.replace( original, target, types, session, owner, copyCache, foreignKeyDirection );
- }
-
- /**
- * Apply the {@link Type#replace} operation across a series of values, as
- * long as the corresponding {@link Type} is an association.
- *
- * If the corresponding type is a component type, then apply {@link Type#replace}
- * across the component subtypes but do not replace the component value itself.
- *
- * @param original The source of the state
- * @param target The target into which to replace the source values.
- * @param types The value types
- * @param session The originating session
- * @param owner The entity "owning" the values
- * @param copyCache A map representing a cache of already replaced state
- * @param foreignKeyDirection FK directionality to be applied to the replacement
- *
- * @return The replaced state
- *
- * @deprecated Use {@link TypeHelper#replaceAssociations} instead
- */
- public static Object[] replaceAssociations(
- final Object[] original,
- final Object[] target,
- final Type[] types,
- final SessionImplementor session,
- final Object owner,
- final Map copyCache,
- final ForeignKeyDirection foreignKeyDirection) {
- return TypeHelper.replaceAssociations( original, target, types, session, owner, copyCache, foreignKeyDirection );
- }
-
- /**
- * Determine if any of the given field values are dirty, returning an array containing
- * indices of the dirty fields.
- *
- * If it is determined that no fields are dirty, null is returned.
- *
- * @param properties The property definitions
- * @param currentState The current state of the entity
- * @param previousState The baseline state of the entity
- * @param includeColumns Columns to be included in the dirty checking, per property
- * @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
- * @param session The session from which the dirty check request originated.
- *
- * @return Array containing indices of the dirty properties, or null if no properties considered dirty.
- *
- * @deprecated Use {@link TypeHelper#findDirty} instead
- */
- public static int[] findDirty(
- final StandardProperty[] properties,
- final Object[] currentState,
- final Object[] previousState,
- final boolean[][] includeColumns,
- final boolean anyUninitializedProperties,
- final SessionImplementor session) {
- return TypeHelper.findDirty( properties, currentState, previousState,
- includeColumns, anyUninitializedProperties, session );
- }
-
- /**
- * Determine if any of the given field values are modified, returning an array containing
- * indices of the modified fields.
- *
- * If it is determined that no fields are dirty, null is returned.
- *
- * @param properties The property definitions
- * @param currentState The current state of the entity
- * @param previousState The baseline state of the entity
- * @param includeColumns Columns to be included in the mod checking, per property
- * @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
- * @param session The session from which the dirty check request originated.
- *
- * @return Array containing indices of the modified properties, or null if no properties considered modified.
- *
- * @deprecated Use {@link TypeHelper#findModified} instead
- */
- public static int[] findModified(
- final StandardProperty[] properties,
- final Object[] currentState,
- final Object[] previousState,
- final boolean[][] includeColumns,
- final boolean anyUninitializedProperties,
- final SessionImplementor session) {
- return TypeHelper.findModified( properties, currentState, previousState,
- includeColumns, anyUninitializedProperties, session );
- }
-
}
diff --git a/core/src/main/java/org/hibernate/type/TypeHelper.java b/core/src/main/java/org/hibernate/type/TypeHelper.java
index e359fc7439..fdc148c85c 100644
--- a/core/src/main/java/org/hibernate/type/TypeHelper.java
+++ b/core/src/main/java/org/hibernate/type/TypeHelper.java
@@ -122,9 +122,10 @@ public class TypeHelper {
*
* @param row The values
* @param types The value types
- * @param nonCacheable An array indicating which values to include in the disassemled state
+ * @param nonCacheable An array indicating which values to include in the disassembled state
* @param session The originating session
* @param owner The entity "owning" the values
+ *
* @return The disassembled state
*/
public static Serializable[] disassemble(
@@ -157,6 +158,7 @@ public class TypeHelper {
* @param session The originating session
* @param owner The entity "owning" the values
* @param copyCache A map representing a cache of already replaced state
+ *
* @return The replaced state
*/
public static Object[] replace(
@@ -189,6 +191,7 @@ public class TypeHelper {
* @param owner The entity "owning" the values
* @param copyCache A map representing a cache of already replaced state
* @param foreignKeyDirection FK directionality to be applied to the replacement
+ *
* @return The replaced state
*/
public static Object[] replace(
@@ -213,11 +216,11 @@ public class TypeHelper {
}
/**
- * Apply the {@link Type#replace} operation across a series of values, as
- * long as the corresponding {@link Type} is an association.
+ * Apply the {@link Type#replace} operation across a series of values, as long as the corresponding
+ * {@link Type} is an association.
*
- * If the corresponding type is a component type, then apply {@link Type#replace}
- * across the component subtypes but do not replace the component value itself.
+ * If the corresponding type is a component type, then apply {@link Type#replace} across the component
+ * subtypes but do not replace the component value itself.
*
* @param original The source of the state
* @param target The target into which to replace the source values.
@@ -274,6 +277,7 @@ public class TypeHelper {
* @param includeColumns Columns to be included in the dirty checking, per property
* @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
* @param session The session from which the dirty check request originated.
+ *
* @return Array containing indices of the dirty properties, or null if no properties considered dirty.
*/
public static int[] findDirty(
@@ -321,6 +325,7 @@ public class TypeHelper {
* @param includeColumns Columns to be included in the mod checking, per property
* @param anyUninitializedProperties Does the entity currently hold any uninitialized property values?
* @param session The session from which the dirty check request originated.
+ *
* @return Array containing indices of the modified properties, or null if no properties considered modified.
*/
public static int[] findModified(
diff --git a/core/src/main/java/org/hibernate/type/TypeResolver.java b/core/src/main/java/org/hibernate/type/TypeResolver.java
index 881f309310..834ee5ac74 100644
--- a/core/src/main/java/org/hibernate/type/TypeResolver.java
+++ b/core/src/main/java/org/hibernate/type/TypeResolver.java
@@ -56,8 +56,16 @@ public class TypeResolver implements Serializable {
return new TypeResolver( basicTypeRegistry.shallowCopy(), typeFactory );
}
+ public void registerTypeOverride(BasicType type) {
+ basicTypeRegistry.register( type );
+ }
+
+ public TypeFactory getTypeFactory() {
+ return typeFactory;
+ }
+
/**
- * Locate a Hibernate {@linkplain BasicType basic type} given (one of) its registration name(s).
+ * Locate a Hibernate {@linkplain BasicType basic type} given (one of) its registration names.
*
* @param name The registration name
*
diff --git a/testsuite/src/test/java/org/hibernate/test/mapping/ValueVisitorTest.java b/testsuite/src/test/java/org/hibernate/test/mapping/ValueVisitorTest.java
index 09ef557a7a..9e9fa5c9d5 100644
--- a/testsuite/src/test/java/org/hibernate/test/mapping/ValueVisitorTest.java
+++ b/testsuite/src/test/java/org/hibernate/test/mapping/ValueVisitorTest.java
@@ -178,19 +178,19 @@ public class ValueVisitorTest extends UnitTestCase {
ValueVisitor vv = new ValueVisitorValidator();
- new Any(mappings, tbl).accept(vv);
- new Array( rootClass ).accept(vv);
- new Bag( rootClass ).accept(vv);
+ new Any( mappings, tbl ).accept(vv);
+ new Array( mappings, rootClass ).accept(vv);
+ new Bag( mappings, rootClass ).accept(vv);
new Component( mappings, rootClass ).accept(vv);
new DependantValue( mappings, tbl, null ).accept(vv);
- new IdentifierBag( rootClass ).accept(vv);
- new List( rootClass ).accept(vv);
+ new IdentifierBag( mappings, rootClass ).accept(vv);
+ new List( mappings, rootClass ).accept(vv);
new ManyToOne( mappings, tbl ).accept(vv);
- new Map( rootClass ).accept(vv);
- new OneToMany( rootClass ).accept(vv);
+ new Map( mappings, rootClass ).accept(vv);
+ new OneToMany( mappings, rootClass ).accept(vv);
new OneToOne( mappings, tbl, rootClass ).accept(vv);
- new PrimitiveArray( rootClass ).accept(vv);
- new Set( rootClass ).accept(vv);
+ new PrimitiveArray( mappings, rootClass ).accept(vv);
+ new Set( mappings, rootClass ).accept(vv);
new SimpleValue( mappings ).accept(vv);