Hi,
I have a problem with a foreign key. I have two entities: Request and ReqCost (both of them extend BaseIntIdentityIdEntity).
The ReqCost is supposed to contain a many-to-one column that references the request id.
Inside my ReqCost entity class I declared this:
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "request_id", referencedColumnName = "id")
protected Request request_id;
When I try to update the database with the new scripts generated, I get this error:
Task 'updateDb' failed
com.microsoft.sqlserver.jdbc.SQLServerException: Column 'MAINTAPP_REQUEST.ID' is not the same data type as referencing column 'MAINTAPP_REQ_COST.REQUEST_ID' in foreign key 'FK_MAINTAPP_REQ_COST_REQUEST'.
Note: I don’t override any of the base id attributes.
In the documentation it says that the base identity id is of type IdProxy but how can I reference it from another entity ?
Thanks.