jc
unread,Nov 9, 2011, 8:17:25 PM11/9/11Sign 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 Users
I'm updating to the latest version for Android and converting my
custom countOf() method to use the new method provided by the Dao. At
first glance, this appears to be an issue but I'm not sure if maybe I
missed something.It appears that this may but it's not working and
I'm not sure if this is a bug or.
I added "setCountOf(true)" to my query builder and when I call
countOf() I get the following "Cannot call query on a SELECT_LONG
statement":
11-09 18:42:32.184: ERROR/AndroidRuntime(2583):
java.lang.IllegalArgumentException: Cannot call query on a SELECT_LONG
statement
11-09 18:42:32.184: ERROR/AndroidRuntime(2583): at
com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:
49)
11-09 18:42:32.184: ERROR/AndroidRuntime(2583): at
com.j256.ormlite.stmt.StatementExecutor.queryForCountStar(StatementExecutor.java:
131)
11-09 18:42:32.184: ERROR/AndroidRuntime(2583): at
com.j256.ormlite.dao.BaseDaoImpl.countOf(BaseDaoImpl.java:678)
If I remove the setCountOf call, it fails with the expected error that
"Prepared query is not of type SELECT_LONG, did you call
QueryBuilder.setCountOf(true)":
11-09 18:35:50.102: ERROR/AndroidRuntime(2534):
java.lang.IllegalArgumentException: Prepared query is not of type
SELECT_LONG, did you call QueryBuilder.setCountOf(true)?
11-09 18:35:50.102: ERROR/AndroidRuntime(2534): at
com.j256.ormlite.dao.BaseDaoImpl.countOf(BaseDaoImpl.java:673)
11-09 18:35:50.102: ERROR/AndroidRuntime(2534): at
com.wm.ocs.android.da.database.dao.DaoImpl.countOf(DaoImpl.java:63)
The stacktraces are from 4.29, but I also tried the 4.30-SNAPSHOT and
get the same errors.