Howard Liberty
unread,Jan 5, 2012, 8:31:44 PM1/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ORMLite Android Users
I created some Dao without the object cache. The query is working well
but it seems like I can't update the dao. Please let me know if you
want more info.
Code:
.....
all = cardDao.queryForAll();
for (Card c : all) {
c.setQuestion("Hello");
cardDao.update(c);
}
all = cardDao.queryForAll();
for (Card c : all) {
System.out.println(c.getQuestion());
}
Here is the output from the log:
D/StatementExecutor(20103): query of 'SELECT * FROM `cards` ' returned
28 results
D/BaseMappedStatement(20103): update data with statement 'UPDATE
`cards` SET `answer` = ?, `cardType` = ?, `category_id` = ?, `creation
Date` = ?, `learningData_id` = ?, `note` = ?, `ordinal` = ?,
`question` = ?, `updateDate` = ? WHERE `id` = ? AND `updateDate` = ?'
and
11 args, changed 1 rows
....
D/BaseMappedStatement(20103): update data with statement 'UPDATE
`cards` SET `answer` = ?, `cardType` = ?, `category_id` = ?, `creation
Date` = ?, `learningData_id` = ?, `note` = ?, `ordinal` = ?,
`question` = ?, `updateDate` = ? WHERE `id` = ? AND `updateDate` = ?'
and
11 args, changed 1 rows
D/BaseMappedStatement(20103): update data with statement 'UPDATE
`cards` SET `answer` = ?, `cardType` = ?, `category_id` = ?, `creation
Date` = ?, `learningData_id` = ?, `note` = ?, `ordinal` = ?,
`question` = ?, `updateDate` = ? WHERE `id` = ? AND `updateDate` = ?'
and
11 args, changed 1 rows
D/BaseMappedStatement(20103): update data with statement 'UPDATE
`cards` SET `answer` = ?, `cardType` = ?, `category_id` = ?, `creation
Date` = ?, `learningData_id` = ?, `note` = ?, `ordinal` = ?,
`question` = ?, `updateDate` = ? WHERE `id` = ? AND `updateDate` = ?'
and
11 args, changed 1 rows
D/BaseMappedStatement(20103): update data with statement 'UPDATE
`cards` SET `answer` = ?, `cardType` = ?, `category_id` = ?, `creation
Date` = ?, `learningData_id` = ?, `note` = ?, `ordinal` = ?,
`question` = ?, `updateDate` = ? WHERE `id` = ? AND `updateDate` = ?'
and
11 args, changed 1 rows
D/BaseMappedStatement(20103): prepared statement 'SELECT * FROM
`cards` ' with 0 args
D/SelectIterator(20103): starting iterator @1081028416 for 'SELECT *
FROM `cards` '
D/SelectIterator(20103): closed iterator @1081028416 after 28 rows
D/StatementExecutor(20103): query of 'SELECT * FROM `cards` ' returned
28 results
I/System.out(20103): head
I/System.out(20103): hair
I/System.out(20103): face
I/System.out(20103): eye
I/System.out(20103): eyes
I/System.out(20103): nose
I/System.out(20103): cheek
I/System.out(20103): mouth
I/System.out(20103): lip
.......