24
24
*/
25
25
package com .iluwatar .embedded .value ;
26
26
27
- import java .util .stream .Collectors ;
28
27
import lombok .extern .slf4j .Slf4j ;
29
28
30
29
/**
@@ -73,7 +72,7 @@ public static void main(String[] args) throws Exception {
73
72
}
74
73
75
74
// Initially, database is empty
76
- LOGGER .info ("Orders Query: {}" , dataSource .queryOrders ().collect ( Collectors . toList () ));
75
+ LOGGER .info ("Orders Query: {}" , dataSource .queryOrders ().toList ());
77
76
78
77
//Insert orders where shippingAddress is mapped to different columns of the same table
79
78
dataSource .insertOrder (order1 );
@@ -83,7 +82,7 @@ public static void main(String[] args) throws Exception {
83
82
84
83
// Query orders.
85
84
// We'll create ShippingAddress object from city, state, pincode values from the table and add it to Order object
86
- LOGGER .info ("Orders Query: {}" , dataSource .queryOrders ().collect ( Collectors . toList () ) + "\n " );
85
+ LOGGER .info ("Orders Query: {}" , dataSource .queryOrders ().toList () + "\n " );
87
86
88
87
//Query order by given id
89
88
LOGGER .info ("Query Order with id=2: {}" , dataSource .queryOrder (2 ));
@@ -93,7 +92,7 @@ public static void main(String[] args) throws Exception {
93
92
//Since we'd mapped address in the same table, deleting order will also take out the shipping address details.
94
93
LOGGER .info ("Remove Order with id=1" );
95
94
dataSource .removeOrder (1 );
96
- LOGGER .info ("\n Orders Query: {}" , dataSource .queryOrders ().collect ( Collectors . toList () ) + "\n " );
95
+ LOGGER .info ("\n Orders Query: {}" , dataSource .queryOrders ().toList () + "\n " );
97
96
98
97
//After successful demonstration of the pattern, drop the table
99
98
if (dataSource .deleteSchema ()) {
0 commit comments