goupviet / joose-js

Automatically exported from code.google.com/p/joose-js
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Saving an existing entity produces invalid SQL #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. select an entity instance and read it from the database
2. change any of its properties
3. save the entity instance

What is the expected output? What do you see instead?
Expected: UPDATE subscription SET rowid = ?,url = ?,interval = ?,lastUpdated = 
?,state = ?
,follows = ? WHERE rowid = ?

Actual: UPDATE subscription SET rowid = ?url = ?interval = ?lastUpdated = 
?state = ?follows = ? 
WHERE rowid = ?

What version of the product are you using? On what operating system?
2.0, ORM.js

Please provide any additional information below.
The bad SQL is due to a bug in line 208 of ORM.js where the set is being put 
together without 
delimiting individual update clauses with a comma.

Original issue reported on code.google.com by nrmeht...@gmail.com on 10 Mar 2009 at 10:10

GoogleCodeExporter commented 8 years ago
Are you using simple_orm/ORM.js or simple_orm/async/ORM.js ?

Original comment by malte.ubl on 10 Mar 2009 at 10:27

GoogleCodeExporter commented 8 years ago
I am using simple_orm/ORM.js.

Original comment by nrmeht...@gmail.com on 11 Mar 2009 at 3:56

GoogleCodeExporter commented 8 years ago
The version you are using hasn't been maintained in a while (although I am still
suprised by your problem) because the variant in async also supports the native 
HTML5
database in FF3.1, Safari 4, etc.

Could you switch to the async version. It involves changing your code because 
all
results come in callbacks instead of return values (Because that is the way the 
HTML5
API works)

Original comment by malte.ubl on 11 Mar 2009 at 6:34

GoogleCodeExporter commented 8 years ago
OK I switched over to the async version. Of course, there are no problems with 
update in this version.

However, it is not clear whether the chaining syntax of callbacks is supported. 

Original comment by nrmeht...@gmail.com on 12 Mar 2009 at 5:23

GoogleCodeExporter commented 8 years ago
It is supported. You need to also load JooseX.DelayedExecution

Original comment by malte.ubl on 12 Mar 2009 at 6:05