Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create (or find) a Hibernate dialect override to support unicode in SQL Server #305

Open
amcclain opened this issue Aug 4, 2023 · 0 comments

Comments

@amcclain
Copy link
Member

amcclain commented Aug 4, 2023

SQL server needs to use the nvarchar() type to support unicode content. On a related note, nvarchar(max) is the current unicode-ready replacement for text.

However the default GORM Hibernate mappings, even when using the latest org.hibernate.dialect.SQLServer2016Dialect still use the non-unicode compatible varchar and text types.

You can work around this on a per-field basis, i.e. with this mapping for a Comment class where we want the body field to support arbitrarily long strings of unicode text:

static mapping = {
        table name: 'comment', schema: 'dbo'
        body type: 'text', sqlType: 'nvarchar(max)'
        cache true
    }

But it would be great if we could include a Hibernate dialect within Hoist that a dev could specify to get unicode-by-default out of the box for string fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant