Re: I want to map a Java bean object to relational database table! But do not want to use EJB.
Tuesday, June 4, 2002 01:54 PM
All your objects have a java.lang.Class object(by calling getClass() on your object). Using Class you can get all kinds of info about your object. An example is call getDeclaredMethods() to get all methods that is defined in that object's class. Then you may come up with a generic solution for method calling. Look at java.lang.reflect pacakge for details. This is called reflection. A good starting point is as following:
Usually a generic solution comes with performance penalty.
Hope this helps.