我想要一个不定式主键,那就是BigInteger.
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-type-conversions.html
BIGINT[(M)] [UNSIGNED] BIGINT [UNSIGNED] java.lang.Long, if UNSIGNED java.math.BigInteger
所以我创建了我的entity
public class Alarm {
// ID
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private BigInteger id;
当我创建表时,出现以下错误。
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table alarm (id decimal(19,2) not null auto_increment, frequencyp0p1p2 integer not null, frequencyp3p7p8 integer not null, frequencyp4 integer not null, frequencyp6p5 integer not null, port_description varchar(255), primary key (id)) engine=MyISAM" via JDBC Statement
Caused by: java.sql.SQLSyntaxErrorException: Incorrect column specifier for column 'id'
那么这里出了什么问题呢?