Currently, OpenJPA maps String fields to VARCHAR on SQLServer and Sybase. There doesn't appear to be a way to cause a String field to be mapped to NVARCHAR other than by using the @Column annotation and settings its columnDefinition to "NVARCHAR". At the same time, blindly using NVARCHAR for all String fields is too costly in terms of storage space on the database. It ends up limiting the maximum size of the column (less characters can fit because more bytes are used to store them).
Unfortunately, the applications we write are required to be database neutral because we support multiple vendors. I'd like to start a discussion on this matter. Here are a couple of points to lead us off... What's the severity of this missing functionality? Could an OpenJPA specific annotation be introduced to allow the mapping tool to use NVARCHAR instead of VARCHAR?. Marc Boudreau Software Developer IBM Cognos Content Manager [email protected] Phone: 613-356-6412
