if ( referencedPropertyName != null ) { ( (ManyToOne) value ).setReferencedPropertyName( referencedPropertyName ); buildingContext.getMetadataCollector().addUniquePropertyReference( referencedEntity.getEntityName(),
manyToOneBinding.setReferencedPropertyName( manyToOneSource.getReferencedEntityAttributeName() ); manyToOneBinding.setReferenceToPrimaryKey( false );
if ( referencedPropertyName != null ) { ( (ManyToOne) value ).setReferencedPropertyName( referencedPropertyName ); mappings.addUniquePropertyReference( referencedEntity.getEntityName(), referencedPropertyName );
elementBinding.setReferencedPropertyName( elementSource.getReferencedEntityAttributeName() ); elementBinding.setReferenceToPrimaryKey( false );
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() ); }
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" ); } } }
if ( referencedPropertyName != null ) { ( (ManyToOne) value ).setReferencedPropertyName( referencedPropertyName ); buildingContext.getMetadataCollector().addUniquePropertyReference( referencedEntity.getEntityName(),
if ( referencedPropertyName != null ) { ( (ManyToOne) value ).setReferencedPropertyName( referencedPropertyName ); mappings.addUniquePropertyReference( referencedEntity.getEntityName(), referencedPropertyName );
if ( referencedPropertyName != null ) { ( (ManyToOne) value ).setReferencedPropertyName( referencedPropertyName ); mappings.addUniquePropertyReference( referencedEntity.getEntityName(), referencedPropertyName );
m2o.setReferencedPropertyName(syntheticPropertyName); mappings.addUniquePropertyReference(referencedClass.getEntityName(), syntheticPropertyName); mappings.addPropertyReferencedAssociation(
m2o.setReferencedPropertyName(syntheticPropertyName); mappings.addUniquePropertyReference(referencedClass.getEntityName(), syntheticPropertyName); mappings.addPropertyReferencedAssociation(
manyToOneBinding.setReferencedPropertyName( manyToOneSource.getReferencedEntityAttributeName() ); manyToOneBinding.setReferenceToPrimaryKey( false );
elementBinding.setReferencedPropertyName( elementSource.getReferencedEntityAttributeName() ); elementBinding.setReferenceToPrimaryKey( false );