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();