db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gareth Boden <gareth.bo...@egsgroup.com>
Subject Re: how to map Peer.field-name --> BO-member
Date Tue, 14 Jan 2003 13:26:24 GMT
I don't think it's possible. The Peer fields are the database column 
names, and the BO methods might have different names, and there doesn't 
seem to be a map of this information available at runtime.

G.

On Tuesday, January 14, 2003, at 01:20  pm, Marc Lustig wrote:

> Hi,
> I'm simply trying to get a field from a torque-object by field-name.
> How is this done?
>
> More specifically, how do I actually map between the member of the BO 
> and
> the name of the field?
>
> An example:
> ProductPeer has: public static final String ORT; // the field name
> Product has member: private byte ort=0;
>
> What I need is a method in Product that looks like this:
> Object getMemberByFieldName(String fieldname); // fieldname should 
> refer to
> ProductPeer
>
> in my case: getMemberByFieldName("ORT") should return product.ort;
>
> Can somebody please advise me about a solution that is available?
>
> Remark: BaseObject.getByName(java.lang.String field) does not contain 
> any
> generic functionality at all.
>
> Thanks in advance.
> Marc
>
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-torque-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:turbine-torque-dev-help@jakarta.apache.org>
>


Mime
View raw message