Package org.hibernate.pretty

Examples of org.hibernate.pretty.Formatter


    }
  }

  private String format(String sql) {
    if ( factory.getSettings().isFormatSqlEnabled() ) {
      return new Formatter(sql).format();
    }
    else {
      return sql;
    }
  }
View Full Code Here


    }
  }

  private String format(String sql) {
    if ( factory.getSettings().isFormatSqlEnabled() ) {
      return new Formatter(sql).format();
    }
    else {
      return sql;
    }
  }
View Full Code Here

    }
  }

  private String format(String sql) {
    if ( factory.getSettings().isFormatSqlEnabled() ) {
      return new Formatter(sql).format();
    }
    else {
      return sql;
    }
  }
View Full Code Here

    assertNoLoss("select case when p.age > 50 then 'old' when p.age > 18 then 'adult' else 'child' end from Person p where ( case when p.age > 50 then 'old' when p.age > 18 then 'adult' else 'child' end ) like ?");
    assertNoLoss("/* Here we' go! */ select case when p.age > 50 then 'old' when p.age > 18 then 'adult' else 'child' end from Person p where ( case when p.age > 50 then 'old' when p.age > 18 then 'adult' else 'child' end ) like ?");
  }

  private void assertNoLoss(String query) {
    String formattedQuery = new Formatter(query).format();
    StringTokenizer formatted = new StringTokenizer(formattedQuery," \t\n\r\f()");
    StringTokenizer plain = new StringTokenizer(query," \t\n\r\f()");

    System.out.println("Original: " + query);
    System.out.println("Formatted: " + formattedQuery);
View Full Code Here

TOP

Related Classes of org.hibernate.pretty.Formatter

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.