You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fischer (JIRA)" <ji...@apache.org> on 2010/10/01 22:21:33 UTC

[jira] Created: (TORQUE-148) remove throws clause in setter for referenced object by a foreign key

remove throws clause in setter for referenced object by a foreign key
---------------------------------------------------------------------

                 Key: TORQUE-148
                 URL: https://issues.apache.org/jira/browse/TORQUE-148
             Project: Torque
          Issue Type: Improvement
            Reporter: Thomas Fischer
            Assignee: Thomas Fischer
            Priority: Minor


for the schema
  <table name="book" description="Book table">
    ....
    <foreign-key foreignTable="author">
      <reference local="author_id" foreign="author_id"/>
    </foreign-key>
  </table>

Torque generates (complexObjectModel=true) in BaseBook:

    public void setAuthor(Author v) throws TorqueException
    {
        if (v == null)
        {
            setAuthorId(0);
        }
        else
        {
            setAuthorId(v.getAuthorId());
        }
        aAuthor = v;
    }

the TorqueException in the throws clause of the method is never thrown and should be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (TORQUE-148) remove throws clause in setter for referenced object by a foreign key

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TORQUE-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Fischer resolved TORQUE-148.
-----------------------------------

    Fix Version/s: 4.0
       Resolution: Fixed

> remove throws clause in setter for referenced object by a foreign key
> ---------------------------------------------------------------------
>
>                 Key: TORQUE-148
>                 URL: https://issues.apache.org/jira/browse/TORQUE-148
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fischer
>            Assignee: Thomas Fischer
>            Priority: Minor
>             Fix For: 4.0
>
>
> for the schema
>   <table name="book" description="Book table">
>     ....
>     <foreign-key foreignTable="author">
>       <reference local="author_id" foreign="author_id"/>
>     </foreign-key>
>   </table>
> Torque generates (complexObjectModel=true) in BaseBook:
>     public void setAuthor(Author v) throws TorqueException
>     {
>         if (v == null)
>         {
>             setAuthorId(0);
>         }
>         else
>         {
>             setAuthorId(v.getAuthorId());
>         }
>         aAuthor = v;
>     }
> the TorqueException in the throws clause of the method is never thrown and should be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TORQUE-148) remove throws clause in setter for referenced object by a foreign key

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917889#action_12917889 ] 

Thomas Fischer commented on TORQUE-148:
---------------------------------------

In this special case no runtime Exception is needed. It will never be thrown.

If we want to change the Torque exception handling in a global manner we should first discuss on the dev list and then open another jira issue. Personally I like checked exceptions as long as the exception hierarchy makes sense. But IMO this is a matter of taste.

> remove throws clause in setter for referenced object by a foreign key
> ---------------------------------------------------------------------
>
>                 Key: TORQUE-148
>                 URL: https://issues.apache.org/jira/browse/TORQUE-148
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fischer
>            Assignee: Thomas Fischer
>            Priority: Minor
>             Fix For: 4.0
>
>
> for the schema
>   <table name="book" description="Book table">
>     ....
>     <foreign-key foreignTable="author">
>       <reference local="author_id" foreign="author_id"/>
>     </foreign-key>
>   </table>
> Torque generates (complexObjectModel=true) in BaseBook:
>     public void setAuthor(Author v) throws TorqueException
>     {
>         if (v == null)
>         {
>             setAuthorId(0);
>         }
>         else
>         {
>             setAuthorId(v.getAuthorId());
>         }
>         aAuthor = v;
>     }
> the TorqueException in the throws clause of the method is never thrown and should be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TORQUE-148) remove throws clause in setter for referenced object by a foreign key

Posted by "CG Monroe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917603#action_12917603 ] 

CG Monroe commented on TORQUE-148:
----------------------------------

As has been said in the dev list, exception handling is a beast.   I think a good solution would be to replace this with  TorqueRuntimeException.  

The reason being is that this make re-writing code that currently has to handle TorqueExceptions easier.  Just change the exception type.  Plus it simplifies future code by removing the exception handing requirement because Runtime Exceptions don't get flagged by compiler.

> remove throws clause in setter for referenced object by a foreign key
> ---------------------------------------------------------------------
>
>                 Key: TORQUE-148
>                 URL: https://issues.apache.org/jira/browse/TORQUE-148
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fischer
>            Assignee: Thomas Fischer
>            Priority: Minor
>             Fix For: 4.0
>
>
> for the schema
>   <table name="book" description="Book table">
>     ....
>     <foreign-key foreignTable="author">
>       <reference local="author_id" foreign="author_id"/>
>     </foreign-key>
>   </table>
> Torque generates (complexObjectModel=true) in BaseBook:
>     public void setAuthor(Author v) throws TorqueException
>     {
>         if (v == null)
>         {
>             setAuthorId(0);
>         }
>         else
>         {
>             setAuthorId(v.getAuthorId());
>         }
>         aAuthor = v;
>     }
> the TorqueException in the throws clause of the method is never thrown and should be removed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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