private static boolean cascadeAssociationNow(final CascadePoint cascadePoint, AssociationType associationType) { return associationType.getForeignKeyDirection().cascadeNow( cascadePoint ); }
@Override public Object replace( Object original, Object target, SharedSessionContractImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection) throws HibernateException { boolean include; if ( isAssociationType() ) { AssociationType atype = (AssociationType) this; include = atype.getForeignKeyDirection()==foreignKeyDirection; } else { include = ForeignKeyDirection.FROM_PARENT ==foreignKeyDirection; } return include ? replace(original, target, session, owner, copyCache) : target; }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation( final String lhsTable, final String[] lhsColumnNames, final AssociationType type) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection() == ForeignKeyDirection.FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation( foreignKeyTable, foreignKeyColumns ); }
if ( type.isAssociationType() && ( (AssociationType) type ).getForeignKeyDirection().equals( ForeignKeyDirection.TO_PARENT ) ) {
if ( type.getForeignKeyDirection() == ForeignKeyDirection.FROM_PARENT ) { final String lhsTableName; final String[] lhsColumnNames;
private boolean cascadeAssociationNow(AssociationType associationType) { return associationType.getForeignKeyDirection().cascadeNow(cascadeTo) && ( eventSource.getEntityMode()!=EntityMode.DOM4J || associationType.isEmbeddedInXML() ); }
private boolean cascadeAssociationNow(AssociationType associationType) { return associationType.getForeignKeyDirection().cascadeNow(cascadeTo); }
@Override public ForeignKeyDirection getForeignKeyDirection() { return ForeignKeyDirectionV2Adapter.adapt(type.getForeignKeyDirection()); }
private boolean cascadeAssociationNow(AssociationType associationType) { return associationType.getForeignKeyDirection().cascadeNow(cascadeTo); }
public Object replace( Object original, Object target, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection) throws HibernateException { boolean include; if ( isAssociationType() ) { AssociationType atype = (AssociationType) this; include = atype.getForeignKeyDirection()==foreignKeyDirection; } else { include = ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT==foreignKeyDirection; } return include ? replace(original, target, session, owner, copyCache) : target; }
public Object replace( Object original, Object target, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection) throws HibernateException { boolean include; if ( isAssociationType() ) { AssociationType atype = (AssociationType) this; include = atype.getForeignKeyDirection()==foreignKeyDirection; } else { include = ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT==foreignKeyDirection; } return include ? replace(original, target, session, owner, copyCache) : target; }
public Object replace( Object original, Object target, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection) throws HibernateException { boolean include; if ( isAssociationType() ) { AssociationType atype = (AssociationType) this; include = atype.getForeignKeyDirection()==foreignKeyDirection; } else { include = ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT==foreignKeyDirection; } return include ? replace(original, target, session, owner, copyCache) : target; }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation(final String lhsTable, final String[] lhsColumnNames, final AssociationType type) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation(final String lhsTable, final String[] lhsColumnNames, final AssociationType type) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * Used to detect circularities in the joined graph */ protected boolean isDuplicateAssociation( final Set visitedAssociationKeys, final String lhsTable, final String[] lhsColumnNames, final AssociationType type ) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(visitedAssociationKeys, foreignKeyTable, foreignKeyColumns); }
/** * Used to detect circularities in the joined graph, note that * this method is side-effecty */ protected boolean isDuplicateAssociation( final String lhsTable, final String[] lhsColumnNames, final AssociationType type ) { final String foreignKeyTable; final String[] foreignKeyColumns; if ( type.getForeignKeyDirection()==ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT ) { foreignKeyTable = lhsTable; foreignKeyColumns = lhsColumnNames; } else { foreignKeyTable = type.getAssociatedJoinable( getFactory() ).getTableName(); foreignKeyColumns = JoinHelper.getRHSColumnNames( type, getFactory() ); } return isDuplicateAssociation(foreignKeyTable, foreignKeyColumns); }
/** * A strategy for determining if a version value is an version of * a new transient instance or a previously persistent transient instance. * The strategy is determined by the <tt>unsaved-value</tt> attribute in * the mapping file. */ public static class VersionValue { private final Object value; protected VersionValue() { this.value = null; } /** * Assume the transient instance is newly instantiated if * its version is null or equal to <tt>value</tt> * @param value value to compare to */ public VersionValue(Object value) { this.value = value; } /** * Does the given version belong to a new instance? * * @param version version to check * @return true is unsaved, false is saved, null is undefined */ public Boolean isUnsaved(Object version) throws MappingException {