oneToOneBinding.setReferencedEntityName( oneToOneSource.getReferencedEntityName() );
value.setPropertyName( propertyName ); String referencedEntityName = ToOneBinder.getReferenceEntityName( inferredData, targetEntity, buildingContext ); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() );
value.setPropertyName( propertyName ); String referencedEntityName = ToOneBinder.getReferenceEntityName(inferredData, targetEntity, mappings); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() );
public static void bindOneToOne(Element node, OneToOne oneToOne, String path, boolean isNullable, Mappings mappings) throws MappingException { bindColumns( node, oneToOne, isNullable, false, null, mappings ); Attribute constrNode = node.attribute( "constrained" ); boolean constrained = constrNode != null && constrNode.getValue().equals( "true" ); oneToOne.setConstrained( constrained ); oneToOne.setForeignKeyType( constrained ? ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT : ForeignKeyDirection.FOREIGN_KEY_TO_PARENT ); initOuterJoinFetchSetting( node, oneToOne ); initLaziness( node, oneToOne, mappings, true ); oneToOne.setEmbedded( "true".equals( node.attributeValue( "embed-xml" ) ) ); Attribute fkNode = node.attribute( "foreign-key" ); if ( fkNode != null ) oneToOne.setForeignKeyName( fkNode.getValue() ); Attribute ukName = node.attribute( "property-ref" ); if ( ukName != null ) oneToOne.setReferencedPropertyName( ukName.getValue() ); oneToOne.setPropertyName( node.attributeValue( "name" ) ); oneToOne.setReferencedEntityName( getEntityName( node, mappings ) ); String cascade = node.attributeValue( "cascade" ); if ( cascade != null && cascade.indexOf( "delete-orphan" ) >= 0 ) { if ( oneToOne.isConstrained() ) { throw new MappingException( "one-to-one attribute [" + path + "] does not support orphan delete as it is constrained" ); } } }
public static void bindOneToOne(Element node, OneToOne oneToOne, boolean isNullable, Mappings mappings) throws MappingException { bindColumns( node, oneToOne, isNullable, false, null, mappings ); Attribute constrNode = node.attribute( "constrained" ); boolean constrained = constrNode != null && constrNode.getValue().equals( "true" ); oneToOne.setConstrained( constrained ); oneToOne.setForeignKeyType( constrained ? ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT : ForeignKeyDirection.FOREIGN_KEY_TO_PARENT ); initOuterJoinFetchSetting( node, oneToOne ); initLaziness( node, oneToOne, mappings, "proxy", true ); oneToOne.setEmbedded( "true".equals( node.attributeValue( "embed-xml" ) ) ); Attribute fkNode = node.attribute( "foreign-key" ); if ( fkNode != null ) oneToOne.setForeignKeyName( fkNode.getValue() ); Attribute ukName = node.attribute( "property-ref" ); if ( ukName != null ) oneToOne.setReferencedPropertyName( ukName.getValue() ); oneToOne.setPropertyName( node.attributeValue( "name" ) ); oneToOne.setReferencedEntityName( getEntityName( node, mappings ) ); }
public static void bindOneToOne(Element node, OneToOne oneToOne, String path, boolean isNullable, Mappings mappings) throws MappingException { bindColumns( node, oneToOne, isNullable, false, null, mappings ); Attribute constrNode = node.attribute( "constrained" ); boolean constrained = constrNode != null && constrNode.getValue().equals( "true" ); oneToOne.setConstrained( constrained ); oneToOne.setForeignKeyType( constrained ? ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT : ForeignKeyDirection.FOREIGN_KEY_TO_PARENT ); initOuterJoinFetchSetting( node, oneToOne ); initLaziness( node, oneToOne, mappings, true ); oneToOne.setEmbedded( "true".equals( node.attributeValue( "embed-xml" ) ) ); Attribute fkNode = node.attribute( "foreign-key" ); if ( fkNode != null ) oneToOne.setForeignKeyName( fkNode.getValue() ); Attribute ukName = node.attribute( "property-ref" ); if ( ukName != null ) oneToOne.setReferencedPropertyName( ukName.getValue() ); oneToOne.setPropertyName( node.attributeValue( "name" ) ); oneToOne.setReferencedEntityName( getEntityName( node, mappings ) ); String cascade = node.attributeValue( "cascade" ); if ( cascade != null && cascade.indexOf( "delete-orphan" ) >= 0 ) { if ( oneToOne.isConstrained() ) { throw new MappingException( "one-to-one attribute [" + path + "] does not support orphan delete as it is constrained" ); } } }
value.setReferencedEntityName(revengStrategy .tableToClassName(TableIdentifier.create(targetTable)));
value.setReferencedEntityName(revengStrategy .tableToClassName(TableIdentifier.create(targetTable)));
private static void bindOneToOne(final GrailsDomainClassProperty property, OneToOne oneToOne, String path, String sessionFactoryBeanName) { PropertyConfig config = getPropertyConfig(property); final GrailsDomainClassProperty otherSide = property.getOtherSide(); oneToOne.setConstrained(otherSide.isHasOne()); oneToOne.setForeignKeyType(oneToOne.isConstrained() ? ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT : ForeignKeyDirection.FOREIGN_KEY_TO_PARENT); oneToOne.setAlternateUniqueKey(true); if (config != null && config.getFetch() != null) { oneToOne.setFetchMode(config.getFetch()); } else { oneToOne.setFetchMode(FetchMode.DEFAULT); } oneToOne.setReferencedEntityName(otherSide.getDomainClass().getFullName()); oneToOne.setPropertyName(property.getName()); if (otherSide.isHasOne()) { PropertyConfig pc = getPropertyConfig(property); bindSimpleValue(property, oneToOne, path, pc, sessionFactoryBeanName); } else { oneToOne.setReferencedPropertyName(otherSide.getName()); } }
protected void bindOneToOne(final org.grails.datastore.mapping.model.types.OneToOne property, OneToOne oneToOne, String path, String sessionFactoryBeanName) { PropertyConfig config = getPropertyConfig(property); final Association otherSide = property.getInverseSide(); final boolean hasOne = isHasOne(otherSide); oneToOne.setConstrained(hasOne); oneToOne.setForeignKeyType(oneToOne.isConstrained() ? ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT : ForeignKeyDirection.FOREIGN_KEY_TO_PARENT); oneToOne.setAlternateUniqueKey(true); if (config != null && config.getFetchMode() != null) { oneToOne.setFetchMode(config.getFetchMode()); } else { oneToOne.setFetchMode(FetchMode.DEFAULT); } oneToOne.setReferencedEntityName(otherSide.getOwner().getName()); oneToOne.setPropertyName(property.getName()); bindOneToOneInternal(property, oneToOne, path); if (hasOne) { PropertyConfig pc = getPropertyConfig(property); bindSimpleValue(property, oneToOne, path, pc, sessionFactoryBeanName); } else { oneToOne.setReferencedPropertyName(otherSide.getName()); } }
oneToOneBinding.setReferencedEntityName( oneToOneSource.getReferencedEntityName() );
value.setPropertyName( propertyName ); final String referencedEntityName = ToOneBinder.getReferenceEntityName( inferredData, targetEntity, buildingContext ); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() );
referencedEntityName = targetEntity.getName(); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() );
value.setPropertyName( propertyName ); String referencedEntityName = ToOneBinder.getReferenceEntityName(inferredData, targetEntity, mappings); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() );
value.setPropertyName( propertyName ); String referencedEntityName = ToOneBinder.getReferenceEntityName(inferredData, targetEntity, mappings); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() );