我已经定义了一个具有“java.util.UUID”作为其“Id”字段的域类。
@Entity
class Response{
@Id
@GeneratedValue(generator = "myUUIDGenerator")
@GenericGenerator(name = "myUUIDGenerator", strategy = "uuid2")
@Column(columnDefinition = "uuid")
private UUID id;
...
}
我正在使用 liquibase 生成数据库。
<createTable tableName="response">
<column name="id" type="uuid">
<constraints primaryKey="true" nullable="false"/>
</column>
</createTable>
MySQL 中生成的表将生成的 id 列描述为“char(36)”。
运行测试用例时出现问题。它说以下内容并且没有执行任何测试用例。
Wrong column type in DBNAME_response for column id. Found: char, expected: uuid