在前一篇文章中结束了要使用数据库时的配置,接下来便是使用数据库了。
新建数据库类:
复制代码
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91package nutz.xyh.entity; import org.nutz.dao.entity.annotation.Column; import org.nutz.dao.entity.annotation.Id; import org.nutz.dao.entity.annotation.Name; import org.nutz.dao.entity.annotation.Table; @Table("application") public class Application { @Id private int id; @Name @Column private String personid; @Column private String personname; @Column private String appitemname; @Column private String itempalce; @Column private String itemtime; @Column private String personskill; @Column private String itemtelephone; @Column private String itememail; @Column private int progress; public String getPersonskill() { return personskill; } public void setPersonskill(String personskill) { this.personskill = personskill; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getPersonid() { return personid; } public void setPersonid(String personid) { this.personid = personid; } public String getPersonname() { return personname; } public void setPersonname(String personname) { this.personname = personname; } public String getAppitemname() { return appitemname; } public void setAppitemname(String appitemname) { this.appitemname = appitemname; } public String getItempalce() { return itempalce; } public void setItempalce(String itempalce) { this.itempalce = itempalce; } public String getItemtime() { return itemtime; } public void setItemtime(String itemtime) { this.itemtime = itemtime; } public String getItemtelephone() { return itemtelephone; } public void setItemtelephone(String itemtelephone) { this.itemtelephone = itemtelephone; } public String getItememail() { return itememail; } public void setItememail(String itememail) { this.itememail = itememail; } public int getProgress() { return progress; } public void setProgress(int progress) { this.progress = progress; } }
在上面代码中使用的注释说明:
@Table("数据库名")
@Id //这是数据库的数字类型的主键
@Name //这是数据库的字符类型的主键
@Column //属性名
新建数据库类结束
在错误中不断进步
最后
以上就是美满银耳汤最近收集整理的关于对于nutz框架的学习入门级使用——数据库类的建立的全部内容,更多相关对于nutz框架内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复