![]() |
![]() |
|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 3
|
|
| Author |
|
|
Novice USA Joined: Dec 15, 2007 Post Count: 39 Status: Offline |
I'm using the 1.1.4 release of DataNucleus, running against an HSQL DB on Linux. I'm getting the following error when: DataNucleus.Datastore: java.sql.SQLException: Unexpected token: 12 in statement [SELECT 'phmpro.datasource.AbstractSensorValue ' AS NUCLEUS_TYPE FROM ABSTRACTSENSORVALUE A0 WHERE A0.PARENT_ASSET_ITEM_UUID_OID IS NULL AND A0.PARENT_ASSET_ITEM_SENSOR_PROPERTY_KEY IS NULL AND A0."TIMESTAMP" IS NULL AND A0.DISCRIMINATOR = 'phmpro.datasource.AbstractSensorValue' UNION SELECT 'phmpro.plugins.sensors.TemperatureSensorValue' AS NUCLEUS_TYPE FROM ABSTRACTSENSORVALUE A0 WHERE 'ff8081812237bd13012237bd45cb0005' = A0.PARENT_ASSET_ITEM_UUID_OID AND 'temp0' = A0.PARENT_ASSET_ITEM_SENSOR_PROPERTY_KEY AND 2009-07-01 12:14:14.226 = A0."TIMESTAMP" AND A0.DISCRIMINATOR = 'phmpro.plugins.sensors.TemperatureSensorValue']This is thrown whenever I try to delete one of the TemperatureSensorValue instances. It looks like the generated query is not correctly quoting the timestamp field's value. This looks simple enough that I could submit a patch for it myself but I can't figure out where the SQL for this gets generated. I've gotten as far as RDBMSStoreHelper but get lost after that. I was hoping someone could point me to where the SQLStatements and/or BooleanExpressions get converted to SQLTexts? Thanks, Karl |
||
|
|
Novice USA Joined: Dec 15, 2007 Post Count: 39 Status: Offline |
Finally tracked it down. Looks like the conversion from a Java Timestamp to a String occurs in org.datanucleus.store.rdbms.sql.expression.TemporalLiteral.setStatement(). Unlike in StringLiteral, the converted String for TemporalLiteral is not escaped. I'll put together a short patch for this. |
||
|
|
Novice USA Joined: Dec 15, 2007 Post Count: 39 Status: Offline |
I've opened a JIRA issue and attached a patch here: http://www.jpox.org/servlet/jira/browse/NUCRDBMS-218 By the way, it's great to be able to build DataNucleus via Maven 2 now-- makes life much easier for us. |
||
|
|
|
|
|
Current timezone is GMT Sep 2, 2010 8:55:02 PM |