hi,

why bother with this stuff in the first place? you'll get an exception by 
the jdbc driver anyway. what else could you do but throw an exception if 
you realize that the value exceeds some limit. would you always truncate? 
would you like to configure if it truncates or throws an exception? IMHO 
the client app should take care of things like that instead of bloating 
entity beans (or their wrappers) with stuff like that. you'll always have 
the responsibility to be aware of the database model when working with 
entity beans on top of a RDBMS in real life.

just my 2c,

robert



At 08:16 14.04.00 , Barry Fujii wrote:
>Why not put these sizes in JNDI and check them in the set*() methods? Thats
>another option.
>
>Barry
>
> > -----Original Message-----
> > From: Thomas Munro [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 14, 2000 2:26 AM
> > To: Barry Fujii
> > Cc: [EMAIL PROTECTED]
> > Subject: Datatype size restrictions
> >
> >
> > Barry
> >
> > Yeah I've created all the Oracle tables myself, using VARCHAR(n) with
> > sizes that seemed sensible.
> >
> > One thing that bothers me is that I can't really see how to control the
> > size of the String 'declaratively'.  I was thinking of maybe making a
> > datatypes.properties file, which would specify the max size of all the
> > Strings, and then make the bean check those lengths in the setXXX()
> > methods.  Then I suppose I should through an exception if it's too long.
> >
> > Any comments on that approach, Barry, anybody?
> >
> > Thomas Munro
> > Software Engineer
> > Grey Interactive Paris
> >
> >
>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de


Reply via email to