Author: epbernard
Date: 2007-01-08 18:22:41 -0500 (Mon, 08 Jan 2007)
New Revision: 11026
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/AnnotationBinder.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/CollectionBinder.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/EntityBinder.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java
Log:
ANN-517
Default NodeName value not set in HAN leading to NPE in DOM4J mode (based on Daniel)
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/AnnotationBinder.java 2007-01-08
19:19:08 UTC (rev 11025)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/AnnotationBinder.java 2007-01-08
23:22:41 UTC (rev 11026)
@@ -1646,6 +1646,7 @@
else {
comp.setComponentClassName( comp.getOwner().getClassName() );
}
+ comp.setNodeName( inferredData.getPropertyName() );
String subpath = StringHelper.qualify( propertyHolder.getPath(),
inferredData.getPropertyName() );
log.debug( "Binding component with path: " + subpath );
PropertyHolder subHolder = PropertyHolderBuilder.buildPropertyHolder(
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java 2007-01-08
19:19:08 UTC (rev 11025)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java 2007-01-08
23:22:41 UTC (rev 11026)
@@ -65,6 +65,7 @@
clone.setInsertable( property.isInsertable() );
clone.setLazy( property.isLazy() );
clone.setName( property.getName() );
+ clone.setNodeName( property.getNodeName() );
clone.setNaturalIdentifier( property.isNaturalIdentifier() );
clone.setOptimisticLocked( property.isOptimisticLocked() );
clone.setOptional( property.isOptional() );
@@ -112,6 +113,7 @@
new Component( (PersistentClass) columnOwner ) :
new Component( (Join) columnOwner );
embeddedComp.setEmbedded( true );
+ embeddedComp.setNodeName( syntheticPropertyName );
embeddedComp.setComponentClassName( embeddedComp.getOwner().getClassName() );
for ( Property property : properties ) {
Property clone = BinderHelper.shallowCopy( property );
@@ -122,7 +124,7 @@
}
synthProp = new Property();
synthProp.setName( syntheticPropertyName );
- //synthProp.setNodeName(syntheticPropertyName);
+ synthProp.setNodeName(syntheticPropertyName);
synthProp.setPersistentClass( ownerEntity );
synthProp.setUpdateable( false );
synthProp.setInsertable( false );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/CollectionBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/CollectionBinder.java 2007-01-08
19:19:08 UTC (rev 11025)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/CollectionBinder.java 2007-01-08
23:22:41 UTC (rev 11026)
@@ -283,6 +283,7 @@
this.collection = createCollection( propertyHolder.getPersistentClass() );
log.debug( "Collection role: " + StringHelper.qualify(
propertyHolder.getPath(), propertyName ) );
collection.setRole( StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
+ collection.setNodeName( propertyName );
if ( property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) &&
mapKeyPropertyName != null ) {
throw new AnnotationException(
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/EntityBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/EntityBinder.java 2007-01-08
19:19:08 UTC (rev 11025)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/EntityBinder.java 2007-01-08
23:22:41 UTC (rev 11026)
@@ -156,6 +156,7 @@
public void bindEntity() {
persistentClass.setAbstract( annotatedClass.isAbstract() );
persistentClass.setClassName( annotatedClass.getName() );
+ persistentClass.setNodeName( name );
//persistentClass.setDynamic(false); //no longer needed with the Entity name
refactoring?
persistentClass.setEntityName( annotatedClass.getName() );
bindDiscriminatorValue();
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java 2007-01-08
19:19:08 UTC (rev 11025)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java 2007-01-08
23:22:41 UTC (rev 11026)
@@ -298,6 +298,8 @@
Iterator properties = component.getPropertyIterator();
Component indexComponent = new Component( collection );
indexComponent.setComponentClassName( component.getComponentClassName() );
+ //TODO I don't know if this is appropriate
+ indexComponent.setNodeName( "index" );
while ( properties.hasNext() ) {
Property current = (Property) properties.next();
Property newProperty = new Property();
@@ -307,6 +309,7 @@
newProperty.setUpdateable( false );
newProperty.setMetaAttributes( current.getMetaAttributes() );
newProperty.setName( current.getName() );
+ newProperty.setNodeName( current.getNodeName() );
newProperty.setNaturalIdentifier( false );
//newProperty.setOptimisticLocked( false );
newProperty.setOptional( false );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java 2007-01-08
19:19:08 UTC (rev 11025)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/PropertyBinder.java 2007-01-08
23:22:41 UTC (rev 11026)
@@ -122,6 +122,7 @@
log.debug( "Building property " + name );
Property prop = new Property();
prop.setName( name );
+ prop.setNodeName( name );
prop.setValue( value );
prop.setInsertable( insertable );
prop.setUpdateable( updatable );
Show replies by date