Package org.hibernate.jdbc

Examples of org.hibernate.jdbc.Work


 
  private void execute(final DbUnitWork work) {
    if (this.connection != null) {
      this.doExecute(this.connection, work);
    } else if (this.emUtil != null) {
      this.emUtil.doWork(new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {
          doExecute(connection, work);
        }
      });
View Full Code Here


 
  private void execute(final DbUnitWork work) {
    if (this.connection != null) {
      this.doExecute(this.connection, work);
    } else if (this.emUtil != null) {
      this.emUtil.doWork(new Work() {
        @Override
        public void execute(Connection connection) throws SQLException {
          doExecute(connection, work);
        }
      });
View Full Code Here

        }

        entityManager.getTransaction().begin();
        logger.debug("Transaction started");

        session.doWork(new Work() {

            public void execute(Connection connection) throws SQLException {
                logger.debug("The connection instance is {}", connection);
                logger.debug("The isolation level of the connection is {} and the isolation level set on the transaction is {}",
                        connection.getTransactionIsolation(), definition.getIsolationLevel());
View Full Code Here

                continue;
            if (log.isDebugEnabled())
                log.debug("Running statement: " + ddlStatement);
            new HibernateTxFragment() {
                protected void txFragment(Session session) throws Exception {
                    Work w = new Work() {
                        public void execute(Connection connection) throws SQLException {
                            Statement statement = null;
                            try {
                                statement = connection.createStatement();
                                statement.execute(ddlStatement);
View Full Code Here

    protected boolean existsModulesTable(final String databaseName) throws Exception {
        final boolean[] returnValue = new boolean[]{false};
        new HibernateTxFragment(true) {
            protected void txFragment(Session session) throws Exception {
                Work w = new Work() {
                    public void execute(Connection connection) throws SQLException {
                        Statement statement = null;
                        try {
                            statement = connection.createStatement();
                            statement.execute(getTestTableExistsSql());
View Full Code Here

   * Fails on Oracle XE as well as on Oracle enterprise edition
   */
  @Ignore
  @Test
  public void canEvaluateDefaultSchema_usingPrepareCall() {
    this.emUtil.doWork(new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        CallableStatement cs = connection.prepareCall("select sys_context( 'userenv', 'current_schema' ) from dual");
        ResultSet rs = cs.executeQuery();
        rs.next();
View Full Code Here

        // add this field to the list of fields to store
        this.tl_mapFieldInfo.get()
            .put(type.getName(), f.getShortName());
      }
    }
    this.sessionFactory.getCurrentSession().doWork(new Work() {
      @Override
      public void execute(Connection conn) throws SQLException {
        ResultSet rs = null;

        try {
View Full Code Here

        .getAnnotationIndex(Annotation.typeIndexID);
    final List<Annotation> listAnno = new ArrayList<Annotation>(
        annoIdx.size());
    final BiMap<Annotation, Integer> mapAnnoToId = HashBiMap.create();
    final FSIterator<Annotation> annoIterator = annoIdx.iterator();
    this.sessionFactory.getCurrentSession().doWork(new Work() {

      @Override
      public void execute(Connection conn) throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;
View Full Code Here

  @Test
  public void canImport_usingJdbcConnection() {
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    this.emUtil.doWork(new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        URL url = JuUrl.resource("ch/inftec/ju/testing/db/DbDataUtilTest_jdbcConnectionImport.xml");
        DbDataUtil.executeInsert(connection, url, true);
      }
View Full Code Here

            }

            if (log.isDebugEnabled()) log.debug("Running statement: " + ddlStatement);
            new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                Work w = new Work() {
                public void execute(Connection connection) throws SQLException {
                    Statement statement = null;
                    try {
                        statement = connection.createStatement();
                        statement.execute(ddlStatement);
View Full Code Here

TOP

Related Classes of org.hibernate.jdbc.Work

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.