db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campbell, Justin" <jcampb...@profilesys.com>
Subject RE: Generic Admin Tool for Torque Objects
Date Thu, 11 Sep 2003 22:32:01 GMT
Quick question, have you tried using "getFieldNames"??

I ask only because I am able to successfully use reflection to find the
"getFieldNames" method on both my OM class and Base OM class.

Let us know.

Justin Campbell
Project Technical Lead
Profile Systems, Inc.

-----Original Message-----
From: Josh Holtzman [mailto:josh@joshholtzman.com]
Sent: Thursday, September 11, 2003 6:13 PM
To: torque-user@db.apache.org
Subject: Generic Admin Tool for Torque Objects


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

---------------------------------------------------------------------
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