Package org.hibernate.sql

Examples of org.hibernate.sql.Update.addPrimaryKeyColumns()


    update.setTableName( getTableName( 0 ) );
    if ( getFactory().getSettings().isCommentsEnabled() ) {
      update.setComment( "forced version increment" );
    }
    update.addColumn( getVersionColumnName() );
    update.addPrimaryKeyColumns( getIdentifierColumnNames() );
    update.setVersionColumnName( getVersionColumnName() );
    return update.toStatementString();
  }

  /**
 
View Full Code Here


    Update update = new Update( getFactory().getDialect() ).setTableName( getTableName( j ) );

    // select the correct row by either pk or rowid
    if ( useRowId ) {
      update.addPrimaryKeyColumns( new String[]{rowIdName} ); //TODO: eventually, rowIdName[j]
    }
    else {
      update.addPrimaryKeyColumns( getKeyColumns( j ) );
    }
View Full Code Here

    // select the correct row by either pk or rowid
    if ( useRowId ) {
      update.addPrimaryKeyColumns( new String[]{rowIdName} ); //TODO: eventually, rowIdName[j]
    }
    else {
      update.addPrimaryKeyColumns( getKeyColumns( j ) );
    }

    boolean hasColumns = false;
    for ( int i = 0; i < entityMetamodel.getPropertySpan(); i++ ) {
      if ( includeProperty[i] && isPropertyOfTable( i, j ) ) {
View Full Code Here

    //identifier collections not supported for 1-to-many
    if ( getFactory().getSettings().isCommentsEnabled() ) {
      update.setComment( "create one-to-many row " + getRole() );
    }
   
    return update.addPrimaryKeyColumns( elementColumnNames, elementColumnWriters )
        .toStatementString();
  }

  /**
   * Generate the SQL UPDATE that inserts a collection index
View Full Code Here

   * Generate the SQL UPDATE that inserts a collection index
   */
  @Override
    protected String generateUpdateRowString() {
    Update update = new Update( getDialect() ).setTableName( qualifiedTableName );
    update.addPrimaryKeyColumns( elementColumnNames, elementColumnIsSettable, elementColumnWriters );
    if ( hasIdentifier ) {
      update.addPrimaryKeyColumns( new String[]{ identifierColumnName } );
    }
    if ( hasIndex && !indexContainsFormula ) {
      update.addColumns( indexColumnNames );
View Full Code Here

  @Override
    protected String generateUpdateRowString() {
    Update update = new Update( getDialect() ).setTableName( qualifiedTableName );
    update.addPrimaryKeyColumns( elementColumnNames, elementColumnIsSettable, elementColumnWriters );
    if ( hasIdentifier ) {
      update.addPrimaryKeyColumns( new String[]{ identifierColumnName } );
    }
    if ( hasIndex && !indexContainsFormula ) {
      update.addColumns( indexColumnNames );
    }
   
View Full Code Here

   
    //use a combination of foreign key columns and pk columns, since
    //the ordering of removal and addition is not guaranteed when
    //a child moves from one parent to another
    String[] rowSelectColumnNames = ArrayHelper.join( keyColumnNames, elementColumnNames );
    return update.addPrimaryKeyColumns( rowSelectColumnNames )
        .toStatementString();
  }
 
  @Override
  public void recreate(PersistentCollection collection, Serializable id, SessionImplementor session)
View Full Code Here

    //identifier collections not supported for 1-to-many
    if ( getFactory().getSettings().isCommentsEnabled() ) {
      update.setComment( "create one-to-many row " + getRole() );
    }
   
    return update.addPrimaryKeyColumns( elementColumnNames, elementColumnWriters )
        .toStatementString();
  }

  /**
   * Not needed for one-to-many association
View Full Code Here

   
    //use a combination of foreign key columns and pk columns, since
    //the ordering of removal and addition is not guaranteed when
    //a child moves from one parent to another
    String[] rowSelectColumnNames = ArrayHelper.join(keyColumnNames, elementColumnNames);
    return update.addPrimaryKeyColumns( rowSelectColumnNames )
        .toStatementString();
  }

  public boolean consumesEntityAlias() {
    return true;
View Full Code Here

    //if ( !elementIsFormula ) {
      update.addColumns( elementColumnNames, elementColumnIsSettable, elementColumnWriters );
    //}
   
    if ( hasIdentifier ) {
      update.addPrimaryKeyColumns( new String[]{ identifierColumnName } );
    }
    else if ( hasIndex && !indexContainsFormula ) {
      update.addPrimaryKeyColumns( ArrayHelper.join( keyColumnNames, indexColumnNames ) );
    }
    else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.