1).首先通过SQL更改MYSQL库中的表结构(下面是一些例子)
ALTER TABLE `illegalactivate` ADD `macethaddress` varchar(250) NOT NULL;
Alter TABLE `illegalactivate` drop primary key;
ALTER TABLE `illegalactivate` ADD CONSTRAINT PK_illegalactivate PRIMARY KEY (` macaddress`,`macethaddress`,`productid`);
ALTER TABLE `legalactivate` ADD `macethaddress` varchar(250) NOT NULL;
Alter TABLE `legalactivate` drop primary key;
ALTER TABLE `legalactivate` ADD CONSTRAINT PK_legalactivate PRIMARY KEY (`macaddress`,`macethaddress`,`productsid`);
2).
将Vendor.hbm.xml 删除
3).
Database URL 中填applicationContext.xml连接数据库用的URL
package要选上一级目录,这里即com.active.orm
4).
报错:org.springframework.beans.factory.BeanCreationException
注意:要把sequence改成indentity