net.java.ao.test
Class DbUtils

java.lang.Object
  extended by net.java.ao.test.DbUtils

public final class DbUtils
extends Object


Nested Class Summary
static interface DbUtils.StatementCallback
           
static class DbUtils.UpdateCallback
           
 
Constructor Summary
DbUtils()
           
 
Method Summary
static
<T> T
checkSqlExecuted(EntityManager em, Callable<T> callable)
           
static
<E extends RawEntity<?>>
E
checkSqlExecutedWhenSaving(EntityManager em, E entity)
           
static
<T> T
checkSqlNotExecuted(EntityManager em, Callable<T> callable)
           
static void executeStatement(EntityManager em, String sql, DbUtils.StatementCallback callback)
           
static void executeUpdate(EntityManager em, String sql, DbUtils.UpdateCallback callback)
           
static boolean isOracle(EntityManager em)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbUtils

public DbUtils()
Method Detail

isOracle

public static boolean isOracle(EntityManager em)

checkSqlExecuted

public static <T> T checkSqlExecuted(EntityManager em,
                                     Callable<T> callable)
                          throws Exception
Throws:
Exception

checkSqlNotExecuted

public static <T> T checkSqlNotExecuted(EntityManager em,
                                        Callable<T> callable)
                             throws Exception
Throws:
Exception

checkSqlExecutedWhenSaving

public static <E extends RawEntity<?>> E checkSqlExecutedWhenSaving(EntityManager em,
                                                                    E entity)
                                                         throws Exception
Throws:
Exception

executeUpdate

public static void executeUpdate(EntityManager em,
                                 String sql,
                                 DbUtils.UpdateCallback callback)
                          throws Exception
Throws:
Exception

executeStatement

public static void executeStatement(EntityManager em,
                                    String sql,
                                    DbUtils.StatementCallback callback)
                             throws Exception
Throws:
Exception


Copyright © 2007-2014. All Rights Reserved.