postgresql 主键自增,以及mybaits 逆向生成

1、postgresql  主键自增

表 event start with  设置起始值

CREATE SEQUENCE event_id_seq  
START WITH 1  
INCREMENT BY 1  
NO MINVALUE  
NO MAXVALUE  
CACHE 1;  
  
alter table event alter column id set default nextval('event_id_seq');  

2、使用mybaits 逆向生成postgresql 代码

postgresql驱动:postgresql-9.2-1003-jdbc4.jar

<jdbcConnection driverClass="org.postgresql.Driver"
                        connectionURL="jdbc:postgresql://l-***.com:5433/crm"
                        userId="menpiao_dev" password="d**904-8dce-**d0-bb1b-79***cc">
 </jdbcConnection>

3、eclipse maven工程中src/main/resources目录下创建的文件夹是包图标

原文地址:https://www.cnblogs.com/lyon91/p/8436419.html