Bug using Enum inside Where condition
See original GitHub issueDBFlow Version: develop-SNAPSHOT Issue Kind (Bug, Question, Feature): Bug
Description:
SQLite.select().from(Bonus.class).where(Bonus_Table.market.eq(Market.CERT_X)).queryList();
android.database.sqlite.SQLiteException: no such column: CERT_X (code 1): , while compiling: SELECT * FROM
BonusWHERE
market=CERT_X ORDER BY
underlyingName ASC
i think SELECT should be:
SELECT * FROM
BonusWHERE
ask!=0.0 AND
market='CERT_X' ORDER BY
underlyingName ASC
with this converter works
public class CustomConverter extends TypeConverter<String, Market> {
@Override
public String getDBValue(Market model) {
return model.name();
}
@Override
public Market getModelValue(String data) {
return Market.valueOf(data);
}
}
this workaround works for “eq” but not for “in”
“in” seams not use converter
same converter produce this select that works
SELECT * FROM
BonusWHERE
ask!=0.0 AND (
typeBarrier='CONTINUA' OR
typeBarrier='DISCRETA') ORDER BY
underlyingName ASC
and this that not works
SELECT * FROM
BonusWHERE
ask!=0.0 AND
typeBarrierIN (DISCRETA,CONTINUA) ORDER BY
underlyingNameASC
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
in
develop
.There are some big changes with how type converters work in V4. These issues are likely related.