You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code, when arrive at line "queryBuilder.prepare();" it's broking the application throwing "java.lang.StackOverflowError: stack size 8192KB", and if I remove the between operator in "queryBuilder", the code runs fine
LogDao logDao = new LogDao(this.getConnectionSource());
DetailsDao detailsDao = new DetailsDao(this.getConnectionSource());
QueryBuilder<LogEntity, Integer> queryBuilder;
QueryBuilder<DetailsEntity, Integer> detailsQueryBuilder;
//Logs without details
detailsQueryBuilder = detailsDao.queryBuilder();
detailsQueryBuilder
.where()
.notIn("id", detailsQueryBuilder.selectColumns("log_id"));
queryBuilder = logDao.queryBuilder();
queryBuilder
.join(detailsQueryBuilder)
.where()
.between("timestamp", initDate, finalDate); //initDate and finalDate is passed in function param
PreparedQuery preparedQuery = queryBuilder.prepare();
in console show a lot of E/AndroidRuntime exception in sequence:
E/AndroidRuntime: at com.j256.ormlite.stmt.query.InSubQuery.appendSql(InSubQuery.java:17)
at com.j256.ormlite.stmt.Where.appendSql(Where.java:609)
at com.j256.ormlite.stmt.StatementBuilder.appendWhereStatement(StatementBuilder.java:163)
at com.j256.ormlite.stmt.QueryBuilder.appendWhereStatement(QueryBuilder.java:530)
at com.j256.ormlite.stmt.StatementBuilder.appendStatementString(StatementBuilder.java:145)
at com.j256.ormlite.stmt.QueryBuilder$InternalQueryBuilderWrapper.appendStatementString(QueryBuilder.java:926)
at com.j256.ormlite.stmt.query.InSubQuery.appendValue(InSubQuery.java:42)
at com.j256.ormlite.stmt.query.BaseComparison.appendSql(BaseComparison.java:49)
at com.j256.ormlite.stmt.query.InSubQuery.appendSql(InSubQuery.java:17)
at com.j256.ormlite.stmt.Where.appendSql(Where.java:609)
at com.j256.ormlite.stmt.StatementBuilder.appendWhereStatement(StatementBuilder.java:163)
at com.j256.ormlite.stmt.QueryBuilder.appendWhereStatement(QueryBuilder.java:530)
at com.j256.ormlite.stmt.StatementBuilder.appendStatementString(StatementBuilder.java:145)
at com.j256.ormlite.stmt.QueryBuilder$InternalQueryBuilderWrapper.appendStatementString(QueryBuilder.java:926)
at com.j256.ormlite.stmt.query.InSubQuery.appendValue(InSubQuery.java:42)
at com.j256.ormlite.stmt.query.BaseComparison.appendSql(BaseComparison.java:49)
at com.j256.ormlite.stmt.query.InSubQuery.appendSql(InSubQuery.java:17)
at com.j256.ormlite.stmt.Where.appendSql(Where.java:609)
at com.j256.ormlite.stmt.StatementBuilder.appendWhereStatement(StatementBuilder.java:163)
at com.j256.ormlite.stmt.QueryBuilder.appendWhereStatement(QueryBuilder.java:530)
at com.j256.ormlite.stmt.StatementBuilder.appendStatementString(StatementBuilder.java:145)
at com.j256.ormlite.stmt.QueryBuilder$InternalQueryBuilderWrapper.appendStatementString(QueryBuilder.java:926)
at com.j256.ormlite.stmt.query.InSubQuery.appendValue(InSubQuery.java:42)
at com.j256.ormlite.stmt.query.BaseComparison.appendSql(BaseComparison.java:49)
at com.j256.ormlite.stmt.query.InSubQuery.appendSql(InSubQuery.java:17)
at com.j256.ormlite.stmt.Where.appendSql(Where.java:609)
at com.j256.ormlite.stmt.StatementBuilder.appendWhereStatement(StatementBuilder.java:163)
at com.j256.ormlite.stmt.QueryBuilder.appendWhereStatement(QueryBuilder.java:530)
at com.j256.ormlite.stmt.StatementBuilder.appendStatementString(StatementBuilder.java:145)
at com.j256.ormlite.stmt.QueryBuilder$InternalQueryBuilderWrapper.appendStatementString(QueryBuilder.java:926)
at com.j256.ormlite.stmt.query.InSubQuery.appendValue(InSubQuery.java:42)
at com.j256.ormlite.stmt.query.BaseComparison.appendSql(BaseComparison.java:49)
at com.j256.ormlite.stmt.query.InSubQuery.appendSql(InSubQuery.java:17)
at com.j256.ormlite.stmt.Where.appendSql(Where.java:609)
at com.j256.ormlite.stmt.StatementBuilder.appendWhereStatement(StatementBuilder.java:163)
at com.j256.ormlite.stmt.QueryBuilder.appendWhereStatement(QueryBuilder.java:530)
at com.j256.ormlite.stmt.StatementBuilder.appendStatementString(StatementBuilder.java:145)
at com.j256.ormlite.stmt.QueryBuilder$InternalQueryBuilderWrapper.appendStatementString(QueryBuilder.java:926)
at com.j256.ormlite.stmt.query.InSubQuery.appendValue(InSubQuery.java:42)
at com.j256.ormlite.stmt.query.BaseComparison.appendSql(BaseComparison.java:49)
at com.j256.ormlite.stmt.query.InSubQuery.appendSql(InSubQuery.java:17)
at com.j256.ormlite.stmt.Where.appendSql(Where.java:609)
at com.j256.ormlite.stmt.StatementBuilder.appendWhereStatement(StatementBuilder.java:163)
at com.j256.ormlite.stmt.QueryBuilder.appendWhereStatement(QueryBuilder.java:530)
at com.j256.ormlite.stmt.StatementBuilder.appendStatementString(StatementBuilder.java:145)
at com.j256.ormlite.stmt.QueryBuilder$InternalQueryBuilderWrapper.appendStatementString(QueryBuilder.java:926)
at com.j256.ormlite.stmt.query.InSubQuery.appendValue(InSubQuery.java:42)
at com.j256.ormlite.stmt.query.BaseComparison.appendSql(BaseComparison.java:49)
I'm trying to understand this problem, but until the moment i do not realize what could be. Can help me?
The text was updated successfully, but these errors were encountered:
The detailsQueryBuilder.selectColumns(...) returns the detailsQueryBuilder to do chaining so this in effect makes the query not-in itself which goes recursive.
I'm not immediately sure what the notIn(...) second argument should be. If you are trying to get all of the log-ids out of the details then you will need another query that returns all unique log-ids maybe?
detailsQueryBuilder
.where()
.notIn("id", detailsDao.queryBuilder().selectColumns("log_id")); // this will return all the log_id in the details table
but this will return empty result becuse the where statement filter outs all the log_id in the table.
give the table relationship of LogEntity and DetailEntity. also provide the exact sql select statement you want to execute. thus the exact code can be provided.
The following code, when arrive at line "queryBuilder.prepare();" it's broking the application throwing "java.lang.StackOverflowError: stack size 8192KB", and if I remove the between operator in "queryBuilder", the code runs fine
in console show a lot of E/AndroidRuntime exception in sequence:
I'm trying to understand this problem, but until the moment i do not realize what could be. Can help me?
The text was updated successfully, but these errors were encountered: