Java Spring @JoinColumn with nvarchar and numeric Spring 3

47 Views Asked by At

I am trying to update a service from Spring 2 to Spring 3.

Before, the @JoinColumn(name = "an_nvarchar_col", referencedColumnName = "a_numeric_col") is working fine in Spring 2.x.x.

Now updated to Spring 3.x.x, it throws an error

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: An error occurred during the current command (Done status 0). Error converting data type nvarchar to numeric.

Question: Is there a way to use JoinColumn with different data types without re-designing the table or creating a view? (This is a last resort)

Thanks

Removed the referencedColumnName option from @JoinColumn but it is not joining properly.

0

There are 0 best solutions below