manyToOneBinding.setIgnoreNotFound( manyToOneSource.isIgnoreNotFound() );
ManyToOne manyToOne = new ManyToOne( buildingContext, mappedByJoin.getTable() ); manyToOne.setIgnoreNotFound( ignoreNotFound ); manyToOne.setCascadeDeleteEnabled( value.isCascadeDeleteEnabled() ); manyToOne.setFetchMode( value.getFetchMode() );
defineFetchingStrategy( value, property ); value.setIgnoreNotFound( ignoreNotFound ); value.setCascadeDeleteEnabled( cascadeOnDelete );
element.setIgnoreNotFound( ignoreNotFound );
element.setIgnoreNotFound( ignoreNotFound );
ManyToOne manyToOne = new ManyToOne( mappedByJoin.getTable() ); manyToOne.setIgnoreNotFound( ignoreNotFound ); manyToOne.setCascadeDeleteEnabled( value.isCascadeDeleteEnabled() ); manyToOne.setEmbedded( value.isEmbedded() );
public static void bindManyToOne(Element node, ManyToOne manyToOne, String path, boolean isNullable, Mappings mappings) throws MappingException { bindColumnsOrFormula( node, manyToOne, path, isNullable, mappings ); initOuterJoinFetchSetting( node, manyToOne ); initLaziness( node, manyToOne, mappings, "proxy", true ); Attribute ukName = node.attribute( "property-ref" ); if ( ukName != null ) manyToOne.setReferencedPropertyName( ukName.getValue() ); manyToOne.setReferencedEntityName( getEntityName( node, mappings ) ); String embed = node.attributeValue( "embed-xml" ); manyToOne.setEmbedded( embed == null || "true".equals( embed ) ); String notFound = node.attributeValue( "not-found" ); manyToOne.setIgnoreNotFound( "ignore".equals( notFound ) ); Attribute fkNode = node.attribute( "foreign-key" ); if ( fkNode != null ) manyToOne.setForeignKeyName( fkNode.getValue() ); }
/** * @param property * @param manyToOne */ private static void bindUnidirectionalOneToManyInverseValues(GrailsDomainClassProperty property, ManyToOne manyToOne) { PropertyConfig config = getPropertyConfig(property); if (config != null) { manyToOne.setLazy(config.getLazy()); manyToOne.setIgnoreNotFound(config.getIgnoreNotFound()); } else { manyToOne.setLazy(true); } // set referenced entity manyToOne.setReferencedEntityName(property.getReferencedPropertyType().getName()); }
public static void bindManyToOne(Element node, ManyToOne manyToOne, String path, boolean isNullable, Mappings mappings) throws MappingException { bindColumnsOrFormula( node, manyToOne, path, isNullable, mappings ); initOuterJoinFetchSetting( node, manyToOne ); initLaziness( node, manyToOne, mappings, true ); Attribute ukName = node.attribute( "property-ref" ); if ( ukName != null ) { manyToOne.setReferencedPropertyName( ukName.getValue() ); } manyToOne.setReferencedEntityName( getEntityName( node, mappings ) ); String embed = node.attributeValue( "embed-xml" ); manyToOne.setEmbedded( embed == null || "true".equals( embed ) ); String notFound = node.attributeValue( "not-found" ); manyToOne.setIgnoreNotFound( "ignore".equals( notFound ) ); if( ukName != null && !manyToOne.isIgnoreNotFound() ) { if ( !node.getName().equals("many-to-many") ) { //TODO: really bad, evil hack to fix!!! mappings.addSecondPass( new ManyToOneSecondPass(manyToOne) ); } } Attribute fkNode = node.attribute( "foreign-key" ); if ( fkNode != null ) manyToOne.setForeignKeyName( fkNode.getValue() ); String cascade = node.attributeValue( "cascade" ); if ( cascade != null && cascade.indexOf( "delete-orphan" ) >= 0 ) { if ( !manyToOne.isLogicalOneToOne() ) { throw new MappingException( "many-to-one attribute [" + path + "] does not support orphan delete as it is not unique" ); } } }
public static void bindManyToOne(Element node, ManyToOne manyToOne, String path, boolean isNullable, Mappings mappings) throws MappingException { bindColumnsOrFormula( node, manyToOne, path, isNullable, mappings ); initOuterJoinFetchSetting( node, manyToOne ); initLaziness( node, manyToOne, mappings, true ); Attribute ukName = node.attribute( "property-ref" ); if ( ukName != null ) { manyToOne.setReferencedPropertyName( ukName.getValue() ); } manyToOne.setReferencedEntityName( getEntityName( node, mappings ) ); String embed = node.attributeValue( "embed-xml" ); manyToOne.setEmbedded( embed == null || "true".equals( embed ) ); String notFound = node.attributeValue( "not-found" ); manyToOne.setIgnoreNotFound( "ignore".equals( notFound ) ); if( ukName != null && !manyToOne.isIgnoreNotFound() ) { if ( !node.getName().equals("many-to-many") ) { //TODO: really bad, evil hack to fix!!! mappings.addSecondPass( new ManyToOneSecondPass(manyToOne) ); } } Attribute fkNode = node.attribute( "foreign-key" ); if ( fkNode != null ) manyToOne.setForeignKeyName( fkNode.getValue() ); String cascade = node.attributeValue( "cascade" ); if ( cascade != null && cascade.indexOf( "delete-orphan" ) >= 0 ) { if ( !manyToOne.isLogicalOneToOne() ) { throw new MappingException( "many-to-one attribute [" + path + "] does not support orphan delete as it is not unique" ); } } }
defineFetchingStrategy( value, property ); value.setIgnoreNotFound( ignoreNotFound ); value.setCascadeDeleteEnabled( cascadeOnDelete );
/** */ private static void bindManyToOneValues(GrailsDomainClassProperty property, ManyToOne manyToOne) { PropertyConfig config = getPropertyConfig(property); if (config != null && config.getFetch() != null) { manyToOne.setFetchMode(config.getFetch()); } else { manyToOne.setFetchMode(FetchMode.DEFAULT); } manyToOne.setLazy(getLaziness(property)); if (config != null) { manyToOne.setIgnoreNotFound(config.getIgnoreNotFound()); } // set referenced entity manyToOne.setReferencedEntityName(property.getReferencedPropertyType().getName()); }
/** */ protected void bindManyToOneValues(org.grails.datastore.mapping.model.types.Association property, ManyToOne manyToOne) { PropertyConfig config = getPropertyConfig(property); if (config != null && config.getFetchMode() != null) { manyToOne.setFetchMode(config.getFetchMode()); } else { manyToOne.setFetchMode(FetchMode.DEFAULT); } manyToOne.setLazy(getLaziness(property)); if (config != null) { manyToOne.setIgnoreNotFound(config.getIgnoreNotFound()); } // set referenced entity manyToOne.setReferencedEntityName(property.getAssociatedEntity().getName()); }
/** * @param property * @param manyToOne */ protected void bindUnidirectionalOneToManyInverseValues(ToMany property, ManyToOne manyToOne) { PropertyConfig config = getPropertyConfig(property); if (config == null) { manyToOne.setLazy(true); } else { manyToOne.setIgnoreNotFound(config.getIgnoreNotFound()); final FetchMode fetch = config.getFetchMode(); if(!fetch.equals(FetchMode.JOIN) && !fetch.equals(FetchMode.EAGER)) { manyToOne.setLazy(true); } final Boolean lazy = config.getLazy(); if(lazy != null) { manyToOne.setLazy(lazy); } } // set referenced entity manyToOne.setReferencedEntityName(property.getAssociatedEntity().getName()); }
ManyToOne manyToOne = new ManyToOne( mappedByJoin.getTable() ); manyToOne.setIgnoreNotFound( ignoreNotFound ); manyToOne.setCascadeDeleteEnabled( value.isCascadeDeleteEnabled() ); manyToOne.setEmbedded( value.isEmbedded() );
ManyToOne manyToOne = new ManyToOne( mappings, mappedByJoin.getTable() ); manyToOne.setIgnoreNotFound( ignoreNotFound ); manyToOne.setCascadeDeleteEnabled( value.isCascadeDeleteEnabled() ); manyToOne.setEmbedded( value.isEmbedded() );
manyToOneBinding.setIgnoreNotFound( manyToOneSource.isIgnoreNotFound() );
defineFetchingStrategy( value, property ); value.setIgnoreNotFound( ignoreNotFound ); value.setCascadeDeleteEnabled( cascadeOnDelete );
defineFetchingStrategy( value, property ); value.setIgnoreNotFound( ignoreNotFound ); value.setCascadeDeleteEnabled( cascadeOnDelete );
defineFetchingStrategy( value, property ); value.setIgnoreNotFound( ignoreNotFound ); value.setCascadeDeleteEnabled( cascadeOnDelete );