• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Externalizing method calls

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiya folks,
Wonder if anyone can help me with my latest endeavor.
I have a set of Java entities (POJOs) with getter and setter methods that will store data. These entities are going to be processed by stored procedures, but based on the application that consumes them, they need to be processed differently. So rather than writing a crazy "if" statement or multiple objects that do basically the same thing, just in different formats, and since all of the actual meat happens in stored procedures in the database...I want to create an xml document that stores some information about the entity, and appropriate stored procs that process them. I need to bind the strings stored within the xml to Java types but I am a little confused on how to get this done.
In order to populate the CallableStatement that will execute the stored procedure, I need some values within the entity objects (i.e. I need to be able to call the getter methods).
So for example:
I have an entity named MyObject that has a method named getSomething() which returns a String. I can create MyObject by using:
Class.forName("myClass").newInstance();
My problem is that I want to get the value that getSomething() returns but I am not sure how to do it. I have a string in the xml that corresponds to the getter method call in MyObject, but I don't know how to convert that string into an actual invocation of the getSomething method and have it return a value.
I am almost positive this can be done, but I am unsure of how to do it. Can anyone give me an example or point me in the direction of how to do it?
Thanks in advance!
Matt
[ October 23, 2003: Message edited by: M Givney ]
[ October 23, 2003: Message edited by: M Givney ]
[ October 23, 2003: Message edited by: M Givney ]
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Givney.
Try this:

Mavedrive;
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic