File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
src/main/java/org/jnosql/demoee Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change 3
3
import jakarta .nosql .Column ;
4
4
import jakarta .nosql .Entity ;
5
5
import jakarta .nosql .Id ;
6
+ import net .datafaker .Faker ;
6
7
7
8
import java .time .LocalDate ;
8
9
import java .util .Objects ;
11
12
@ Entity
12
13
public record Camera (
13
14
@ Id String id ,
14
- @ Column String name ,
15
- @ Column LocalDate birthday
15
+ @ Column String brand ,
16
+ @ Column String model ,
17
+ @ Column String brandWithModel
16
18
) {
17
19
18
- public static Camera newDeveloper (String name , LocalDate birthday ) {
19
- Objects .requireNonNull (name , "name is required" );
20
- Objects .requireNonNull (birthday , "birthday is required" );
21
- return new Camera (
22
- UUID .randomUUID ().toString (),
23
- name ,
24
- birthday );
20
+ public static Camera of (Faker faker ) {
21
+ String brand = faker .camera ().brand ();
22
+ String model = faker .camera ().model ();
23
+ String brandWithModel = faker .camera ().brandWithModel ();
24
+ return new Camera (UUID .randomUUID ().toString (), brand , model , brandWithModel );
25
25
}
26
-
27
- public Camera update (String name , LocalDate birthday ) {
28
- Objects .requireNonNull (name , "name is required" );
29
- Objects .requireNonNull (birthday , "birthday is required" );
30
- return new Camera (
31
- this .id (),
32
- name ,
33
- birthday );
34
- }
35
- }
26
+ }
You can’t perform that action at this time.
0 commit comments