[
https://issues.apache.org/jira/browse/TORQUE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martin Tilsted updated TORQUE-318:
----------------------------------
Description:
I have the following in my schema.xml:
<table name="read" idMethod="none">
<column name="userRef" primaryKey="true" required="true" type="INTEGER" />
<column name="entryId" primaryKey="true" required="true" type="INTEGER" />
<column name="entryType" primaryKey="true" required="true" type="INTEGER" />
<column name="readTime" type="TIMESTAMP" required="true" />
</table>
Which then generate the following code in my Peer class.
/**
* retrieve object using using pk values.
*
* @param juusuuserref int
* @param entryid int
* @param entrytype int
* @param con Connection
*/
public static Juusuread retrieveByPK(
int juusuuserref,
int entryid,
int entrytype,
Connection con) throws TorqueException
{
....
}
But this retrieveByPK will throw a
TorqueException("Failed to select one and only one row.")
instead of a NoRowsException as expected if it can't find a entry in the
database.
was:
I have the following in my schema.xml:
<table name="read" idMethod="none">
<column name="userRef" primaryKey="true" required="true" type="INTEGER" />
<column name="entryId" primaryKey="true" required="true" type="INTEGER" />
<column name="entryType" primaryKey="true" required="true" type="INTEGER" />
<column name="readTime" type="TIMESTAMP" required="true" />
</table>
Which then generate the following code in my Peer class.
/**
* retrieve object using using pk values.
*
* @param juusuuserref int
* @param entryid int
* @param entrytype int
* @param con Connection
*/
public static Juusuread retrieveByPK(
int juusuuserref,
int entryid,
int entrytype,
Connection con) throws TorqueException
{
....
}
But this retrieveByPK will throw a
TorqueException("Failed to select one and only one row.")
instead of a NoRowsException as expected.
> retrieveByPK throws TorqueException instead of NoRowsException when it can't
> find a primary key.
> ------------------------------------------------------------------------------------------------
>
> Key: TORQUE-318
> URL: https://issues.apache.org/jira/browse/TORQUE-318
> Project: Torque
> Issue Type: Bug
> Affects Versions: 4.0
> Reporter: Martin Tilsted
>
> I have the following in my schema.xml:
> <table name="read" idMethod="none">
> <column name="userRef" primaryKey="true" required="true" type="INTEGER" />
> <column name="entryId" primaryKey="true" required="true" type="INTEGER" />
> <column name="entryType" primaryKey="true" required="true" type="INTEGER" />
> <column name="readTime" type="TIMESTAMP" required="true" />
> </table>
> Which then generate the following code in my Peer class.
> /**
> * retrieve object using using pk values.
> *
> * @param juusuuserref int
> * @param entryid int
> * @param entrytype int
> * @param con Connection
> */
> public static Juusuread retrieveByPK(
> int juusuuserref,
> int entryid,
> int entrytype,
> Connection con) throws TorqueException
> {
> ....
> }
> But this retrieveByPK will throw a
> TorqueException("Failed to select one and only one row.")
> instead of a NoRowsException as expected if it can't find a entry in the
> database.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]