File tree Expand file tree Collapse file tree 4 files changed +11
-26
lines changed
patterns-use-cases/integrations/java-spring
src/main/java/dev/restate/examples Expand file tree Collapse file tree 4 files changed +11
-26
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,7 @@ dependencies {
31
31
implementation(" org.springframework.boot" , " spring-boot-starter-data-jpa" )
32
32
33
33
// Restate SDK
34
- implementation(" dev.restate:sdk-api:$restateVersion " )
35
- implementation(" dev.restate:sdk-http-vertx:$restateVersion " )
36
- // To use Jackson to read/write state entries (optional)
37
- implementation(" dev.restate:sdk-serde-jackson:$restateVersion " )
34
+ implementation(" dev.restate:sdk-spring-boot-starter:$restateVersion " )
38
35
39
36
implementation(" org.postgresql" , " postgresql" )
40
37
Original file line number Diff line number Diff line change 1
1
package dev .restate .examples ;
2
2
3
+ import dev .restate .sdk .springboot .EnableRestate ;
3
4
import org .springframework .boot .SpringApplication ;
4
5
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
6
6
7
@ SpringBootApplication
8
+ @ EnableRestate
7
9
public class AppMain {
8
10
9
11
public static void main (String [] args ) {
Original file line number Diff line number Diff line change 8
8
import dev .restate .sdk .common .Serde ;
9
9
import dev .restate .sdk .common .TerminalException ;
10
10
import dev .restate .sdk .serde .jackson .JacksonSerdes ;
11
+ import dev .restate .sdk .springboot .RestateVirtualObject ;
11
12
import org .springframework .beans .factory .annotation .Autowired ;
12
13
import org .springframework .stereotype .Component ;
13
14
14
- @ Component
15
- @ VirtualObject
15
+ @ RestateVirtualObject
16
16
public class ProductService {
17
17
18
- @ Autowired private ProductRepository productRepository ;
18
+ private static final Serde < Product > productSerde = JacksonSerdes . of ( Product . class ) ;
19
19
20
- private Serde <Product > productSerde = JacksonSerdes .of (Product .class );
20
+ private final ProductRepository productRepository ;
21
+
22
+ public ProductService (ProductRepository productRepository ) {
23
+ this .productRepository = productRepository ;
24
+ }
21
25
22
26
@ Handler
23
27
public Product getProductInformation (ObjectContext ctx ) {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments