db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Holtzman" <j...@joshholtzman.com>
Subject Generic Admin Tool for Torque Objects
Date Thu, 11 Sep 2003 22:12:47 GMT
I am interested in developing a generic "admin" tool to display all of
the fields for any given torque object.  I thought I could use
reflection to get the call to the getFields() method, but I can't.
Here's what happens:

1) Class c = Class.forName(request.getParameter("type"));
2) Object o = c.newInstance();
3) Method m = c.getMethod("getFields", null);

Line 3 throws an error, because Object doesn't have a getFields()
method.  If I specify "wait" or "notify", it works fine because these
methods are defined in Object.

So, I suppose the answer is to cast to a BaseObject type... Wrong! The
problem is that BaseObject doesn't have getFields() either.  So, I'm
still stuck.  There is o comon superclass that I can cast to in order to
get a list of fields in the unknown torque object.

Is there any way to get the field names (and hence, values) for an
unknown torque object type?  Do I need to create an empty torque object
in my schema and have al of my other objects extend this one, just so I
can get a common superclass with the getFields() method?

I hope this makes sense.  Thanks for any ideas!

Josh

=============================
JOSH HOLTZMAN Web Development
http://joshholtzman.com
============================= 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message