0

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.

  • are you updating tables with hibernate ? you can disable that https://stackoverflow.com/a/42147995/175554 spring.jpa.hibernate.ddl-auto = none – ozkanpakdil Aug 08 '23 at 20:42
  • no, the @JoinColumn is within an entity class that has a foreign key from another table. (e.g. course class have a field with @JoinColumn(name="id", referencedColumnName="id") ) Nothing done on the tables, just reading. – ragingpotato Aug 09 '23 at 03:47
  • can you provide https://stackoverflow.com/help/minimal-reproducible-example ? – ozkanpakdil Aug 09 '23 at 16:02

0 Answers0