📄 productsbean.java
字号:
package model;import java.util.*;public class ProductsBean { private List<Product> list = null; private boolean listCurrent = false; public List<Product> findAll() throws Exception { System.out.println("getList"); if (list == null || !listCurrent) { list = Products.findAll(); listCurrent = true; } return list; } public void createTable() throws Exception { Products.createTable(); listCurrent = false; } public void create(Product p) throws Exception { Products.create(p); listCurrent = false; } public Product find(int id) throws Exception { System.out.println("getBook"); return Products.find(id); } public void updateRecord(int id, String price) throws Exception { Products.updateRecord(id, price); listCurrent = false; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -