Package org.hibernate.jdbc

Examples of org.hibernate.jdbc.Expectation.canBeBatched()


      try {
        int offset = 1;
        PreparedStatement st = null;
        Expectation expectation = Expectations.appropriateExpectation( getDeleteAllCheckStyle() );
        boolean callable = isDeleteAllCallable();
        boolean useBatch = expectation.canBeBatched();
        String sql = getSQLDeleteString();
        if ( useBatch ) {
          if ( removeBatchKey == null ) {
            removeBatchKey = new BasicBatchKey(
                getRole() + "#REMOVE",
View Full Code Here


            final Object entry = entries.next();
            if ( collection.entryExists( entry, i ) ) {
              int offset = 1;
              PreparedStatement st = null;
              boolean callable = isInsertCallable();
              boolean useBatch = expectation.canBeBatched();
              String sql = getSQLInsertRowString();

              if ( useBatch ) {
                if ( recreateBatchKey == null ) {
                  recreateBatchKey = new BasicBatchKey(
View Full Code Here

          int offset = 1;
          int count = 0;
          while ( deletes.hasNext() ) {
            PreparedStatement st = null;
            boolean callable = isDeleteCallable();
            boolean useBatch = expectation.canBeBatched();
            String sql = getSQLDeleteRowString();

            if ( useBatch ) {
              if ( deleteBatchKey == null ) {
                deleteBatchKey = new BasicBatchKey(
View Full Code Here

        // insert all the new entries
        collection.preInsert( this );
        Iterator entries = collection.entries( this );
        Expectation expectation = Expectations.appropriateExpectation( getInsertCheckStyle() );
        boolean callable = isInsertCallable();
        boolean useBatch = expectation.canBeBatched();
        String sql = getSQLInsertRowString();
        int i = 0;
        int count = 0;
        while ( entries.hasNext() ) {
          int offset = 1;
View Full Code Here

    // TODO : shouldn't inserts be Expectations.NONE?
    final Expectation expectation = Expectations.appropriateExpectation( insertResultCheckStyles[j] );
    // we can't batch joined inserts, *especially* not if it is an identity insert;
    // nor can we batch statements where the expectation is based on an output param
    final boolean useBatch = j == 0 && expectation.canBeBatched();
    if ( useBatch && inserBatchKey == null ) {
      inserBatchKey = new BasicBatchKey(
          getEntityName() + "#INSERT",
          expectation
      );
View Full Code Here

          final Object object,
          final String sql,
          final SessionImplementor session) throws HibernateException {

    final Expectation expectation = Expectations.appropriateExpectation( updateResultCheckStyles[j] );
    final boolean useBatch = j == 0 && expectation.canBeBatched() && isBatchable(); //note: updates to joined tables can't be batched...
    if ( useBatch && updateBatchKey == null ) {
      updateBatchKey = new BasicBatchKey(
          getEntityName() + "#UPDATE",
          expectation
      );
View Full Code Here

    }

    final boolean useVersion = j == 0 && isVersioned();
    final boolean callable = isDeleteCallable( j );
    final Expectation expectation = Expectations.appropriateExpectation( deleteResultCheckStyles[j] );
    final boolean useBatch = j == 0 && isBatchable() && expectation.canBeBatched();
    if ( useBatch && deleteBatchKey == null ) {
      deleteBatchKey = new BasicBatchKey(
          getEntityName() + "#DELETE",
          expectation
      );
View Full Code Here

    Expectation expectation = Expectations.appropriateExpectation( insertResultCheckStyles[j] );
    boolean callable = isInsertCallable( j );
    // we can't batch joined inserts, *especially* not if it is an identity insert;
    // nor can we batch statements where the expectation is based on an output param
    final boolean useBatch = j == 0 && expectation.canBeBatched();
    try {

      // Render the SQL query
      final PreparedStatement insert;
      if ( useBatch ) {
View Full Code Here

          final SessionImplementor session) throws HibernateException {

    final boolean useVersion = j == 0 && isVersioned();
    final Expectation expectation = Expectations.appropriateExpectation( updateResultCheckStyles[j] );
    final boolean callable = isUpdateCallable( j );
    final boolean useBatch = j == 0 && expectation.canBeBatched() && isBatchable(); //note: updates to joined tables can't be batched...

    if ( log.isTraceEnabled() ) {
      log.trace( "Updating entity: " + MessageHelper.infoString( this, id, getFactory() ) );
      if ( useVersion ) {
        log.trace( "Existing version: " + oldVersion + " -> New version: " + fields[getVersionProperty()] );
View Full Code Here

    }

    final boolean useVersion = j == 0 && isVersioned();
    final boolean callable = isDeleteCallable( j );
    final Expectation expectation = Expectations.appropriateExpectation( deleteResultCheckStyles[j] );
    final boolean useBatch = j == 0 && isBatchable() && expectation.canBeBatched();

    if ( log.isTraceEnabled() ) {
      log.trace( "Deleting entity: " + MessageHelper.infoString( this, id, getFactory() ) );
      if ( useVersion ) {
        log.trace( "Version: " + version );
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.