Eclipse Dali (STS) + Hibernate MSSQL nvarchar maps to object

384 Views Asked by At

Environment: STS (version 3.6.4 currently, but happens in prior versions as well) Hibernate 4.2.16 as JPA provider MSSQL 12.0 database

When utilizing standard Eclipse tooling (Dali) for generating JPA entities, nvarchar types map up to a type of Object (instead of the intended String). Varchar types map as desired (String).

Is this an expected behavior? If so, why would anyone WANT a column of character text to map to an Object type? I completely understand you can manually change it through the wizard (or in the code), but having it generate as intended by default would be desirable (we have hundreds of tables, if not more and is quite error prone to remember to switch these).

Any help is appreciated.

Update: To add to this, the "Data Source Explorer" also does NOT show a data type attached to this column (shows nullability, but doesn't show a data type). Appears Eclipse doesn't know what it is. Driver class being used in my data connection is: com.microsoft.sqlserver.jdbc.SQLServerDriver. Maybe driver related? Anyone ever seen this?

0

There are 0 best solutions below