Any idea on how the lengths of fields are handled when creating or updating a row.
For example consider my table has a column
USERNAME CHAR(8)
The bean object created has the set method say
setUSERNAME(String newval) which doesnot validate the length. So if code accessing this method updates the field to a 10 or 20 character string, how is it handled.
is it truncated while being updated to the row
is an exception thrown by the driver
is it handled somewhere in the code that i havenot seen.
if it is the first two cases, it would be good to include length handling in the beans set method.. like throwing a size/length exceeded exception..
more later
peddu
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Any idea on how the lengths of fields are handled when creating or updating a row.
For example consider my table has a column
USERNAME CHAR(8)
The bean object created has the set method say
setUSERNAME(String newval) which doesnot validate the length. So if code accessing this method updates the field to a 10 or 20 character string, how is it handled.
is it truncated while being updated to the row
is an exception thrown by the driver
is it handled somewhere in the code that i havenot seen.
if it is the first two cases, it would be good to include length handling in the beans set method.. like throwing a size/length exceeded exception..
more later
peddu
Hi,
there is already such functionnality in the cvs please check the following url:
http://cvs.sourceforge.net/viewcvs.py/sql2java/sql2java/src/templates/velocity/java/pertable/factory.java.vm?rev=1.1&view=auto
http://cvs.sourceforge.net/viewcvs.py/sql2java/sql2java/src/templates/velocity/java/pertable/http.factory.java.vm?rev=1.1&view=auto
enjoy your day
Florent.