• Post Reply Bookmark Topic Watch Topic
  • New Topic

java-bean properties dynamic updation with type conversion . help.  RSS feed

 
Pavan Panduga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
this question may not be relevant to web services but I didn't know where to post, I frequent this forum so I thought I'll post it here.
The scenario is, I have to insert a customer into the customer database using a webservice. If the customer already exists but does not have complete details, this customer record has to be updated with the rest of the details like address, payment definiton etc. otherwise insert the whole record.
is there any way to update java bean properties dynamically with type conversion?
I have a few java-beans Customer, Address, Product, Order etc.
I'll have to read a properties file and update the beans with these values.
I had a look at jakarta commons-beanutils, with this normal string values work properly but when I have other datatypes like 'int' or 'long' it's not working. throwing a Typemismatch Exception.
Can anybody please suggest how to go about it? I thought of using a HashMap to store the property names as keys and appropriate wrapper classes as values. But when I invoke the setter method it returns an Object. I'm really stuck.
any input is greatly appreciated. a code example would be wonderful.
Thanks in advance.
Pavan
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you post in the JSP or servlet forum (and maybe a bit clearer with sample code).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!