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
@Entity
data class Customer(
@Id var id: Long = 0
) {
@Backlink(to = "customer")
lateinit var orders: ToMany<Order>
}
@Entity
data class Order(
@Id var id: Long = 0,
var name: String? = ""
) {
lateinit var customer: ToOne<Customer>
}
From the above classes, Im getting error as below Cannot figure out how to save this field into database. You can consider adding a type converter for it.
Not sure if I did this correctly or not, need help figuring out why its saying this.
Do I actually need converter for using ToOne?
Thanks in advance. Btw great project
The text was updated successfully, but these errors were encountered:
Thanks for reporting. However, this error message is not familiar. This should work without issue, assuming your code imports the ToOne class from the io.objectbox package.
Can you share the exact error message? Also, are you using the latest version of ObjectBox? If not, which one?
If possible supply the following info:
**Basic info (please complete the following information):**
- ObjectBox version (are you using the latest version?): [e.g. 2.7.0]
- Reproducibility: [e.g. occurred once only | occasionally without visible pattern | always]
- Device: [e.g. Galaxy S20]
- OS: [e.g. Android 10]
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue.
Hi all,
Disclaimer, this is my first time using ObjectBox
Im trying to use relation
From the above classes, Im getting error as below
Cannot figure out how to save this field into database. You can consider adding a type converter for it.
Not sure if I did this correctly or not, need help figuring out why its saying this.
Do I actually need converter for using
ToOne
?Thanks in advance. Btw great project
The text was updated successfully, but these errors were encountered: