1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
epp/docs/ChatGPT/转换为POJO对象.md

39 lines
1.3 KiB
Markdown
Raw Normal View History

请帮我将以下表转换为Java POJO对象不需要getter和setter
CREATE TABLE `goods_order_details` (
`order_detail_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单详情ID',
`order_id` int(11) NOT NULL COMMENT '订单ID',
`product_id` int(11) NOT NULL COMMENT '商品ID',
`product_quantity` int(11) NOT NULL COMMENT '商品数量',
PRIMARY KEY (`order_detail_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
CREATE TABLE `orders` (
`order_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单ID',
`user_id` int(11) NOT NULL COMMENT '用户ID',
`order_date` date NOT NULL COMMENT '订单日期',
`order_status` enum('Pending','Processing','Shipped','Delivered','Cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单状态',
PRIMARY KEY (`order_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
例如Good的对象为
@Data
public class Good {
Long id;
String goodsName;
Integer categoryId;
String brand;
String gallery;
String brief;
Boolean isOnSale;
String picUrl;
Integer type;
String unit;
Double counterPrice;
Double retailPrice;
String detail;
Boolean deleted;
}