File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/main/java/guru/springframework/domain Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
package guru .springframework .domain ;
2
2
3
- import javax .persistence .Entity ;
4
- import javax .persistence .GeneratedValue ;
5
- import javax .persistence .GenerationType ;
6
- import javax .persistence .Id ;
3
+ import javax .persistence .*;
7
4
import java .math .BigDecimal ;
8
5
9
6
/**
@@ -15,6 +12,10 @@ public class Product implements DomainObject{
15
12
@ Id
16
13
@ GeneratedValue (strategy = GenerationType .AUTO )
17
14
private Integer id ;
15
+
16
+ @ Version
17
+ private Integer version ;
18
+
18
19
private String description ;
19
20
private BigDecimal price ;
20
21
private String imageUrl ;
@@ -27,6 +28,14 @@ public void setId(Integer id) {
27
28
this .id = id ;
28
29
}
29
30
31
+ public Integer getVersion () {
32
+ return version ;
33
+ }
34
+
35
+ public void setVersion (Integer version ) {
36
+ this .version = version ;
37
+ }
38
+
30
39
public String getDescription () {
31
40
return description ;
32
41
}
You can’t perform that action at this time.
0 commit comments