-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
52 lines (38 loc) · 925 Bytes
/
App.java
File metadata and controls
52 lines (38 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.app;
import java.util.List;
import java.util.UUID;
import com.app.person.DataAccess;
import com.app.person.Model;
import com.jk.core.util.JK;
public class App {
private static String id;
public static void main(String[] args) {
DataAccess da = new DataAccess();
add(da);
find(da);
update(da);
getModelList(da);
delete(da);
}
public static void add(DataAccess da) {
Model model=new Model();
id = UUID.randomUUID().toString();
model.setId(id);
da.insert(model);
}
public static void update(DataAccess da) {
Model model = find(da);
da.update(model);
}
public static Model find(DataAccess da) {
Model model = da.find(Model.class, id);
return model;
}
public static void delete(DataAccess da) {
da.delete(find(da));
}
public static void getModelList(DataAccess da) {
List<Model> modelList = da.getList(Model.class);
JK.print("List", modelList);
}
}