These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: using SQL Server 2008 types with Hibernate
PostPosted: Tue Sep 22, 2009 6:06 am 
Newbie

Joined: Tue Sep 22, 2009 6:00 am
Posts: 1
Hi all,

I have a database table where I use types nvarchar(n); nvarchar(max), date... When i do a select query I get the error:
Code:
No Dialect mapping for JDBC type: -16


I tried to extend the class SQLServerDialect with this code:
Code:
public class SQLServerNativeDialect extends SQLServerDialect{

  public SQLServerNativeDialect() {
    super();
    registerColumnType(Types.NVARCHAR, "nvarchar($l)");
    registerColumnType(Types.CHAR, "nchar(1)");
    registerColumnType(Types.NVARCHAR, "nvarchar(max)");
//    registerColumnType(Types.NVARCHAR, "nvarchar($l)");
//    registerColumnType(Types.CHAR, "nchar(1)");
//    registerColumnType(Types.NVARCHAR, "nvarchar(max)");

  }
 
}


Is there somebody using a custom sql server dialect class that works or a solution for my problem?

thank you,

Said


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.