Author: steve.ebersole(a)jboss.com
Date: 2010-05-20 17:55:28 -0400 (Thu, 20 May 2010)
New Revision: 19572
Added:
core/trunk/core/src/main/java/org/hibernate/type/CompositeType.java
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/beanvalidation/HibernateTraversableResolver.java
core/trunk/core/src/main/java/org/hibernate/criterion/Example.java
core/trunk/core/src/main/java/org/hibernate/criterion/InExpression.java
core/trunk/core/src/main/java/org/hibernate/engine/Cascade.java
core/trunk/core/src/main/java/org/hibernate/engine/ForeignKeys.java
core/trunk/core/src/main/java/org/hibernate/engine/Nullability.java
core/trunk/core/src/main/java/org/hibernate/event/def/AbstractVisitor.java
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultRefreshEventListener.java
core/trunk/core/src/main/java/org/hibernate/event/def/ReattachVisitor.java
core/trunk/core/src/main/java/org/hibernate/event/def/WrapVisitor.java
core/trunk/core/src/main/java/org/hibernate/loader/JoinWalker.java
core/trunk/core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java
core/trunk/core/src/main/java/org/hibernate/mapping/Property.java
core/trunk/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
core/trunk/core/src/main/java/org/hibernate/persister/collection/CompositeElementPropertyMapping.java
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractPropertyMapping.java
core/trunk/core/src/main/java/org/hibernate/proxy/ProxyFactory.java
core/trunk/core/src/main/java/org/hibernate/proxy/dom4j/Dom4jProxyFactory.java
core/trunk/core/src/main/java/org/hibernate/proxy/map/MapProxyFactory.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBLazyInitializer.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBProxyFactory.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/SerializableProxy.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/SerializableProxy.java
core/trunk/core/src/main/java/org/hibernate/tuple/entity/AbstractEntityTuplizer.java
core/trunk/core/src/main/java/org/hibernate/tuple/entity/Dom4jEntityTuplizer.java
core/trunk/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
core/trunk/core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java
core/trunk/core/src/main/java/org/hibernate/type/AbstractComponentType.java
core/trunk/core/src/main/java/org/hibernate/type/AnyType.java
core/trunk/core/src/main/java/org/hibernate/type/ComponentType.java
core/trunk/core/src/main/java/org/hibernate/type/CompositeCustomType.java
core/trunk/core/src/main/java/org/hibernate/type/Type.java
core/trunk/core/src/main/java/org/hibernate/type/TypeHelper.java
Log:
HHH-5248 - Introduce CompositeType interface (to replace AbstractComponentType interface)
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/beanvalidation/HibernateTraversableResolver.java
===================================================================
---
core/trunk/annotations/src/main/java/org/hibernate/cfg/beanvalidation/HibernateTraversableResolver.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/annotations/src/main/java/org/hibernate/cfg/beanvalidation/HibernateTraversableResolver.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.cfg.beanvalidation;
import java.lang.annotation.ElementType;
@@ -11,9 +34,9 @@
import org.hibernate.Hibernate;
import org.hibernate.annotations.common.AssertionFailure;
import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.type.CollectionType;
-import org.hibernate.type.AbstractComponentType;
/**
* Use Hibernate metadata to ignore cascade on entities.
@@ -56,7 +79,7 @@
else if ( type.isEntityType() || type.isAnyType() ) {
associations.add( prefix + name );
} else if ( type.isComponentType() ) {
- AbstractComponentType componentType = (AbstractComponentType) type;
+ CompositeType componentType = (CompositeType) type;
addAssociationsToTheSetForAllProperties(
componentType.getPropertyNames(),
componentType.getSubtypes(),
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/Example.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/Example.java 2010-05-20 20:37:56
UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/Example.java 2010-05-20 21:55:28
UTC (rev 19572)
@@ -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.criterion;
@@ -35,7 +34,7 @@
import org.hibernate.HibernateException;
import org.hibernate.engine.TypedValue;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
@@ -218,7 +217,7 @@
appendComponentCondition(
propertyName,
propertyValue,
- (AbstractComponentType) propertyTypes[i],
+ (CompositeType) propertyTypes[i],
criteria,
criteriaQuery,
buf
@@ -261,7 +260,7 @@
if (isPropertyIncluded) {
if ( propertyTypes[i].isComponentType() ) {
- addComponentTypedValues(name, value, (AbstractComponentType) type, list, criteria,
criteriaQuery);
+ addComponentTypedValues(name, value, (CompositeType) type, list, criteria,
criteriaQuery);
}
else {
addPropertyTypedValue(value, type, list);
@@ -296,7 +295,7 @@
protected void addComponentTypedValues(
String path,
Object component,
- AbstractComponentType type,
+ CompositeType type,
List list,
Criteria criteria,
CriteriaQuery criteriaQuery)
@@ -312,7 +311,7 @@
String subpath = StringHelper.qualify( path, propertyNames[i] );
if ( isPropertyIncluded(value, subpath, subtype) ) {
if ( subtype.isComponentType() ) {
- addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list,
criteria, criteriaQuery);
+ addComponentTypedValues(subpath, value, (CompositeType) subtype, list, criteria,
criteriaQuery);
}
else {
addPropertyTypedValue(value, subtype, list);
@@ -356,7 +355,7 @@
protected void appendComponentCondition(
String path,
Object component,
- AbstractComponentType type,
+ CompositeType type,
Criteria criteria,
CriteriaQuery criteriaQuery,
StringBuffer buf)
@@ -375,7 +374,7 @@
appendComponentCondition(
subpath,
value,
- (AbstractComponentType) subtype,
+ (CompositeType) subtype,
criteria,
criteriaQuery,
buf
Modified: core/trunk/core/src/main/java/org/hibernate/criterion/InExpression.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/criterion/InExpression.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/criterion/InExpression.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.criterion;
@@ -29,10 +28,8 @@
import org.hibernate.Criteria;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
-
import org.hibernate.engine.TypedValue;
-
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.util.StringHelper;
@@ -84,7 +81,7 @@
ArrayList list = new ArrayList();
Type type = criteriaQuery.getTypeUsingProjection(criteria, propertyName);
if ( type.isComponentType() ) {
- AbstractComponentType actype = (AbstractComponentType) type;
+ CompositeType actype = (CompositeType) type;
Type[] types = actype.getSubtypes();
for ( int j=0; j<values.length; j++ ) {
for ( int i=0; i<types.length; i++ ) {
Modified: core/trunk/core/src/main/java/org/hibernate/engine/Cascade.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/Cascade.java 2010-05-20 20:37:56
UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/engine/Cascade.java 2010-05-20 21:55:28
UTC (rev 19572)
@@ -38,9 +38,9 @@
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.AssociationType;
import org.hibernate.type.CollectionType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
import org.hibernate.util.CollectionHelper;
@@ -212,7 +212,7 @@
}
}
else if ( type.isComponentType() ) {
- cascadeComponent( parent, child, (AbstractComponentType) type, propertyName, anything
);
+ cascadeComponent( parent, child, (CompositeType) type, propertyName, anything );
}
}
else {
@@ -300,7 +300,7 @@
private void cascadeComponent(
final Object parent,
final Object child,
- final AbstractComponentType componentType,
+ final CompositeType componentType,
final String componentPropertyName,
final Object anything) {
componentPathStack.push( componentPropertyName );
Modified: core/trunk/core/src/main/java/org/hibernate/engine/ForeignKeys.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/ForeignKeys.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/engine/ForeignKeys.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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;
@@ -32,7 +31,7 @@
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.LazyInitializer;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
@@ -96,7 +95,7 @@
return isNullifiable(null, value) ? null : value;
}
else if ( type.isComponentType() ) {
- AbstractComponentType actype = (AbstractComponentType) type;
+ CompositeType actype = (CompositeType) type;
Object[] subvalues = actype.getPropertyValues(value, session);
Type[] subtypes = actype.getSubtypes();
boolean substitute = false;
Modified: core/trunk/core/src/main/java/org/hibernate/engine/Nullability.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/Nullability.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/engine/Nullability.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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;
@@ -30,8 +29,8 @@
import org.hibernate.PropertyValueException;
import org.hibernate.intercept.LazyPropertyInitializer;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.CollectionType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
/**
@@ -138,7 +137,7 @@
throws HibernateException {
//for non null args, check for components and elements containing components
if ( propertyType.isComponentType() ) {
- return checkComponentNullability( value, (AbstractComponentType) propertyType );
+ return checkComponentNullability( value, (CompositeType) propertyType );
}
else if ( propertyType.isCollectionType() ) {
@@ -148,7 +147,7 @@
if ( collectionElementType.isComponentType() ) {
//check for all components values in the collection
- AbstractComponentType componentType = (AbstractComponentType) collectionElementType;
+ CompositeType componentType = (CompositeType) collectionElementType;
Iterator iter = CascadingAction.getLoadedElementsIterator(session, collectionType,
value);
while ( iter.hasNext() ) {
Object compValue = iter.next();
@@ -171,7 +170,7 @@
* @return property path
* @throws HibernateException error while getting subcomponent values
*/
- private String checkComponentNullability(final Object value, final AbstractComponentType
compType)
+ private String checkComponentNullability(final Object value, final CompositeType
compType)
throws HibernateException {
/* will check current level if some of them are not null
* or sublevels if they exist
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/AbstractVisitor.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/AbstractVisitor.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/AbstractVisitor.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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;
@@ -28,8 +27,8 @@
import org.hibernate.event.EventSource;
import org.hibernate.intercept.LazyPropertyInitializer;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.CollectionType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
@@ -99,8 +98,7 @@
* @param componentType
* @throws HibernateException
*/
- Object processComponent(Object component, AbstractComponentType componentType)
- throws HibernateException {
+ Object processComponent(Object component, CompositeType componentType) throws
HibernateException {
if (component!=null) {
processValues(
componentType.getPropertyValues(component, session),
@@ -127,7 +125,7 @@
return processEntity( value, (EntityType) type );
}
else if ( type.isComponentType() ) {
- return processComponent( value, (AbstractComponentType) type );
+ return processComponent( value, (CompositeType) type );
}
else {
return null;
Modified:
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultRefreshEventListener.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultRefreshEventListener.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/event/def/DefaultRefreshEventListener.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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;
@@ -29,6 +28,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import org.hibernate.HibernateException;
import org.hibernate.PersistentObjectException;
import org.hibernate.UnresolvableObjectException;
@@ -43,8 +43,8 @@
import org.hibernate.event.RefreshEventListener;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.pretty.MessageHelper;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.CollectionType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.util.IdentityMap;
@@ -177,7 +177,7 @@
factory.evictCollection( ( (CollectionType) types[i] ).getRole(), id );
}
else if ( types[i].isComponentType() ) {
- AbstractComponentType actype = (AbstractComponentType) types[i];
+ CompositeType actype = (CompositeType) types[i];
evictCachedCollections( actype.getSubtypes(), id, factory );
}
}
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/ReattachVisitor.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/ReattachVisitor.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/ReattachVisitor.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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;
@@ -33,7 +32,7 @@
import org.hibernate.event.EventSource;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.pretty.MessageHelper;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
/**
@@ -75,7 +74,7 @@
/**
* {@inheritDoc}
*/
- Object processComponent(Object component, AbstractComponentType componentType) throws
HibernateException {
+ Object processComponent(Object component, CompositeType componentType) throws
HibernateException {
Type[] types = componentType.getSubtypes();
if ( component == null ) {
processValues( new Object[types.length], types );
Modified: core/trunk/core/src/main/java/org/hibernate/event/def/WrapVisitor.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/event/def/WrapVisitor.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/event/def/WrapVisitor.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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,8 +33,8 @@
import org.hibernate.event.EventSource;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.CollectionType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
/**
@@ -125,7 +124,7 @@
}
}
- Object processComponent(Object component, AbstractComponentType componentType)
+ Object processComponent(Object component, CompositeType componentType)
throws HibernateException {
if (component!=null) {
Modified: core/trunk/core/src/main/java/org/hibernate/loader/JoinWalker.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/loader/JoinWalker.java 2010-05-20 20:37:56
UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/loader/JoinWalker.java 2010-05-20 21:55:28
UTC (rev 19572)
@@ -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.loader;
@@ -50,8 +49,8 @@
import org.hibernate.sql.DisjunctionFragment;
import org.hibernate.sql.InFragment;
import org.hibernate.sql.JoinFragment;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.AssociationType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.ForeignKeyDirection;
import org.hibernate.type.Type;
@@ -348,7 +347,7 @@
}
else if ( type.isComponentType() ) {
walkCompositeElementTree(
- (AbstractComponentType) type,
+ (CompositeType) type,
persister.getElementColumnNames(),
persister,
alias,
@@ -525,7 +524,7 @@
}
else if ( type.isComponentType() ) {
walkComponentTree(
- ( AbstractComponentType ) type,
+ ( CompositeType ) type,
i,
0,
persister,
@@ -552,7 +551,7 @@
* @throws org.hibernate.MappingException ???
*/
private void walkComponentTree(
- final AbstractComponentType componentType,
+ final CompositeType componentType,
final int propertyNumber,
int begin,
final OuterJoinLoadable persister,
@@ -599,7 +598,7 @@
else if ( types[i].isComponentType() ) {
final PropertyPath subPath = path.append( propertyNames[i] );
walkComponentTree(
- ( AbstractComponentType ) types[i],
+ ( CompositeType ) types[i],
propertyNumber,
begin,
persister,
@@ -617,7 +616,7 @@
* For a composite element, add to a list of associations to be fetched by outerjoin
*/
private void walkCompositeElementTree(
- final AbstractComponentType compositeType,
+ final CompositeType compositeType,
final String[] cols,
final QueryableCollection persister,
final String alias,
@@ -662,7 +661,7 @@
else if ( types[i].isComponentType() ) {
final PropertyPath subPath = path.append( propertyNames[i] );
walkCompositeElementTree(
- (AbstractComponentType) types[i],
+ (CompositeType) types[i],
lhsColumns,
persister,
alias,
Modified: core/trunk/core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/loader/entity/EntityJoinWalker.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.loader.entity;
@@ -42,7 +41,7 @@
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.persister.entity.OuterJoinLoadable;
import org.hibernate.type.AssociationType;
-import org.hibernate.type.ComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
@@ -160,21 +159,19 @@
if ( entityPersister != null
&& entityPersister.getIdentifierType().isComponentType()
&& !
entityPersister.getEntityMetamodel().getIdentifierProperty().isEmbedded()
- && hasAssociation( (ComponentType) entityPersister.getIdentifierType() ) )
{
+ && hasAssociation( (CompositeType) entityPersister.getIdentifierType() ) )
{
aliasesForAssociationsWithCompositesIds.add( oja.getRhsAlias() );
}
}
- private boolean hasAssociation(ComponentType componentType) {
- int i = 0;
+ private boolean hasAssociation(CompositeType componentType) {
for ( Type subType : componentType.getSubtypes() ) {
if ( subType.isEntityType() ) {
return true;
}
- else if ( subType.isComponentType() && hasAssociation( ( (ComponentType)
subType ) ) ) {
+ else if ( subType.isComponentType() && hasAssociation( ( (CompositeType)
subType ) ) ) {
return true;
}
- i++;
}
return false;
}
@@ -197,7 +194,7 @@
findKeyManyToOneTargetIndices(
keyManyToOneTargetIndices,
joinWithCompositeId,
- (ComponentType) entityPersister.getIdentifierType()
+ (CompositeType) entityPersister.getIdentifierType()
);
if ( ! keyManyToOneTargetIndices.isEmpty() ) {
@@ -219,7 +216,7 @@
private void findKeyManyToOneTargetIndices(
ArrayList<Integer> keyManyToOneTargetIndices,
OuterJoinableAssociation joinWithCompositeId,
- ComponentType componentType) {
+ CompositeType componentType) {
for ( Type subType : componentType.getSubtypes() ) {
if ( subType.isEntityType() ) {
Integer index = locateKeyManyToOneTargetIndex( joinWithCompositeId, (EntityType)
subType );
@@ -231,7 +228,7 @@
findKeyManyToOneTargetIndices(
keyManyToOneTargetIndices,
joinWithCompositeId,
- (ComponentType) subType
+ (CompositeType) subType
);
}
}
Modified: core/trunk/core/src/main/java/org/hibernate/mapping/Property.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/mapping/Property.java 2010-05-20 20:37:56
UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/mapping/Property.java 2010-05-20 21:55:28
UTC (rev 19572)
@@ -27,16 +27,16 @@
import java.util.Iterator;
import java.util.StringTokenizer;
+import org.hibernate.EntityMode;
import org.hibernate.MappingException;
import org.hibernate.PropertyNotFoundException;
-import org.hibernate.EntityMode;
import org.hibernate.engine.CascadeStyle;
import org.hibernate.engine.Mapping;
import org.hibernate.property.Getter;
import org.hibernate.property.PropertyAccessor;
import org.hibernate.property.PropertyAccessorFactory;
import org.hibernate.property.Setter;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
@@ -109,7 +109,7 @@
public CascadeStyle getCascadeStyle() throws MappingException {
Type type = value.getType();
if ( type.isComponentType() && !type.isAnyType() ) {
- AbstractComponentType actype = (AbstractComponentType) type;
+ CompositeType actype = (CompositeType) type;
int length = actype.getSubtypes().length;
for ( int i=0; i<length; i++ ) {
if ( actype.getCascadeStyle(i)!=CascadeStyle.NONE ) return CascadeStyle.ALL;
Modified:
core/trunk/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.persister.collection;
@@ -79,8 +78,8 @@
import org.hibernate.sql.SimpleSelect;
import org.hibernate.sql.Template;
import org.hibernate.sql.ordering.antlr.ColumnMapper;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.CollectionType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
@@ -525,7 +524,7 @@
elementColumnReaders,
elementColumnReaderTemplates,
elementFormulaTemplates,
- (AbstractComponentType) elementType,
+ (CompositeType) elementType,
factory
);
}
@@ -1729,7 +1728,7 @@
collectionPropertyColumnNames.put(aliasName, columnNames);
if( type.isComponentType() ) {
- AbstractComponentType ct = (AbstractComponentType) type;
+ CompositeType ct = (CompositeType) type;
String[] propertyNames = ct.getPropertyNames();
for (int i = 0; i < propertyNames.length; i++) {
String name = propertyNames[i];
Modified:
core/trunk/core/src/main/java/org/hibernate/persister/collection/CompositeElementPropertyMapping.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/persister/collection/CompositeElementPropertyMapping.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/persister/collection/CompositeElementPropertyMapping.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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,14 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.persister.collection;
import org.hibernate.MappingException;
import org.hibernate.engine.Mapping;
import org.hibernate.persister.entity.AbstractPropertyMapping;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.Type;
/**
@@ -35,14 +34,14 @@
*/
public class CompositeElementPropertyMapping extends AbstractPropertyMapping {
- private final AbstractComponentType compositeType;
+ private final CompositeType compositeType;
public CompositeElementPropertyMapping(
String[] elementColumns,
String[] elementColumnReaders,
String[] elementColumnReaderTemplates,
String[] elementFormulaTemplates,
- AbstractComponentType compositeType,
+ CompositeType compositeType,
Mapping factory)
throws MappingException {
Modified:
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.persister.entity;
@@ -37,16 +36,19 @@
import java.util.Map;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.hibernate.AssertionFailure;
import org.hibernate.EntityMode;
import org.hibernate.FetchMode;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
+import org.hibernate.LockOptions;
import org.hibernate.MappingException;
import org.hibernate.QueryException;
import org.hibernate.StaleObjectStateException;
import org.hibernate.StaleStateException;
-import org.hibernate.LockOptions;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
import org.hibernate.cache.entry.CacheEntry;
@@ -63,7 +65,6 @@
import org.hibernate.engine.Mapping;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.engine.Status;
import org.hibernate.engine.ValueInclusion;
import org.hibernate.engine.Versioning;
import org.hibernate.exception.JDBCExceptionHelper;
@@ -88,7 +89,6 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.Selectable;
import org.hibernate.metadata.ClassMetadata;
-import org.hibernate.persister.entity.DiscriminatorMetadata;
import org.hibernate.pretty.MessageHelper;
import org.hibernate.property.BackrefPropertyAccessor;
import org.hibernate.sql.Alias;
@@ -103,8 +103,8 @@
import org.hibernate.tuple.Tuplizer;
import org.hibernate.tuple.entity.EntityMetamodel;
import org.hibernate.tuple.entity.EntityTuplizer;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.AssociationType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
import org.hibernate.type.TypeHelper;
@@ -112,8 +112,6 @@
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.FilterHelper;
import org.hibernate.util.StringHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Basic functionality for persisting an entity via JDBC
@@ -1699,7 +1697,7 @@
// aliases for composite-id's
if ( getIdentifierType().isComponentType() ) {
// Fetch embedded identifiers propertynames from the "virtual" identifier
component
- AbstractComponentType componentId = ( AbstractComponentType ) getIdentifierType();
+ CompositeType componentId = ( CompositeType ) getIdentifierType();
String[] idPropertyNames = componentId.getPropertyNames();
String[] idAliases = getIdentifierAliases();
String[] idColumnNames = getIdentifierColumnNames();
Modified:
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractPropertyMapping.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractPropertyMapping.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/persister/entity/AbstractPropertyMapping.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -34,8 +34,8 @@
import org.hibernate.QueryException;
import org.hibernate.engine.Mapping;
import org.hibernate.sql.Template;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.AssociationType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
import org.hibernate.util.ArrayHelper;
@@ -206,7 +206,7 @@
if (path!=null) addPropertyPath(path, type, columns, columnReaders,
columnReaderTemplates, formulaTemplates);
if ( type.isComponentType() ) {
- AbstractComponentType actype = (AbstractComponentType) type;
+ CompositeType actype = (CompositeType) type;
initComponentPropertyPaths( path, actype, columns, columnReaders,
columnReaderTemplates, formulaTemplates, factory );
if ( actype.isEmbedded() ) {
initComponentPropertyPaths(
@@ -266,12 +266,11 @@
protected void initComponentPropertyPaths(
final String path,
- final AbstractComponentType type,
+ final CompositeType type,
final String[] columns,
final String[] columnReaders,
final String[] columnReaderTemplates,
- String[] formulaTemplates, final Mapping factory)
- throws MappingException {
+ String[] formulaTemplates, final Mapping factory) throws MappingException {
Type[] types = type.getSubtypes();
String[] properties = type.getPropertyNames();
Modified: core/trunk/core/src/main/java/org/hibernate/proxy/ProxyFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/proxy/ProxyFactory.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/proxy/ProxyFactory.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy;
@@ -30,7 +29,7 @@
import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
/**
* Contract for run-time, proxy-based lazy initialization proxies.
@@ -42,7 +41,7 @@
/**
* Called immediately after instantiation of this factory.
* <p/>
- * Essentially equivalent to contructor injection, but contracted
+ * Essentially equivalent to constructor injection, but contracted
* here via interface.
*
* @param entityName The name of the entity for which this factory should
@@ -69,7 +68,7 @@
Set interfaces,
Method getIdentifierMethod,
Method setIdentifierMethod,
- AbstractComponentType componentIdType) throws HibernateException;
+ CompositeType componentIdType) throws HibernateException;
/**
* Create a new proxy instance
Modified: core/trunk/core/src/main/java/org/hibernate/proxy/dom4j/Dom4jProxyFactory.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/dom4j/Dom4jProxyFactory.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/dom4j/Dom4jProxyFactory.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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,20 +20,19 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.proxy.dom4j;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.Set;
+
import org.hibernate.HibernateException;
-import org.hibernate.proxy.ProxyFactory;
-import org.hibernate.proxy.HibernateProxy;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.engine.SessionImplementor;
+import org.hibernate.proxy.HibernateProxy;
+import org.hibernate.proxy.ProxyFactory;
+import org.hibernate.type.CompositeType;
-import java.util.Set;
-import java.lang.reflect.Method;
-import java.io.Serializable;
-
/**
* Builds proxies for "dom4j" entity representations.
*
@@ -52,7 +51,7 @@
Set interfaces,
Method getIdentifierMethod,
Method setIdentifierMethod,
- AbstractComponentType componentIdType) throws HibernateException {
+ CompositeType componentIdType) throws HibernateException {
this.entityName = entityName;
}
Modified: core/trunk/core/src/main/java/org/hibernate/proxy/map/MapProxyFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/proxy/map/MapProxyFactory.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/proxy/map/MapProxyFactory.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.map;
@@ -32,7 +31,7 @@
import org.hibernate.proxy.ProxyFactory;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
/**
* @author Gavin King
@@ -42,23 +41,19 @@
private String entityName;
public void postInstantiate(
- final String entityName,
- final Class persistentClass,
- final Set interfaces,
- final Method getIdentifierMethod,
- final Method setIdentifierMethod,
- AbstractComponentType componentIdType)
- throws HibernateException {
-
+ final String entityName,
+ final Class persistentClass,
+ final Set interfaces,
+ final Method getIdentifierMethod,
+ final Method setIdentifierMethod,
+ CompositeType componentIdType) throws HibernateException {
this.entityName = entityName;
}
- public HibernateProxy getProxy(
- final Serializable id,
- final SessionImplementor session)
- throws HibernateException {
- return new MapProxy( new MapLazyInitializer(entityName, id, session) );
+ public HibernateProxy getProxy(final Serializable id, final SessionImplementor session)
+ throws HibernateException {
+ return new MapProxy( new MapLazyInitializer( entityName, id, session ) );
}
}
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/BasicLazyInitializer.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.pojo;
@@ -29,7 +28,7 @@
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.util.MarkerObject;
import org.hibernate.util.ReflectHelper;
import org.hibernate.proxy.AbstractLazyInitializer;
@@ -48,7 +47,7 @@
protected Method setIdentifierMethod;
protected boolean overridesEquals;
private Object replacement;
- protected AbstractComponentType componentIdType;
+ protected CompositeType componentIdType;
protected BasicLazyInitializer(
String entityName,
@@ -56,7 +55,7 @@
Serializable id,
Method getIdentifierMethod,
Method setIdentifierMethod,
- AbstractComponentType componentIdType,
+ CompositeType componentIdType,
SessionImplementor session) {
super(entityName, id, session);
this.persistentClass = persistentClass;
@@ -68,30 +67,26 @@
protected abstract Object serializableProxy();
+ @SuppressWarnings({ "UnnecessaryBoxing" })
protected final Object invoke(Method method, Object[] args, Object proxy) throws
Throwable {
-
String methodName = method.getName();
int params = args.length;
if ( params==0 ) {
-
if ( "writeReplace".equals(methodName) ) {
return getReplacement();
}
else if ( !overridesEquals && "hashCode".equals(methodName) ) {
- return new Integer( System.identityHashCode(proxy) );
+ return Integer.valueOf( System.identityHashCode(proxy) );
}
else if ( isUninitialized() && method.equals(getIdentifierMethod) ) {
return getIdentifier();
}
-
else if ( "getHibernateLazyInitializer".equals(methodName) ) {
return this;
}
-
}
else if ( params==1 ) {
-
if ( !overridesEquals && "equals".equals(methodName) ) {
return args[0]==proxy ? Boolean.TRUE : Boolean.FALSE;
}
@@ -100,7 +95,6 @@
setIdentifier( (Serializable) args[0] );
return INVOKE_IMPLEMENTATION;
}
-
}
//if it is a property of an embedded component, invoke on the "identifier"
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBLazyInitializer.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBLazyInitializer.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBLazyInitializer.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -39,7 +39,7 @@
import org.hibernate.proxy.pojo.BasicLazyInitializer;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.util.ReflectHelper;
import org.slf4j.LoggerFactory;
@@ -63,10 +63,15 @@
private Class[] interfaces;
private boolean constructed = false;
- static HibernateProxy getProxy(final String entityName, final Class persistentClass,
- final Class[] interfaces, final Method getIdentifierMethod,
- final Method setIdentifierMethod, AbstractComponentType componentIdType,
- final Serializable id, final SessionImplementor session) throws HibernateException {
+ static HibernateProxy getProxy(
+ final String entityName,
+ final Class persistentClass,
+ final Class[] interfaces,
+ final Method getIdentifierMethod,
+ final Method setIdentifierMethod,
+ CompositeType componentIdType,
+ final Serializable id,
+ final SessionImplementor session) throws HibernateException {
// note: interfaces is assumed to already contain HibernateProxy.class
try {
@@ -94,12 +99,16 @@
}
}
- public static HibernateProxy getProxy(final Class factory, final String entityName,
- final Class persistentClass, final Class[] interfaces,
- final Method getIdentifierMethod, final Method setIdentifierMethod,
- final AbstractComponentType componentIdType, final Serializable id,
+ public static HibernateProxy getProxy(
+ final Class factory,
+ final String entityName,
+ final Class persistentClass,
+ final Class[] interfaces,
+ final Method getIdentifierMethod,
+ final Method setIdentifierMethod,
+ final CompositeType componentIdType,
+ final Serializable id,
final SessionImplementor session) throws HibernateException {
-
final CGLIBLazyInitializer instance = new CGLIBLazyInitializer(
entityName,
persistentClass,
@@ -150,9 +159,14 @@
return e.createClass();
}
- private CGLIBLazyInitializer(final String entityName, final Class persistentClass,
- final Class[] interfaces, final Serializable id, final Method getIdentifierMethod,
- final Method setIdentifierMethod, final AbstractComponentType componentIdType,
+ private CGLIBLazyInitializer(
+ final String entityName,
+ final Class persistentClass,
+ final Class[] interfaces,
+ final Serializable id,
+ final Method getIdentifierMethod,
+ final Method setIdentifierMethod,
+ final CompositeType componentIdType,
final SessionImplementor session) {
super(
entityName,
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBProxyFactory.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBProxyFactory.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/CGLIBProxyFactory.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.pojo.cglib;
@@ -32,7 +31,7 @@
import org.hibernate.proxy.ProxyFactory;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
/**
* @author Gavin King
@@ -46,7 +45,7 @@
private Class[] interfaces;
private Method getIdentifierMethod;
private Method setIdentifierMethod;
- private AbstractComponentType componentIdType;
+ private CompositeType componentIdType;
private Class factory;
public void postInstantiate(
@@ -55,7 +54,7 @@
final Set interfaces,
final Method getIdentifierMethod,
final Method setIdentifierMethod,
- AbstractComponentType componentIdType)
+ CompositeType componentIdType)
throws HibernateException {
this.entityName = entityName;
this.persistentClass = persistentClass;
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/SerializableProxy.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/SerializableProxy.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/cglib/SerializableProxy.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.pojo.cglib;
@@ -30,7 +29,7 @@
import org.hibernate.HibernateException;
import org.hibernate.proxy.AbstractSerializableProxy;
import org.hibernate.proxy.HibernateProxy;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
/**
* Serializable placeholder for <tt>CGLIB</tt> proxies
@@ -44,20 +43,20 @@
private String getIdentifierMethodName;
private String setIdentifierMethodName;
private Class[] setIdentifierMethodParams;
- private AbstractComponentType componentIdType;
+ private CompositeType componentIdType;
- public SerializableProxy() {}
+ public SerializableProxy() {
+ }
public SerializableProxy(
- final String entityName,
- final Class persistentClass,
- final Class[] interfaces,
- final Serializable id,
- final Boolean readOnly,
- final Method getIdentifierMethod,
- final Method setIdentifierMethod,
- AbstractComponentType componentIdType
- ) {
+ final String entityName,
+ final Class persistentClass,
+ final Class[] interfaces,
+ final Serializable id,
+ final Boolean readOnly,
+ final Method getIdentifierMethod,
+ final Method setIdentifierMethod,
+ CompositeType componentIdType) {
super( entityName, id, readOnly );
this.persistentClass = persistentClass;
this.interfaces = interfaces;
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistLazyInitializer.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.pojo.javassist;
@@ -39,7 +38,7 @@
import org.hibernate.engine.SessionImplementor;
import org.hibernate.proxy.pojo.BasicLazyInitializer;
import org.hibernate.proxy.HibernateProxy;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.util.ReflectHelper;
/**
@@ -66,7 +65,7 @@
final Serializable id,
final Method getIdentifierMethod,
final Method setIdentifierMethod,
- final AbstractComponentType componentIdType,
+ final CompositeType componentIdType,
final SessionImplementor session) {
super( entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod,
componentIdType, session );
this.interfaces = interfaces;
@@ -78,7 +77,7 @@
final Class[] interfaces,
final Method getIdentifierMethod,
final Method setIdentifierMethod,
- AbstractComponentType componentIdType,
+ CompositeType componentIdType,
final Serializable id,
final SessionImplementor session) throws HibernateException {
// note: interface is assumed to already contain HibernateProxy.class
@@ -121,7 +120,7 @@
final Class[] interfaces,
final Method getIdentifierMethod,
final Method setIdentifierMethod,
- final AbstractComponentType componentIdType,
+ final CompositeType componentIdType,
final Serializable id,
final SessionImplementor session) throws HibernateException {
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/JavassistProxyFactory.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.pojo.javassist;
@@ -32,7 +31,7 @@
import org.hibernate.engine.SessionImplementor;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.ProxyFactory;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
/**
* A {@link ProxyFactory} implementation for producing Javassist-based proxies.
@@ -47,7 +46,7 @@
private Class[] interfaces;
private Method getIdentifierMethod;
private Method setIdentifierMethod;
- private AbstractComponentType componentIdType;
+ private CompositeType componentIdType;
private Class factory;
public void postInstantiate(
@@ -56,7 +55,7 @@
final Set interfaces,
final Method getIdentifierMethod,
final Method setIdentifierMethod,
- AbstractComponentType componentIdType) throws HibernateException {
+ CompositeType componentIdType) throws HibernateException {
this.entityName = entityName;
this.persistentClass = persistentClass;
this.interfaces = (Class[]) interfaces.toArray(NO_CLASSES);
Modified:
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/SerializableProxy.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/SerializableProxy.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/proxy/pojo/javassist/SerializableProxy.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.proxy.pojo.javassist;
@@ -30,7 +29,7 @@
import org.hibernate.HibernateException;
import org.hibernate.proxy.AbstractSerializableProxy;
import org.hibernate.proxy.HibernateProxy;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.type.CompositeType;
/**
* Serializable placeholder for Javassist proxies
@@ -44,20 +43,20 @@
private String getIdentifierMethodName;
private String setIdentifierMethodName;
private Class[] setIdentifierMethodParams;
- private AbstractComponentType componentIdType;
+ private CompositeType componentIdType;
- public SerializableProxy() {}
+ public SerializableProxy() {
+ }
public SerializableProxy(
- final String entityName,
- final Class persistentClass,
- final Class[] interfaces,
- final Serializable id,
- final Boolean readOnly,
- final Method getIdentifierMethod,
- final Method setIdentifierMethod,
- AbstractComponentType componentIdType
- ) {
+ final String entityName,
+ final Class persistentClass,
+ final Class[] interfaces,
+ final Serializable id,
+ final Boolean readOnly,
+ final Method getIdentifierMethod,
+ final Method setIdentifierMethod,
+ CompositeType componentIdType) {
super( entityName, id, readOnly );
this.persistentClass = persistentClass;
this.interfaces = interfaces;
Modified:
core/trunk/core/src/main/java/org/hibernate/tuple/entity/AbstractEntityTuplizer.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/tuple/entity/AbstractEntityTuplizer.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/tuple/entity/AbstractEntityTuplizer.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -34,20 +34,17 @@
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
-import org.hibernate.engine.Cascade;
import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.event.EventSource;
import org.hibernate.event.PersistEvent;
-import org.hibernate.event.SaveOrUpdateEvent;
import org.hibernate.id.Assigned;
import org.hibernate.intercept.LazyPropertyInitializer;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.property.Getter;
import org.hibernate.property.Setter;
import org.hibernate.proxy.HibernateProxy;
@@ -55,8 +52,8 @@
import org.hibernate.tuple.Instantiator;
import org.hibernate.tuple.StandardProperty;
import org.hibernate.tuple.VersionProperty;
-import org.hibernate.type.AbstractComponentType;
import org.hibernate.type.ComponentType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
@@ -84,7 +81,7 @@
protected final boolean hasCustomAccessors;
private final Instantiator instantiator;
private final ProxyFactory proxyFactory;
- private final AbstractComponentType identifierMapperType;
+ private final CompositeType identifierMapperType;
public Type getIdentifierMapperType() {
return identifierMapperType;
@@ -182,7 +179,7 @@
mappedIdentifierValueMarshaller = null;
}
else {
- identifierMapperType = (AbstractComponentType) mapper.getType();
+ identifierMapperType = (CompositeType) mapper.getType();
mappedIdentifierValueMarshaller = buildMappedIdentifierValueMarshaller(
(ComponentType) entityMetamodel.getIdentifierProperty().getType(),
(ComponentType) identifierMapperType
@@ -262,7 +259,7 @@
public void setIdentifier(Object entity, Serializable id, SessionImplementor session) {
if ( entityMetamodel.getIdentifierProperty().isEmbedded() ) {
if ( entity != id ) {
- AbstractComponentType copier = (AbstractComponentType)
entityMetamodel.getIdentifierProperty().getType();
+ CompositeType copier = (CompositeType)
entityMetamodel.getIdentifierProperty().getType();
copier.setPropertyValues( entity, copier.getPropertyValues( id, getEntityMode() ),
getEntityMode() );
}
}
Modified:
core/trunk/core/src/main/java/org/hibernate/tuple/entity/Dom4jEntityTuplizer.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/tuple/entity/Dom4jEntityTuplizer.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/tuple/entity/Dom4jEntityTuplizer.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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,37 +20,37 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
- *
*/
package org.hibernate.tuple.entity;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.dom4j.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.hibernate.EntityMode;
+import org.hibernate.EntityNameResolver;
+import org.hibernate.HibernateException;
+import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.proxy.ProxyFactory;
-import org.hibernate.proxy.HibernateProxy;
-import org.hibernate.proxy.dom4j.Dom4jProxyFactory;
+import org.hibernate.property.Getter;
import org.hibernate.property.PropertyAccessor;
import org.hibernate.property.PropertyAccessorFactory;
-import org.hibernate.property.Getter;
import org.hibernate.property.Setter;
-import org.hibernate.EntityMode;
-import org.hibernate.HibernateException;
-import org.hibernate.EntityNameResolver;
-import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.proxy.HibernateProxy;
+import org.hibernate.proxy.ProxyFactory;
+import org.hibernate.proxy.dom4j.Dom4jProxyFactory;
+import org.hibernate.tuple.Dom4jInstantiator;
import org.hibernate.tuple.Instantiator;
-import org.hibernate.tuple.Dom4jInstantiator;
-import org.hibernate.type.AbstractComponentType;
-import org.dom4j.Element;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.hibernate.type.CompositeType;
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
-
/**
* An {@link EntityTuplizer} specific to the dom4j entity mode.
*
@@ -151,7 +151,7 @@
null,
null,
mappingInfo.hasEmbeddedIdentifier() ?
- (AbstractComponentType) mappingInfo.getIdentifier().getType() :
+ (CompositeType) mappingInfo.getIdentifier().getType() :
null
);
}
Modified: core/trunk/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.tuple.entity;
@@ -35,27 +34,27 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
-import org.hibernate.tuple.IdentifierProperty;
-import org.hibernate.tuple.StandardProperty;
-import org.hibernate.tuple.PropertyFactory;
-import org.hibernate.tuple.VersionProperty;
-import org.hibernate.intercept.FieldInterceptionHelper;
import org.hibernate.engine.CascadeStyle;
import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.engine.Versioning;
import org.hibernate.engine.ValueInclusion;
+import org.hibernate.engine.Versioning;
+import org.hibernate.intercept.FieldInterceptionHelper;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.PropertyGeneration;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.tuple.IdentifierProperty;
+import org.hibernate.tuple.PropertyFactory;
+import org.hibernate.tuple.StandardProperty;
+import org.hibernate.tuple.VersionProperty;
import org.hibernate.type.AssociationType;
+import org.hibernate.type.CompositeType;
import org.hibernate.type.EntityType;
import org.hibernate.type.Type;
-import org.hibernate.type.TypeFactory;
import org.hibernate.util.ArrayHelper;
import org.hibernate.util.ReflectHelper;
@@ -430,7 +429,7 @@
return true;
}
else if ( type.isComponentType() ) {
- Type[] subtypes = ( ( AbstractComponentType ) type ).getSubtypes();
+ Type[] subtypes = ( (CompositeType) type ).getSubtypes();
for ( int i = 0; i < subtypes.length; i++ ) {
if ( indicatesCollection( subtypes[i] ) ) {
return true;
Modified:
core/trunk/core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java
===================================================================
---
core/trunk/core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java 2010-05-20
20:37:56 UTC (rev 19571)
+++
core/trunk/core/src/main/java/org/hibernate/tuple/entity/PojoEntityTuplizer.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -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.tuple.entity;
@@ -33,20 +32,19 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import org.hibernate.EntityMode;
+import org.hibernate.EntityNameResolver;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
-import org.hibernate.EntityNameResolver;
-import org.hibernate.tuple.Instantiator;
-import org.hibernate.tuple.PojoInstantiator;
import org.hibernate.bytecode.ReflectionOptimizer;
import org.hibernate.cfg.Environment;
import org.hibernate.classic.Lifecycle;
import org.hibernate.classic.Validatable;
+import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.intercept.FieldInterceptionHelper;
import org.hibernate.intercept.FieldInterceptor;
-import org.hibernate.intercept.FieldInterceptionHelper;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.Subclass;
@@ -54,7 +52,9 @@
import org.hibernate.property.Setter;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.ProxyFactory;
-import org.hibernate.type.AbstractComponentType;
+import org.hibernate.tuple.Instantiator;
+import org.hibernate.tuple.PojoInstantiator;
+import org.hibernate.type.CompositeType;
import org.hibernate.util.ReflectHelper;
/**
@@ -191,7 +191,7 @@
proxyGetIdentifierMethod,
proxySetIdentifierMethod,
persistentClass.hasEmbeddedIdentifier() ?
- (AbstractComponentType) persistentClass.getIdentifier().getType() :
+ (CompositeType) persistentClass.getIdentifier().getType() :
null
);
}
Modified: core/trunk/core/src/main/java/org/hibernate/type/AbstractComponentType.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/AbstractComponentType.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/type/AbstractComponentType.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -23,52 +23,14 @@
*/
package org.hibernate.type;
-import java.lang.reflect.Method;
-
-import org.hibernate.EntityMode;
-import org.hibernate.FetchMode;
-import org.hibernate.HibernateException;
-import org.hibernate.engine.CascadeStyle;
-import org.hibernate.engine.SessionImplementor;
-
/**
* Enables other Component-like types to hold collections and have cascades, etc.
*
* @see ComponentType
* @see AnyType
* @author Gavin King
+ *
+ * @deprecated in favor of {@link org.hibernate.type.CompositeType}
*/
-public interface AbstractComponentType extends Type {
- /**
- * Get the types of the component properties
- */
- public Type[] getSubtypes();
- /**
- * Get the names of the component properties
- */
- public String[] getPropertyNames();
- /**
- * Optional operation
- * @return nullability of component properties
- */
- public boolean[] getPropertyNullability();
- /**
- * Get the values of the component properties of
- * a component instance
- */
- public Object[] getPropertyValues(Object component, SessionImplementor session) throws
HibernateException;
- /**
- * Optional operation
- */
- public Object[] getPropertyValues(Object component, EntityMode entityMode) throws
HibernateException;
- /**
- * Optional operation
- */
- public void setPropertyValues(Object component, Object[] values, EntityMode entityMode)
throws HibernateException;
- public Object getPropertyValue(Object component, int i, SessionImplementor session)
throws HibernateException;
- //public Object instantiate(Object parent, SessionImplementor session) throws
HibernateException;
- public CascadeStyle getCascadeStyle(int i);
- public FetchMode getFetchMode(int i);
- public boolean isMethodOf(Method method);
- public boolean isEmbedded();
+public interface AbstractComponentType extends CompositeType {
}
Modified: core/trunk/core/src/main/java/org/hibernate/type/AnyType.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/AnyType.java 2010-05-20 20:37:56 UTC
(rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/type/AnyType.java 2010-05-20 21:55:28 UTC
(rev 19572)
@@ -52,7 +52,7 @@
*
* @author Gavin King
*/
-public class AnyType extends AbstractType implements AbstractComponentType,
AssociationType {
+public class AnyType extends AbstractType implements CompositeType, AssociationType {
private final Type identifierType;
private final Type metaType;
Modified: core/trunk/core/src/main/java/org/hibernate/type/ComponentType.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/ComponentType.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/type/ComponentType.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -54,7 +54,7 @@
*
* @author Gavin King
*/
-public class ComponentType extends AbstractType implements AbstractComponentType {
+public class ComponentType extends AbstractType implements CompositeType {
private final TypeFactory.TypeScope typeScope;
private final String[] propertyNames;
Modified: core/trunk/core/src/main/java/org/hibernate/type/CompositeCustomType.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/CompositeCustomType.java 2010-05-20
20:37:56 UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/type/CompositeCustomType.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -47,7 +47,7 @@
* Adapts <tt>CompositeUserType</tt> to <tt>Type</tt> interface
* @author Gavin King
*/
-public class CompositeCustomType extends AbstractType implements AbstractComponentType {
+public class CompositeCustomType extends AbstractType implements CompositeType {
private final CompositeUserType userType;
private final String name;
Added: core/trunk/core/src/main/java/org/hibernate/type/CompositeType.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/CompositeType.java
(rev 0)
+++ core/trunk/core/src/main/java/org/hibernate/type/CompositeType.java 2010-05-20
21:55:28 UTC (rev 19572)
@@ -0,0 +1,151 @@
+/*
+ * 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.type;
+
+import java.lang.reflect.Method;
+
+import org.hibernate.EntityMode;
+import org.hibernate.FetchMode;
+import org.hibernate.HibernateException;
+import org.hibernate.engine.CascadeStyle;
+import org.hibernate.engine.SessionImplementor;
+
+/**
+ * Contract for value types to hold collections and have cascades, etc. The notion is
that of composition. JPA terms
+ * this an embeddable.
+ *
+ * @author Steve Ebersole
+ */
+public interface CompositeType extends Type {
+ /**
+ * Get the types of the component properties
+ *
+ * @return The component property types.
+ */
+ public Type[] getSubtypes();
+
+ /**
+ * Get the names of the component properties
+ *
+ * @return The component property names
+ */
+ public String[] getPropertyNames();
+
+ /**
+ * Retrieve the indicators regarding which component properties are nullable.
+ * <p/>
+ * An optional operation
+ *
+ * @return nullability of component properties
+ */
+ public boolean[] getPropertyNullability();
+
+ /**
+ * Extract the values of the component properties from the given component instance
+ *
+ * @param component The component instance
+ * @param session The session from which the request originates
+ *
+ * @return The property values
+ *
+ * @throws HibernateException Indicates a problem access the property values.
+ */
+ public Object[] getPropertyValues(Object component, SessionImplementor session) throws
HibernateException;
+
+ /**
+ * Extract the values of the component properties from the given component instance
without access to the
+ * session.
+ * <p/>
+ * An optional operation
+ *
+ * @param component The component instance
+ * @param entityMode The entity mode
+ *
+ * @return The property values
+ *
+ * @throws HibernateException Indicates a problem access the property values.
+ */
+ public Object[] getPropertyValues(Object component, EntityMode entityMode) throws
HibernateException;
+
+ /**
+ * Extract a particular component property value indicated by index.
+ *
+ * @param component The component instance
+ * @param index The index of the property whose value is to be extracted
+ * @param session The session from which the request originates.
+ *
+ * @return The extracted component property value
+ *
+ * @throws HibernateException Indicates a problem access the property value.
+ */
+ public Object getPropertyValue(Object component, int index, SessionImplementor session)
throws HibernateException;
+
+ /**
+ * Inject property values onto the given component instance
+ * <p/>
+ * An optional operation
+ *
+ * @param component The component instance
+ * @param values The values to inject
+ * @param entityMode The entity mode
+ *
+ * @throws HibernateException Indicates an issue performing the injection
+ */
+ public void setPropertyValues(Object component, Object[] values, EntityMode entityMode)
throws HibernateException;
+
+ /**
+ * Retrieve the cascade style of the indicated component property.
+ *
+ * @param index The property index,
+ *
+ * @return The cascade style.
+ */
+ public CascadeStyle getCascadeStyle(int index);
+
+ /**
+ * Retrieve the fetch mode of the indicated component property.
+ *
+ * @param index The property index,
+ *
+ * @return The fetch mode
+ */
+ public FetchMode getFetchMode(int index);
+
+ /**
+ * Is the given method a member of this component's class?
+ *
+ * @param method The method to check
+ *
+ * @return True if the method is a member; false otherwise.
+ */
+ public boolean isMethodOf(Method method);
+
+ /**
+ * Is this component embedded? "embedded" indicates that the component is
"virtual", that its properties are
+ * "flattened" onto its owner
+ *
+ * @return True if this component is embedded; false otherwise.
+ */
+ public boolean isEmbedded();
+}
Modified: core/trunk/core/src/main/java/org/hibernate/type/Type.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/Type.java 2010-05-20 20:37:56 UTC
(rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/type/Type.java 2010-05-20 21:55:28 UTC
(rev 19572)
@@ -96,11 +96,11 @@
public boolean isAnyType();
/**
- * Return true if the implementation is castable to {@link AbstractComponentType}.
Essentially a polymorphic
- * version of {@code (type instanceof AbstractComponentType.class)}. A component type
may own collections or
+ * Return true if the implementation is castable to {@link CompositeType}. Essentially a
polymorphic
+ * version of {@code (type instanceof CompositeType.class)}. A component type may own
collections or
* associations and hence must provide certain extra functionality.
*
- * @return True if this type is also an {@link CollectionType} implementor; false
otherwise.
+ * @return True if this type is also an {@link CompositeType} implementor; false
otherwise.
*/
public boolean isComponentType();
Modified: core/trunk/core/src/main/java/org/hibernate/type/TypeHelper.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/type/TypeHelper.java 2010-05-20 20:37:56
UTC (rev 19571)
+++ core/trunk/core/src/main/java/org/hibernate/type/TypeHelper.java 2010-05-20 21:55:28
UTC (rev 19572)
@@ -248,7 +248,7 @@
}
else if ( types[i].isComponentType() ) {
// need to extract the component values and check for subtype replacements...
- AbstractComponentType componentType = ( AbstractComponentType ) types[i];
+ CompositeType componentType = ( CompositeType ) types[i];
Type[] subtypes = componentType.getSubtypes();
Object[] origComponentValues = original[i] == null ? new Object[subtypes.length] :
componentType.getPropertyValues( original[i], session );
Object[] targetComponentValues = target[i] == null ? new Object[subtypes.length] :
componentType.getPropertyValues( target[i], session );