[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3965) Expose the ability to use varchar(max) or nvarchar(max)

Flavio Donzé (JIRA) noreply at atlassian.com
Tue Nov 24 10:13:10 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34751#action_34751 ] 

Flavio Donzé commented on HHH-3965:
-----------------------------------

Don't forget the lines for nvarchar:

registerColumnType(Types.NVARCHAR, "nvarchar(max)");
registerColumnType(Types.NVARCHAR, 4000, "nvarchar($l)");

Use nvarchar(SIZE) for all fields up to a length of 4000, everything above should use nvarchar(max).

Here a good link about this topic:
http://www.sql-server-helper.com/sql-server-2005/..%5Cfaq%5Csql-server-2005-varchar-max-p01.aspx


> Expose the ability to use varchar(max) or nvarchar(max)
> -------------------------------------------------------
>
>                 Key: HHH-3965
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3965
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.1
>         Environment: Hibernate 3.4.0GA as provider for JPA 1.0 - SQL Server 2005 Database
>            Reporter: Ido Ran
>            Priority: Blocker
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> I have an entity which needs to store long text field (at least 30,000 characters).
> I use SQL Server 2005 as back-end database.
> SQL Server varchar support up-to 8,000 characters in length of a field, or the reserved word MAX which indicate that the field length will be 2^31-1.
> I think that the class SQLServerDialect should be changed to have the following line in it's ctor:
> registerColumnType( Types.VARCHAR, 8001, "varchar(MAX)" );
> this way, all String fields with length above 8000 will have varchar(MAX) as column type.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list