0

我在 Eclipse Mars 中使用JPA 工具生成实体类。它生成整数数据类型的数据成员,该数据类型是表中的小整数类型。我需要为表中的小整数类型的生成类型的数据类型。

4

2 回答 2

4

我认为这样的事情可能会起作用:-

@Column(columnDefinition = "SMALLINT")
@Type(type = "org.hibernate.type.ShortType")
private short variableName;
于 2015-08-11T11:46:07.830 回答
1

在选择 table->table Association->Customize Defaults->customize indicidual Entities 后从表向导中输入 JPA 实体 .. 在这里您可以自定义您的表

但通常它会自动将 smallint 类型转换为 short 类型。

在此处输入图像描述

于 2015-08-11T12:15:10.340 回答