|
The reason I want to do it this way is so that I can be
more dynamic and use the beanutils package from jakarta to do
PropertyUtils.set(bean, "myField", "Data From File");
However, I can't do this with iBatis unless I convert the
"Data From File" to an integer first in some cases. So I'd have to figure
this out on a per field basis with some more crappy configuration file and do
something like the below. I'm basically trying to avoid a bunch more
configurations in a properties file.
PropertyUtils.set(bean, "myField",
Integer.parseInt("Data"));
From: Meindert [mailto:[EMAIL PROTECTED] Sent: Friday, February 10, 2006 1:00 AM To: [email protected] Subject: RE: iBatis Conversion of java Type String to Numeric database field Hi
Ryan, Sorry for replying
without answering your question, but it sounds to me that the validation of the
text file should be done in your service layer, and that the service layer
should populate your data beans what is a reflection of your
tables. MEINDERT
HOVING From: Brent
Ryan [mailto:[EMAIL PROTECTED] If I have a java bean that contains
only String data types, is there a way to have iBatis insert/update rows in the
database that have a data type of 'Numeric'? For Example... I read in a string of
data from a text file, create my bean, then call my iBatis service to insert the
row of data into the database. However, the database has a numeric data
type for some of the fields. Can iBatis handle this? I don't want my
bean to have int, Date or other data types because then I have to figure that
out during the read of this text file. I just want to treat everything as
a String. I know that if you do this in
Hibernate that it knows how to insert the String into a numeric data
field. However, Hibernates performance is bad when I'm trying to insert 1
million rows of data into a single table so I can't use it. I need to use
straight JDBC or iBatis possibly.... Thanks, Brent BbWorld
'06 New Client-Centered
Program, Peers Aplenty, Party on Deck Register today! Visit: http://www.blackboard.com/company/events/bbworld/ to learn more. This e-mail is
intended only for the personal and confidential use of the recipient(s) named
above. -- -- | |||||||||||||||||||
