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 );
}
toOne.setCascadeDeleteEnabled( "cascade".equals( subnode.attributeValue( "on-delete" ) ) );
}
else if ( value instanceof Collection ) {
Collection coll = (Collection) value;
String propertyRef = coll.getReferencedPropertyName();
// not necessarily a *unique* property reference