DBFlow
DBFlow copied to clipboard
Bug? Error on Comple "<identifier> expected" in generated *_Table.java
Setup:
- DBFlow Version:
4.0.0-beta1 - Target Platform:
Android 23 - Gradle/Maven:
Gradle v2.10Android Gradle Plugin v2.0.0 - Build Tools:
24.0.3 - Kotlin:
1.0.3withkapt
Issue Kind: Probably Bug
Problem Description:
Error is occuring on build: Error:(151, 27) Gradle: error: <identifier> expected
Corresponding generated *_Table.java file, error is reported in 151, but highlighting is showing it in 152.
150 int index_from = cursor.getColumnIndex("from");
151 if (index_from != -1 && !cursor.isNull(index_from)) {
152 model.setFrom(cursor.(index_from));
153 } else {
154 model.setFrom(null);
155 }
Below you find the corresponding annotated class.
@Table(database = MMHDatabase::class)
class Transaction(from: Account, value: Float = 0.0f, to: Account? = null, id: Long? = null) : BaseModel() {
companion object {
fun get(id: Long) : Transaction? {
return (select
from Transaction::class
where (Transaction_Table.id eq id)).result
}
}
@PrimaryKey
var id: Long? = null
@Column
var from: Account? = null
@Column
var value: Float = 0.0f
@ForeignKey(tableClass = Account::class)
var to: Account? = null
}
Did I do something wrong or is this a bug?
Never mind.
I made a mistake, delaring a refence class Account as column and not foreign key.