You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Martin Kalén <mk...@apache.org> on 2005/04/01 08:48:44 UTC

Re: I18n and Oracle9

Vadim Gritsenko wrote:
> As you might know, in default Oracle install,
> 
>     VALUE VARCHAR(20)
> 
> actually means 20 *bytes*, not 20 characters. So for i18n applications 
> this means that actual limit is closer to 10 or less characters - 
> depending on encoding. Since Oracle9 it's possible to specify that when 
> you create a character field of specified length you actually *do* mean 
> that this length is in characters, not bytes! New syntax is:
> 
>     VALUE VARCHAR(20 CHAR)
> 
> Alternatively, one can use NVARCHAR, which is (AFAIU) will always use 
> UTF-16 encoding and length is always in characters, not bytes.
> 
> Questions,
> 
>   * Is there a way to instruct torque to create schema using above syntax?

To my knowledge, Torque does not have switchable syntax like this. You should
really ask Thomas Fisher and the others over at torque-dev or torque-user,
since I'm not a Torque expert.

>   * Is there a way to instruct torque to use nvarchar instead of varchar?

As we've seen in OJB 1.0.2, it's possible to patch Torque templates to
accomplish this. But that's a really ugly solution IMO and just a temporary
work-around for the outdated Torque in 1.0.x branch.

Any Torque changes should be brought up for discussion with the Torque
developers and integrated in their trunk.

I felt really "dirty" when starting the patching bussiness here, that is
not what I consider a clean open source-move. If it would have been the
latest Torque we would not have done it, but would have submitted patches
to torque-dev instead.

>   * Should OJB default to creating schema with length in characters instead
>     of creating schema with length in bytes?

Don't think this is a good idea, since I think most users coming from the
"RBDMS-world" will expect bytes as usual with CHAR. However, with OJB I might
be wrong and people might be more "Java-world" centered and expect Java
Character behaviour. I guess this should be polled on the user list to get
an impression from the user base.


OJB is moving away from Torque to the new DB Apache Project "DdlUtils", which
is Jakarta Commons-SQL moved out of the Jakarta Sandbox. The long-term plan
is that both Torque and OJB will us DdlUtils for SQL-generation.

Tom has more info on this.

Directly to Tom: Is it possible to switch the generated default datatype in
DdlUtils? Eg could Vadim's wish of NVARCHAR instead of CHAR be accomplished
through property-changes or similar?

Regards,
  Martin

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


Re: I18n and Oracle9

Posted by Martin Kalén <mk...@apache.org>.
Vadim Gritsenko wrote:
>> Any thoughts on a generic approach for DdlUtils, Vadim?
> 
> Can you point me to the place where ddlutils code lives now?

It is currently in the Jakarta Commons Sandbox CVS as "Commons SQL" [1],
but under migration to db.apache.org and SVN.

According to Tom the migration should be completed shortly
(he will announce it here on ojb-dev when done).

Regards,
  Martin

[1] http://jakarta.apache.org/commons/sandbox/sql/

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


Re: I18n and Oracle9

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Martin Kalén wrote:
> 
> Any thoughts on a generic approach for DdlUtils, Vadim?

Can you point me to the place where ddlutils code lives now?

Vadim


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


Re: I18n and Oracle9

Posted by Thomas Dudziak <to...@gmail.com>.
On Apr 1, 2005 12:59 PM, Martin Kalén <mk...@apache.org> wrote:
> Thomas Dudziak wrote:
> >>Directly to Tom: Is it possible to switch the generated default datatype in
> >>DdlUtils? Eg could Vadim's wish of NVARCHAR instead of CHAR be accomplished
> >>through property-changes or similar?
> >
> > Not right now, but this can be easily accomplished, though we might
> > opt for a generic solution for databases that support this (e.g. a
> > charset = ASCII | UNICODE attribute or something similar).
> 
> OK. I think we can summarize with: "no, not in OJB 1.0.x" and
> "it would be possible, but is not implemented in OJB 1.1 + DdlUtils".

No I think the latter is easily doable as the change is minimal in DdlUtils.

> Any thoughts on a generic approach for DdlUtils, Vadim?
> 
> > You can add this yourself, you'll be on the initial committers list
> > for DdlUtils ;-)
> 
> Good, that makes it one iteration less. :)

Indeed ;-)

> I assume you will announce completed project migration here on ojb-dev too?

Yep, actually the website is already up, and the SVN migration and the
mailing lists are in the works.

Tom

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


Re: I18n and Oracle9

Posted by Martin Kalén <mk...@apache.org>.
Thomas Dudziak wrote:
>>Directly to Tom: Is it possible to switch the generated default datatype in
>>DdlUtils? Eg could Vadim's wish of NVARCHAR instead of CHAR be accomplished
>>through property-changes or similar?
> 
> Not right now, but this can be easily accomplished, though we might
> opt for a generic solution for databases that support this (e.g. a
> charset = ASCII | UNICODE attribute or something similar).

OK. I think we can summarize with: "no, not in OJB 1.0.x" and
"it would be possible, but is not implemented in OJB 1.1 + DdlUtils".

Any thoughts on a generic approach for DdlUtils, Vadim?

> You can add this yourself, you'll be on the initial committers list
> for DdlUtils ;-)

Good, that makes it one iteration less. :)

I assume you will announce completed project migration here on ojb-dev too?

Cheers,
  Martin

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


Re: I18n and Oracle9

Posted by Thomas Dudziak <to...@gmail.com>.
> Directly to Tom: Is it possible to switch the generated default datatype in
> DdlUtils? Eg could Vadim's wish of NVARCHAR instead of CHAR be accomplished
> through property-changes or similar?

Not right now, but this can be easily accomplished, though we might
opt for a generic solution for databases that support this (e.g. a
charset = ASCII | UNICODE attribute or something similar).
You can add this yourself, you'll be on the initial committers list
for DdlUtils ;-)

Tom

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