Exemple #1
0
 /**
  * Overload that does not return anything
  *
  * @param action to perform in transaction
  */
 public static void withinTransaction(final EntityManager em, final DoSomething action)
     throws Exception {
   withinTransaction(
       em,
       () -> {
         action.call();
         return null;
       });
 }
Exemple #2
0
 @Test
 public void shouldFilterResult() throws Exception {
   Optional<String> result =
       ds.list()
           .stream()
           .peek(System.out::println)
           .map(String::toUpperCase)
           .peek(System.out::println)
           .reduce((a, b) -> a + b);
   assertTrue(result.isPresent());
   assertEquals(TEST, result.get());
 }
Exemple #3
0
 @Test
 public void shouldReturnString() throws Exception {
   String result = ds.execute(() -> TEST);
   assertEquals(TEST, result);
 }