db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject RE: [jira] [Commented] (TORQUE-147) Database objects should not need to inherit from BaseObject
Date Wed, 03 Aug 2011 15:10:40 GMT
Greg Monroe wrote:

> ...
> Get/SetByName, et. al.
>
> IMHO, we need to have an interface that covers these.  A use case
> for this would
> be common normalization or lookup functions.  E.g., a function with
> a record object
> and column name as parameters that does something common to multipletable
and
> columns, like scanning for profanity or normalizing case in across
multiple
> tables that contains title and description fields.
>
> Perhaps this could be based on the java LinkedHashMap object methods
> or the org.apache.commons.collections.OrderedMap interface?  With
> the key being
> the column name.  Then allow users the choice of simple persistent
objects or
> collection based persistent objects (which is a superset of the
> simple objects).
> ...

I am not sure if I understand the comment.
Currently the ColumnAccessByName interface is implemented (derived from the
old BaseObject signatures) if the getByNameMethods are generated (the
default)(Interface code appended below)
Is this sufficient for your use case ?

    Thanks,

     Thomas

----- apendix: ColumnAccessByName (javadoc removed)

public interface ColumnAccessByName
{
    public Object getByName(String field);

    public boolean setByName(String name, Object value)
            throws TorqueException;

    public Object getByPeerName(String name);

    public boolean setByPeerName(String name, Object value)
            throws TorqueException;

    public Object getByPosition(int pos);

    public boolean setByPosition(int position, Object value)
            throws TorqueException;
}


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


Mime
View raw message