db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Tilsted <til...@daimi.au.dk>
Subject Get type of fields in auto generated classse
Date Thu, 17 Jan 2008 22:26:52 GMT
Is there a way to make a method, that given a field name, and any auto 
generated object, can return the type of that field?

Something like
boolean isFieldAnInteger(BaseObject obj,String fieldName)  {
    // What here. (And is BaseObject the correct class to use, if you 
want to accept something that can be any torque auto generated class?)
}

At first I thought I could do
Class c=obj. getByName(field).getClass();
But that don't work if obj is a newly created object, becasue getByName 
will return null.

Martin





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