Package javax.persistence

Examples of javax.persistence.StoredProcedureQuery.execute()


    StoredProcedureQuery query = em.createNamedStoredProcedureQuery("archiveOldBooks");

    // Set the parameters and execute
    query.setParameter("archiveDate", new Date());
    query.setParameter("maxBookArchived", 1000);
    query.execute();
  }

  @Test @Ignore
  public void shouldCallAStoredProcedureQuery() throws Exception {
View Full Code Here


    query.registerStoredProcedureParameter("maxBookArchived", Integer.class, ParameterMode.IN);

    // Set the parameters and execute
    query.setParameter("archiveDate", new Date());
    query.setParameter("maxBookArchived", 1000);
    query.execute();
  }
}
View Full Code Here

      Assert.isInstanceOf(StoredProcedureJpaQuery.class, jpaQuery);

      StoredProcedureJpaQuery storedProcedureJpaQuery = (StoredProcedureJpaQuery) jpaQuery;
      StoredProcedureQuery storedProcedure = storedProcedureJpaQuery.createQuery(values);
      storedProcedure.execute();

      return storedProcedureJpaQuery.extractOutputValue(storedProcedure);
    }
  }
}
View Full Code Here

    StoredProcedureQuery proc = em.createStoredProcedureQuery("plus1inout");
    proc.registerStoredProcedureParameter(1, Integer.class, ParameterMode.IN);
    proc.registerStoredProcedureParameter(2, Integer.class, ParameterMode.OUT);

    proc.setParameter(1, 1);
    proc.execute();

    assertThat(proc.getOutputParameterValue(2), is((Object) 2));
  }

  /**
 
View Full Code Here

    Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em));

    StoredProcedureQuery proc = em.createNamedStoredProcedureQuery("User.plus1IO");

    proc.setParameter("arg", 1);
    proc.execute();

    assertThat(proc.getOutputParameterValue("res"), is((Object) 2));
  }
}
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.