说明:MyCAT自增长主键和返回生成主键ID的实现 1) mysql本身对非自增长主键,使用last_insert_id()是不会返回结果的,只会返回0:这里做一个简单的测试 创建测试表 -------------------------------------- --创建测试表 ------------------------------------- USE test; CREATE TABLE IF NOT EXISTS t_auto_increment ( id INT NOT NULL
先说一下没有注解的 先给出实体类: public class City { private int city_id; private String city_name; public int getCity_id() { return city_id; } public void setCity_id(int city_id) { this.city_id = city_id; } public String getCity_name() { return city_name; } public