Collection collection = (Collection) referencedEntity.getRecursiveProperty( propertyName ) .getValue(); referencedPropertyName = collection.getReferencedPropertyName();
referencedPropertyName = collection.getReferencedPropertyName();
String propRef = collValue.getReferencedPropertyName(); if ( propRef == null ) { keyVal = collValue.getOwner().getIdentifier();
referencedPropertyName = collection.getReferencedPropertyName();
Collection collection = (Collection) referencedEntity.getRecursiveProperty( propertyName ) .getValue(); referencedPropertyName = collection.getReferencedPropertyName();
public CustomBasicCollectionPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException { super(collection, cacheAccessStrategy, cfg, factory); String referencedPropertyName = collection.getReferencedPropertyName(); if (referencedPropertyName == null && collection.isInverse()) { referencedPropertyName = findMappedByProperty(collection); } this.mappedByProperty = referencedPropertyName; }
public CustomOneToManyPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException { super(collection, cacheAccessStrategy, cfg, factory); String referencedPropertyName = collection.getReferencedPropertyName(); if (referencedPropertyName == null && collection.isInverse()) { referencedPropertyName = findMappedByProperty(collection); } this.mappedByProperty = referencedPropertyName; }
String propRef = collValue.getReferencedPropertyName(); if ( propRef == null ) { keyVal = collValue.getOwner().getIdentifier();
/** * Creates the DependentValue object that forms a primary key reference for the collection. * * @param mappings * @param property The grails property * @param collection The collection object * @param persistentClasses * @return The DependantValue (key) */ private static DependantValue createPrimaryKeyValue(Mappings mappings, @SuppressWarnings("unused") GrailsDomainClassProperty property, Collection collection, @SuppressWarnings("unused") Map<?, ?> persistentClasses) { KeyValue keyValue; DependantValue key; String propertyRef = collection.getReferencedPropertyName(); // this is to support mapping by a property if (propertyRef == null) { keyValue = collection.getOwner().getIdentifier(); } else { keyValue = (KeyValue) collection.getOwner().getProperty(propertyRef).getValue(); } if (LOG.isDebugEnabled()) LOG.debug("[GrailsDomainBinder] creating dependant key value to table [" + keyValue.getTable().getName() + "]"); key = new DependantValue(mappings, collection.getCollectionTable(), keyValue); key.setTypeName(null); // make nullable and non-updateable key.setNullable(true); key.setUpdateable(false); return key; }
/** * Creates the DependentValue object that forms a primary key reference for the collection. * * @param mappings * @param property The grails property * @param collection The collection object * @param persistentClasses * @return The DependantValue (key) */ protected DependantValue createPrimaryKeyValue(Mappings mappings, PersistentProperty property, Collection collection, Map<?, ?> persistentClasses) { KeyValue keyValue; DependantValue key; String propertyRef = collection.getReferencedPropertyName(); // this is to support mapping by a property if (propertyRef == null) { keyValue = collection.getOwner().getIdentifier(); } else { keyValue = (KeyValue) collection.getOwner().getProperty(propertyRef).getValue(); } if (LOG.isDebugEnabled()) LOG.debug("[GrailsDomainBinder] creating dependant key value to table [" + keyValue.getTable().getName() + "]"); key = new DependantValue(mappings, collection.getCollectionTable(), keyValue); key.setTypeName(null); // make nullable and non-updateable key.setNullable(true); key.setUpdateable(false); return key; }
String propertyRef = coll.getReferencedPropertyName();
String propertyRef = coll.getReferencedPropertyName();
String propRef = collection.getReferencedPropertyName(); if (propRef==null) { referencedKeyValue = collection.getOwner().getIdentifier();
String propRef = collection.getReferencedPropertyName(); if (propRef==null) { referencedKeyValue = collection.getOwner().getIdentifier();
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; }
String propRef = collection.getReferencedPropertyName(); if ( propRef == null ) { keyVal = collection.getOwner().getIdentifier();
String propRef = collValue.getReferencedPropertyName(); if ( propRef == null ) { keyVal = collValue.getOwner().getIdentifier();
Collection bootCollectionDescriptor, RuntimeModelCreationContext creationContext) { final String referencedPropertyName = bootCollectionDescriptor.getReferencedPropertyName(); if ( referencedPropertyName == null ) { foreignKeyTargetNavigable = getContainer().findNavigable( EntityIdentifier.NAVIGABLE_ID );
String propRef = collValue.getReferencedPropertyName(); if ( propRef == null ) { keyVal = collValue.getOwner().getIdentifier();
String propRef = collValue.getReferencedPropertyName(); if ( propRef == null ) { keyVal = collValue.getOwner().getIdentifier();