public class Notice { private int id; private String title; private String name; private String content; private String createtime; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getCreatetime() { return createtime; } public void setCreatetime(String createtime) { this.createtime = createtime; } public Notice(int id, String title, String name, String content, String createtime) { super(); this.id = id; this.title = title; this.name = name; this.content = content; this.createtime = createtime; } public Notice() { super(); // TODO Auto-generated constructor stub } }
时间: 2024-03-04 20:53:23 浏览: 262
这是一个 Java 类,名为 Notice,它具有五个私有属性,分别是 id、title、name、content 和 createtime。它还具有五个公有方法,分别是 getId、setId、getTitle、setTitle、getName、setName、getContent、setContent、getCreatetime 和 setCreatetime。其中,set 方法用于设置私有属性的值,get 方法用于获取私有属性的值。此外,还有两个构造方法,一个是带参数的构造方法,一个是无参构造方法。这个类可能用于存储通知的信息。
相关问题
通过下面类给我生成建表语句 @TableName("mention") public class Mention { @TableId(value = "id", type = IdType.AUTO) private Integer id; private Integer fromId; private Integer toId; private String title; private String description; private String content; private Date time; private Integer status; private Integer typeId; private Integer pid; private Date createTime; private Date updateTime; //删除标志(0代表未删除,1代表已删除) private Integer delFlag; } @TableName("message") public class Message { @TableId(value = "id", type = IdType.AUTO) private Integer id; private Integer toId; private String message; private Date time; private Integer typeId; //代表是否被读 private Integer status; private Date createTime; private Date updateTime; //删除标志(0代表未删除,1代表已删除) private Integer delFlag; }
下面是Mention和Message类对应的建表语句:
CREATE TABLE mention (
id INT AUTO_INCREMENT PRIMARY KEY,
fromId INT NOT NULL,
toId INT NOT NULL,
title VARCHAR(255),
description VARCHAR(255),
content TEXT,
time DATETIME,
status INT NOT NULL,
typeId INT NOT NULL,
pid INT,
createTime DATETIME,
updateTime DATETIME,
delFlag INT NOT NULL
);
CREATE TABLE message (
id INT AUTO_INCREMENT PRIMARY KEY,
toId INT NOT NULL,
message TEXT,
time DATETIME,
typeId INT NOT NULL,
status INT NOT NULL,
createTime DATETIME,
updateTime DATETIME,
delFlag INT NOT NULL
);
根据下面类生成数据库建表语句 @TableName("type") public class Type { @TableId(value = "id", type = IdType.AUTO) private Integer id; private String name; private String description; @TableField(exist = false) private Integer type_num; } @TableName("user") public class User { @TableId(value = "id", type = IdType.AUTO) private Integer id; private String username; private String password; private String salt; private String email; //头像 private String avatar; //个人介绍 private String privateInfo; private Integer sex; //1代表正常,0代表异常 private Integer status; private Date createTime; private Date updateTime; //删除标志(0代表未删除,1代表已删除) private Integer delFlag; @TableField(exist = false) private Profile profile; }
CREATE TABLE `type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`type_num` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`salt` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`privateInfo` varchar(255) DEFAULT NULL,
`sex` int(11) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
`updateTime` datetime DEFAULT NULL,
`delFlag` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
);
阅读全文