Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 67320 invoked from network); 3 Aug 2006 15:53:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Aug 2006 15:53:22 -0000 Received: (qmail 95047 invoked by uid 500); 3 Aug 2006 15:53:19 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 95034 invoked by uid 500); 3 Aug 2006 15:53:18 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 95023 invoked by uid 99); 3 Aug 2006 15:53:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 08:53:18 -0700 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=HTML_MESSAGE,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (asf.osuosl.org: transitioning domain of clamey@localmatters.com does not designate 216.241.189.144 as permitted sender) Received: from [216.241.189.144] (HELO mailhost01.ad.corp.localmatters.com) (216.241.189.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 08:53:17 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6B714.85844A4A" Subject: RE: Abator / oracle pb with CHAR columns Date: Thu, 3 Aug 2006 09:50:19 -0600 Message-ID: <7A830B033BF360489B6EE305697CD09D17A373@mailhost01> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Abator / oracle pb with CHAR columns Thread-Index: Aca3ETZWfOSCiGlYSR6LUL/rodpClQAAXaZq References: <5633557.post@talk.nabble.com><5634205.post@talk.nabble.com> From: "Chris Lamey" To: , X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C6B714.85844A4A Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, Usually, CHARs indicate that you want the field filled out with = something meaningful and so doing magic padding by default seems like a = bad idea to me. Most folks don't want to increase the size of their DB = with useless data and CHAR forces space allocation. Personally, I'd = rather have the SQL fail if the model's property is null, generally = that's accepted to be an indication a logic error somewhere (at least = everywhere I've ever worked, except when you're trying to sneak = something past the DBAs). I guess having an option to turn on CHAR padding would be useful in some = corner cases, if it's off by default. It might be nice if it could be = at a per-column basis and/or a global one, but I think he wants global = here. Cheers, Chris -----Original Message----- From: Jeff Butler [mailto:jeffgbutler@gmail.com] Sent: Thu 8/3/2006 9:28 AM To: user-java@ibatis.apache.org Subject: Re: Abator / oracle pb with CHAR columns =20 Well there's no understanding of DBA opinions sometimes :) In Java (brute force): if (value !=3D null) { StringBuffer sb =3D new StringBuffer(value); while (sb.length() < 10) { sb.append(' '); } value =3D sb.toString(); } Since rpad is database specific, I don't think I should add it to = Abator. But I suppose I could add code like the above to the domain object = setter methods for CHAR fields - configurable with an option of course. What = do you think? Jeff Butler On 8/3/06, jeb001 wrote: > > > In order to be performant and light, my DBA prefers use CHAR type than > VARCHAR columns.. > > So, I have to set that 'rpad' explicitly for each columns.. > > Maybe Abator could set that 'rpad' for eahch Char column.. > > I don't know how to set that in Java code, do you ? > -- > View this message in context: > = http://www.nabble.com/Abator---oracle-pb-with-CHAR-columns-tf2045970.html= #a5634205 > Sent from the iBATIS - User - Java forum at Nabble.com. > > ------_=_NextPart_001_01C6B714.85844A4A Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: Abator / oracle pb with CHAR columns

Hello,

Usually, CHARs indicate that you want the field filled out with = something meaningful and so doing magic padding by default seems like a = bad idea to me.  Most folks don't want to increase the size of = their DB with useless data and CHAR forces space allocation.  = Personally, I'd rather have the SQL fail if the model's property is = null, generally that's accepted to be an indication a logic error = somewhere (at least everywhere I've ever worked, except when you're = trying to sneak something past the DBAs).

I guess having an option to turn on CHAR padding would be useful in some = corner cases, if it's off by default.  It might be nice if it could = be at a per-column basis and/or a global one, but I think he wants = global here.

Cheers,
Chris

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com] Sent: Thu 8/3/2006 9:28 AM
To: user-java@ibatis.apache.org
Subject: Re: Abator / oracle pb with CHAR columns

Well there's no understanding of DBA opinions sometimes :)

In Java (brute force):

if (value !=3D null) {
  StringBuffer sb =3D new StringBuffer(value);
  while (sb.length() < 10) {
    sb.append(' ');
  }
  value =3D sb.toString();
}

Since rpad is database specific, I don't think I should add it to = Abator.
But I suppose I could add code like the above to the domain object = setter
methods for CHAR fields - configurable with an option of course.  = What do
you think?

Jeff Butler





On 8/3/06, jeb001 <jeremy.jardin@gmail.com> wrote:
>
>
> In order to be performant and light, my DBA prefers use CHAR type = than
> VARCHAR columns..
>
> So, I have to set that 'rpad' explicitly for each columns..
>
> Maybe Abator could set that 'rpad' for eahch Char column..
>
> I don't know how to set that in Java code, do you ?
> --
> View this message in context:
> http://www.nabble.com/Abator---oracle-pb-with-CHAR-col= umns-tf2045970.html#a5634205
> Sent from the iBATIS - User - Java forum at Nabble.com.
>
>

------_=_NextPart_001_01C6B714.85844A4A--