Package org.hibernate.sql

Examples of org.hibernate.sql.ConditionFragment


      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuffer( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuffer whereString = new StringBuffer();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here


      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuilder( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuilder whereString = new StringBuilder();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuffer( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuffer whereString = new StringBuffer();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuffer( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuffer whereString = new StringBuffer();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuffer( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuffer whereString = new StringBuffer();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuilder( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuilder whereString = new StringBuilder();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

    String[] collectionKeys = collectionPersister.getKeyColumnNames();
    String[] ownerKeys = ( ( Loadable ) factory.getEntityPersister( entityName ) ).getIdentifierColumnNames();

    String innerSelect = "(select 1 from " + collectionPersister.getTableName()
            + " where "
            + new ConditionFragment().setTableAlias( sqlAlias ).setCondition( ownerKeys, collectionKeys ).toFragmentString()
            + ")";

    return excludeEmpty()
            ? "exists " + innerSelect
            : "not exists " + innerSelect;
View Full Code Here

        op +
        " (select count(*) from " +
        cp.getTableName() +
        //" collection_ where " +
        " where " +
        new ConditionFragment()
            .setTableAlias( criteriaQuery.getSQLAlias(criteria, propertyName) )
            .setCondition(pk, fk)
            .toFragmentString() +
        ")";
  }
View Full Code Here

      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuffer( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuffer whereString = new StringBuffer();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

      for ( int i=0; i<batchSize; i++ ) in.addValue("?");
      return new StringBuffer( in.toFragmentString() );
    }
    else {
      //a composite key
      ConditionFragment byId = new ConditionFragment()
          .setTableAlias(alias)
          .setCondition( columnNames, "?" );
 
      StringBuffer whereString = new StringBuffer();
      if ( batchSize==1 ) {
        // if no batch, use "foo = ? and bar = ?"
        whereString.append( byId.toFragmentString() );
      }
      else {
        // if a composite key, use "( (foo = ? and bar = ?) or (foo = ? and bar = ?) )" for batching
        whereString.append('('); //TODO: unnecessary for databases with ANSI-style joins
        DisjunctionFragment df = new DisjunctionFragment();
View Full Code Here

TOP

Related Classes of org.hibernate.sql.ConditionFragment

Copyright © 2018 www.massapicom. 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.