jpa 多对多关系中的错误列类型
Wrong column type in jpa many to many relationship
我有以下多对多关系
@ManyToMany
@JoinTable(
name="response"
, joinColumns={
@JoinColumn(name="id_response", referencedColumnName="id_response")
}
, inverseJoinColumns={
@JoinColumn(name="id_request")
}
)
private List<Transaction> transactions;
我得到以下异常:
Wrong column type in response for column id_response. Found: varchar, expected: integer
是否可以向@JoinColumn 添加一个参数来明确地告诉它是一个字符串值?
还有其他解决方案吗?
我发现了我的错误:错误的类型是因为我的数据库中的字段类型。
我有以下多对多关系
@ManyToMany
@JoinTable(
name="response"
, joinColumns={
@JoinColumn(name="id_response", referencedColumnName="id_response")
}
, inverseJoinColumns={
@JoinColumn(name="id_request")
}
)
private List<Transaction> transactions;
我得到以下异常:
Wrong column type in response for column id_response. Found: varchar, expected: integer
是否可以向@JoinColumn 添加一个参数来明确地告诉它是一个字符串值? 还有其他解决方案吗?
我发现了我的错误:错误的类型是因为我的数据库中的字段类型。