@Override public void addPropertyReference(String referencedClass, String propertyName) { super.addPropertyReference( referencedClass, propertyName ); }
( (Collection) value ).setReferencedPropertyName( syntheticPropertyName ); mappings.addPropertyReference( ownerEntity.getEntityName(), syntheticPropertyName );
mappings.addPropertyReference( coll.getOwnerEntityName(), propertyRef );
( (Collection) value ).setReferencedPropertyName( syntheticPropertyName ); mappings.addPropertyReference( ownerEntity.getEntityName(), syntheticPropertyName );
mappings.addPropertyReference( coll.getOwnerEntityName(), propertyRef );
mappings.addPropertyReference( coll.getOwnerEntityName(), propertyRef );
private static Property createProperty(final Value value, final String propertyName, final String className, final Element subnode, final Mappings mappings, java.util.Map inheritedMetas) throws MappingException { value.setTypeUsingReflection( className, propertyName ); // this is done here 'cos we might only know the type here (ugly!) // TODO: improve this a lot: if ( value instanceof ToOne ) { ToOne toOne = (ToOne) value; String propertyRef = toOne.getReferencedPropertyName(); if ( propertyRef != null ) { mappings.addUniquePropertyReference( toOne.getReferencedEntityName(), propertyRef ); } } else if ( value instanceof Collection ) { Collection coll = (Collection) value; String propertyRef = coll.getReferencedPropertyName(); // not necessarily a *unique* property reference if ( propertyRef != null ) { mappings.addPropertyReference( coll.getOwnerEntityName(), propertyRef ); } } value.createForeignKey(); Property prop = new Property(); prop.setValue( value ); bindProperty( subnode, prop, mappings, inheritedMetas ); return prop; }
if ( propRef != null ) { collValue.setReferencedPropertyName( propRef ); mappings.addPropertyReference( collValue.getOwnerEntityName(), propRef );
if ( propRef != null ) { collValue.setReferencedPropertyName( propRef ); mappings.addPropertyReference( collValue.getOwnerEntityName(), propRef );