db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (TORQUE-304) getPeerByName generated incorrectly
Date Thu, 21 Nov 2013 21:46:35 GMT

    [ https://issues.apache.org/jira/browse/TORQUE-304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13829380#comment-13829380
] 

Thomas Fox edited comment on TORQUE-304 at 11/21/13 9:46 PM:
-------------------------------------------------------------

used getSqlExpression() as an alternative to getColumnName() to match current implementation
of setByPeerName.
So setByPeerName and getByPeerName take alternatively the fully qualified name or the simple
column name.

Like
        if (org.apache.torque.test.peer.TypesPrimitivePeer.ID.getSqlExpression().equals(name)
            \|| org.apache.torque.test.peer.TypesPrimitivePeer.ID.getColumnName().equals(name))



was (Author: tfischer):
used getSqlExpression() as an alternative to getColumnName() to match current implementation
of setByPeerName.
So setByPeerName and getByPeerName take alternatively the fully qualified name or the simple
column name.

Like
        if (org.apache.torque.test.peer.TypesPrimitivePeer.ID.getSqlExpression().equals(name)
            || org.apache.torque.test.peer.TypesPrimitivePeer.ID.getColumnName().equals(name))


> getPeerByName generated incorrectly
> -----------------------------------
>
>                 Key: TORQUE-304
>                 URL: https://issues.apache.org/jira/browse/TORQUE-304
>             Project: Torque
>          Issue Type: Bug
>          Components: Templates
>    Affects Versions: 4.0
>            Reporter: Jeff Randolph
>            Assignee: Thomas Fox
>            Priority: Minor
>
> The getByPeerName method is generated in the base db objects as follows:
>     public Object getByPeerName(String name)
>     {
>             if (name.equals(org.abc.MyPeer.MyColumn))
>             {
>                 return getMyColumn();
>             }
>     }
> This will never work because org.abc.MyPeer.MyColumn is a Column, not a String.  It should
instead generate this:
>     public Object getByPeerName(String name)
>     {
>             if (name.equals(org.abc.MyPeer.MyColumn.getColumnName()))
>             {
>                 return getMyColumn();
>             }
>     }



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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