db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Monroe <Greg.Mon...@dukece.com>
Subject RE: [jira] [Commented] (TORQUE-147) Database objects should not need to inherit from BaseObject
Date Wed, 03 Aug 2011 15:46:59 GMT
Sorry, spaced the "e-mail from Jira issue" thing in the comment below and did 
not review the whole Jira thread.  I see now that I'm going well beyond the 
scope of this issue, and musing towards total separation between Persistent 
objects and the default Torque BaseObject class.

As I said in my Jira re-phrasing... it would be *Nice* to have... but not 
really needed as long as we can still use the BaseObject if we're doing 
standard generation.

The "collection" interface would be nice if your Persistent objects don't
extending the BaseObject but still want generic functions. But this should 
be another feature request and not key to 4.0 right now.

Sorry for the confusion.

-----Original Message-----
From: Thomas Fox [mailto:Thomas.Fox@seitenbau.net] 
Sent: Wednesday, August 03, 2011 11:11 AM
To: Apache Torque Developers List
Subject: RE: [jira] [Commented] (TORQUE-147) Database objects should not need to inherit from
BaseObject

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

DukeCE Privacy Statement:
Please be advised that this e-mail and any files transmitted with
it are confidential communication or may otherwise be privileged or
confidential and are intended solely for the individual or entity
to whom they are addressed. If you are not the intended recipient
you may not rely on the contents of this email or any attachments,
and we ask that you please not read, copy or retransmit this
communication, but reply to the sender and destroy the email, its
contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is
strictly prohibited.

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