Package ch.inftec.ju.db

Examples of ch.inftec.ju.db.JuEmUtil


   * Create a new DbDataUtil that will use the specified EntityManager to get
   * a raw connection to the DB and execute SQL queries.
   * @param em EntityManager instance to execute SQL in a JDBC connection
   */
  public DbDataUtil(EntityManager em) {
    this(new JuEmUtil(em));
  }
View Full Code Here


   * @param doc XML Document of an (optional) data export. If no data was exported, the
   * document will be null
   */
  public final void init(EntityManager em, Document doc) {
    this.em = em;
    this.emUtil = new JuEmUtil(em);
   
    if (doc != null) this.xg = new XPathGetter(doc);
  }
View Full Code Here

          }
         
          // Initialize protected fields of test class
          dbTest.emfWork = dbTest.emfUtil.startWork();
          dbTest.em = dbTest.emfWork.getEm();
          dbTest.emUtil = new JuEmUtil(dbTest.em);
         
          // Run test method
          base.evaluate();
         
          // Run post server code in own transaction
View Full Code Here

    this.emUtil = emUtil;
    this.tx = tx != null ? new TxHandler(tx) : new TxHandler(this.emUtil.getEm());
  }
 
  public DbSchemaUtil(EntityManager em) {
    this(new JuEmUtil(em));
  }
View Full Code Here

   * EntityManager that require a transaction to be active.
   * @param em EntityManager provided by the container
   * @param tx UserTransaction instance of a bean managed transaction context
   */
  public DbSchemaUtil(EntityManager em, UserTransaction tx) {
    this(new JuEmUtil(em), tx);
  }
View Full Code Here

   * Create a new DbDataUtil that will use the specified EntityManager to get
   * a raw connection to the DB and execute SQL queries.
   * @param em EntityManager instance to execute SQL in a JDBC connection
   */
  public DbDataUtil(EntityManager em) {
    this(new JuEmUtil(em));
  }
View Full Code Here

          }
         
          // Initialize protected fields of test class
          dbTest.emfWork = dbTest.emfUtil.startWork();
          dbTest.em = dbTest.emfWork.getEm();
          dbTest.emUtil = new JuEmUtil(dbTest.em);

          // Run test method
          base.evaluate();
         
          // Run post server code in own transaction
View Full Code Here

//  public DbSchemaUtil(JuEmUtil emUtil, JuConnUtil2 connUtil) {
//    this(emUtil, TxHandler.getDummyHandler(), connUtil);
//  }
// 
  public DbSchemaUtil(EntityManager em) {
    this(new JuEmUtil(em));
  }
View Full Code Here

   * @param em EntityManager provided by the container
   * @param tx UserTransaction instance of a bean managed transaction context
   */
  @Deprecated
  public DbSchemaUtil(EntityManager em, UserTransaction tx) {
    this(new JuEmUtil(em));
  }
View Full Code Here

  public SystemPropertyTempSetter runPreTestActionsInEjbContext(TestRunnerAnnotationHandler handler) throws Exception {
    SystemPropertyTempSetter tempSetter = handler.initContainerTestEnv();
   
    try (TxHandler txHandler = new TxHandler(this.tx, true)) {
      // Execute post test annotations (dataset exporting, data verifying)
      handler.executePreTestAnnotations(new JuEmUtil(this.em));
      txHandler.commit(); // Commit after data verifying / exporting
    } catch (Exception ex) {
      // Reset properties in case of an exception
      tempSetter.close();
      throw ex;
View Full Code Here

TOP

Related Classes of ch.inftec.ju.db.JuEmUtil

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.