@Test public void testLombokNullValidations() { DefaultExecution<Integer> execution = new DefaultExecution<>( TransactionDefinition.builder().build(), factory); LombokTestUtil.testLombokNullValidations(Stream.of( () -> execution.execute(null) )); }
@Override public T execute(@NonNull Function<EntityManager, T> function) throws SQLException { DefaultTransactionData data = null; EntityManager entityManager = sessionFactory.createEntityManager(); try { data = checkAndBeginTransaction(entityManager); T response = function.apply(entityManager); checkAndCommit(data, entityManager); entityManager.close(); return response; } catch (Exception e) { handleException(entityManager, data); throw e; } }
DefaultExecution implements Execution<T> { @Override public T execute(@NonNull Function<EntityManager, T> function) throws SQLException { DefaultTransactionData data = null; EntityManager entityManager = sessionFactory.createEntityManager(); try { data = checkAndBeginTransaction(entityManager); T response = function.apply(entityManager); checkAndCommit(data, entityManager); entityManager.close(); return response; } catch (Exception e) { handleException(entityManager, data); throw e; } } }
DefaultExecution implements Execution<T> { @Override public T execute(@NonNull Function<EntityManager, T> function) throws SQLException { DefaultTransactionData data = null; EntityManager entityManager = sessionFactory.createEntityManager(); try { data = checkAndBeginTransaction(entityManager); T response = function.apply(entityManager); checkAndCommit(data, entityManager); entityManager.close(); return response; } catch (Exception e) { handleException(entityManager, data); throw e; } }  }
DefaultExecution implements Execution<T> { @Override public T execute(@NonNull Function<EntityManager, T> function) throws SQLException { DefaultTransactionData data = null; EntityManager entityManager = sessionFactory.createEntityManager(); try { data = checkAndBeginTransaction(entityManager); T response = function.apply(entityManager); checkAndCommit(data, entityManager); entityManager.close(); return response; } catch (Exception e) { handleException(entityManager, data); throw e; } }  @Override T execute(@NonNull Function<EntityManager, T> function); }
DefaultExecution implements Execution<T> { @Override public T execute(@NonNull Function<EntityManager, T> function) throws SQLException { DefaultTransactionData data = null; EntityManager entityManager = sessionFactory.createEntityManager(); try { data = checkAndBeginTransaction(entityManager); T response = function.apply(entityManager); checkAndCommit(data, entityManager); entityManager.close(); return response; } catch (Exception e) { handleException(entityManager, data); throw e; } }  @Override T execute(@NonNull Function<EntityManager, T> function);  }