You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Federico Fissore <fe...@concept.it> on 2007/05/22 16:02:01 UTC

Automatic text length check and truncation

I couldn't find an answer about my issue in the archive so here it is:

as I'm lazy ;) I would like the generated bean to check for the length
of the, say, String I'm setting, eventually truncating it

Is there some flag somewhere or I do have to implement it by myself?

thank you

federico

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


Re: Automatic text length check and truncation

Posted by Thomas Vandahl <tv...@apache.org>.
Federico Fissore wrote:
> I couldn't find an answer about my issue in the archive so here it is:
> 
> as I'm lazy ;) I would like the generated bean to check for the length
> of the, say, String I'm setting, eventually truncating it

Depending on the database you use, it will probably do the truncation
itself. MySQL does. (I consider this a bug, actually)

Bye, Thomas.

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


Re: Automatic text length check and truncation

Posted by Federico Fissore <fe...@concept.it>.
to anyone interested in some hacking, attached is the mod I've made to
ExtensionObject.vm

It's dirty, probably, but I'm not a velocity expert and it seems to work
well

Antwort: Automatic text length check and truncation

Posted by Thomas Fischer <fi...@seitenbau.net>.
I do not think it is implemented.
Are you sure you want truncation to be the default behaviour ? I'd rather
throw an IllegalArgumentException if the String is too long. But this
depends on the application, of course.

     Thomas

Federico Fissore <fe...@concept.it> schrieb am 22.05.2007
16:02:01:

> I couldn't find an answer about my issue in the archive so here it is:
>
> as I'm lazy ;) I would like the generated bean to check for the length
> of the, say, String I'm setting, eventually truncating it
>
> Is there some flag somewhere or I do have to implement it by myself?
>
> thank you
>
> federico
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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