ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Maves" <nathan.ma...@gmail.com>
Subject Re: Configure Ibatis to Auto-Truncate Property length when Insert to Database?
Date Fri, 22 Sep 2006 21:37:49 GMT
you could also do it via your sql

insert into TABLE (COL1, ...
values (
SUBSTR(#property1:NUMERIC#, 0, 25)
SUBSTR(#property2:VARCHAR#, 0, 30)
SUBSTR(#property3:VARCHAR#, 0, 30)

On 9/22/06, Larry Meadors <lmeadors@apache.org> wrote:
> I'd do it in a getter.
>
> Larry
>
>
> On 9/22/06, Mississippi John Hurt <johnhurt@gmail.com> wrote:
> > Is there a way to easily configure the mapping xml to automatically truncate
> > any properties to set lengths before inserting into the database?  That
> > could be a nice feature. It could be like...
> >
> > insert into TABLE (COL1, ...
> > values (
> > #property1:NUMERIC#
> > #property2:VARCHAR:maxsize#
> > #property3:VARCHAR:maxsize2#
> >
> > Is this possible?  How do you easily do this if not?
> >
>

Mime
View raw message