1. increment标识符生成器
Hibernate: select max(ID) from CUSTOMER Hibernate: insert into CUSTOMER (NAME, PHONE, MARRIED, ID) values (?, ?, ?, ?)
'CREATE TABLE `customer` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, // !!! `NAME` varchar(255) DEFAULT NULL, `EMAIL` varchar(255) DEFAULT NULL, `PASSWORD` varchar(255) DEFAULT NULL, `PHONE` int(11) DEFAULT NULL, `MARRIED` bit(1) DEFAULT NULL, `ADDRESS` varchar(255) DEFAULT NULL, `SEX` char(1) DEFAULT NULL, `DESCRIPTION` longtext, `IMAGE` tinyblob, `BIRTHDAY` date DEFAULT NULL, `REGISTEREDTIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`ID`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8'
Hibernate: insert into CUSTOMER (NAME, PHONE, MARRIED) values (?, ?, ?) Hibernate: select last_insert_id()
'CREATE TABLE `hibernate_unique_key` ( `next_hi` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8'
Hibernate: select next_hi from hibernate_unique_key for update Hibernate: update hibernate_unique_key set next_hi = ? where next_hi = ? Hibernate: insert into CUSTOMER (NAME, PHONE, MARRIED, ID) values (?, ?, ?, ?)