value.setTypeUsingReflection( containingClassName, propertyName );
value.setTypeUsingReflection( containingClassName, propertyName );
private static Property createProperty(Value value, PersistentClass persistentClass, GrailsDomainClassProperty grailsProperty, Mappings mappings) { // set type value.setTypeUsingReflection(persistentClass.getClassName(), grailsProperty.getName()); if (value.getTable() != null) { value.createForeignKey(); } Property prop = new Property(); prop.setValue(value); bindProperty(grailsProperty, prop, mappings); return prop; }
protected Property createProperty(Value value, PersistentClass persistentClass, PersistentProperty grailsProperty, Mappings mappings) { // set type value.setTypeUsingReflection(persistentClass.getClassName(), grailsProperty.getName()); if (value.getTable() != null) { value.createForeignKey(); } Property prop = new Property(); prop.setValue(value); bindProperty(grailsProperty, prop, mappings); return prop; }
value.setTypeUsingReflection( className, propertyName );
value.setTypeUsingReflection( className, propertyName );
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; }