db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Hilka" <thi...@vps.de>
Subject AW: SQL Server 2005 - varchar(max)
Date Mon, 17 Nov 2008 09:38:21 GMT

we actually use NVARCHAR columns of SQL Server 2005.
We wrote our own platform generator which maps VARCHAR columns in the
schema-xml to NVARCHAR columns in the database. Works fine.

There is only one issue with this: We had to adjust the SQL statements
generated by SQLExpression to add an 'N' in front of every unicode value.

I think I opened an issue for this in JIRA some time ago.

@Torque developers: Is there any reason why the data type mapping has to be
done in a java file, in older version there was some kind of text file in
which you can specify the mapping. We always have to add our changes to your
code if a new version comes out.

-----Urspr√ľngliche Nachricht-----
Von: Greg Monroe [mailto:monroe@dukece.com] 
Gesendet: Freitag, 14. November 2008 18:14
An: 'Apache Torque Users List'
Betreff: RE: SQL Server 2005 - varchar(max)

First, just a general Torque design principal review... Torque
tries to let you create code that is independent of the type
of SQL server you are using (while remaining flexible enough
to let you access specific server features.  When it comes to
things like basic column type support, we follow the SQL
standards as to what Torque supports.  So, if the standard
defines an NVARCHAR column type, then we will try to support
it across all servers we support.

That said, there are actually two parts to this request, using
these type of columns in the runtime and generating the SQL
statements to create the tables.

In the runtime area, I'm pretty sure we already support these
columns.  If your schema XML says VARCHAR, then the Torque code is
using String at the storage type with is Unicode compliant. Torque
and Village ultimate set and store these fields via JDBC calls, like
getString(column), and the like.  The JDBC driver should handle the
conversion of the information returned by the SQL server to the
correct Java value.  So, an NVARCHAR column with Unicode will be
mapped directly to a Unicode String with no problems.

As to generating SQL with NVarchar column, as I said above, if this
is  part of the standard, we'll add a column type to the schema.

However, if you have a need to do this, it's not hard to create
your own generator Platform implementation that uses NVARCHAR
when you specify VARCHAR in the XML.

Hope makes sense.  If not feel free to ask for clarification.

> -----Original Message-----
> From: jbowman [mailto:jbowman@coemergence.com]
> Sent: Friday, November 14, 2008 10:28 AM
> To: torque-user@db.apache.org
> Subject: SQL Server 2005 - varchar(max)
> Hi All,
> I'm new to the list so please bear with me if this question has been
> previously discussed.
> Is there any version of Torque that supports any of the "new" SQL Server
> 2005 column specification changes, specifically:
> NVARCHAR(max)?
> The MSDN documentation defines it as:
> "Variable-length Unicode character data. n can be a value from 1 through
> 4,000. max indicates that the maximum storage size is 2^31-1 bytes. The
> storage size, in bytes, is two times the number of characters entered + 2
> bytes. The data entered can be 0 characters in length."
> If not, are there any plans in the works to support such SQL Server 2005
> changes?
> John
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org

DukeCE Privacy Statement:
Please be advised that this e-mail and any files transmitted with
it are confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity
to whom they are addressed. If you are not the intended recipient
you may not rely on the contents of this email or any attachments,
and we ask that you please not read, copy or retransmit this
communication, but reply to the sender and destroy the email, its
contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is
strictly prohibited.

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message