You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Brekke, Jeff" <Je...@qg.com> on 2001/03/27 17:21:04 UTC

StringKey not being quoted in generated sql...

After updating some code to the latest CVS turbine, seems that when
StringKeys are used, they are not being quoted in the resultant sql.  I have
generated everything with torque and the table in question is shown below:

  <table name="CUSTOMER" idMethod="idbroker">
    <column name="CST_ID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
    <column name="CST_NM" required="true" size="255" type="VARCHAR"/>
    
    <unique>
      <unique-column name="CST_NM"/>
    </unique>        

  </table>

  <table name="CUSTOMER_EMPLOYEE" idMethod="none">
    <column name="CST_ID_FK" required="true" primaryKey="true"
type="INTEGER"/>
    <column name="USR_NM" required="true" primaryKey="true" size="255"
type="VARCHAR" />
    <column name="EMPL_NM" required="true" size="255" type="VARCHAR"/>
    <column name="EMAIL" required="true" size="255" type="VARCHAR"/>

    <foreign-key foreignTable="CUSTOMER">
      <reference local="CST_ID_FK" foreign="CST_ID"/>
    </foreign-key>
  </table>

CUSTOMER_EMPLOYEE has the problem.  For example, the retrieveByPK( NumberKey
cstid, StringKey usrnm ) is attempting to execute the following sql:

BasePeer.querySql= SELECT CUSTOMER_EMPLOYEE.CST_ID_FK,
CUSTOMER_EMPLOYEE.USR_NM, CUSTOMER_EMPLOYEE.EMPL_NM, CUSTOMER_EMPLOYEE.EMAIL
FROM CUSTOMER_EMPLOYEE WHERE (CUSTOMER_EMPLOYEE.USR_NM=adsfa) AND
(CUSTOMER_EMPLOYEE.CST_ID_FK=180)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I've attempted to determine where this should be happening but am having no
luck.  I think Village should handle the quoteing based on the type of
object being added to the where clause, but I'm not seeing where in turbine
this is starting at... Criteria?

Thanks in advance...

jb

-----------------------------------------------------------------
Jeffrey D. Brekke                             Information Systems
Jeff.Brekke@qg.com                                  Quad/Graphics
http://www.qg.com                          555 South 108th Street
414-566-3302                       West Allis, WI  53214-1145 USA
-----------------------------------------------------------------


-----------------------------------------------------------------------

This message has been scanned for viruses with Trend Micro's Interscan VirusWall.

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: StringKey not being quoted in generated sql...

Posted by Daniel Rall <dl...@collab.net>.
"Brekke, Jeff" <Je...@qg.com> writes:

> BasePeer.querySql= SELECT CUSTOMER_EMPLOYEE.CST_ID_FK,
> CUSTOMER_EMPLOYEE.USR_NM, CUSTOMER_EMPLOYEE.EMPL_NM, CUSTOMER_EMPLOYEE.EMAIL
> FROM CUSTOMER_EMPLOYEE WHERE (CUSTOMER_EMPLOYEE.USR_NM=adsfa) AND
> (CUSTOMER_EMPLOYEE.CST_ID_FK=180)
>                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> I've attempted to determine where this should be happening but am having no
> luck.  I think Village should handle the quoteing based on the type of
> object being added to the where clause, but I'm not seeing where in turbine
> this is starting at... Criteria?
> 
> Thanks in advance...

Was this resolved on IRC?

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org