Closed carmas123 closed 5 years ago
@carmas123 Thanks for the question. In Jaguar, one has to generate beans to generate the ORM logic for the given model. There is one bean for every model in the database.
For one-to-one relationship, please refer this wiki post: https://github.com/Jaguar-dart/jaguar_orm/wiki/One-to-one-relationship
There is a one-to-one example here: https://github.com/Jaguar-dart/jaguar_orm/blob/master/orm/example/model/associations/one_to_one/simple.dart
Basically, you are looking for annotations: HasOne
and BelongsTo
.
Yes I try it.... But I don't understand why I need to add references into mi parent table "BelongsTo"... and I got an error whan I try to use this methods in generation.
Thanks for quick reply. Do you have gitter?
You can chat with us here: https://gitter.im/jaguar_dart/jaguar
Yes I talk now
I'm a Kotlin developer and came from Android to Flutter and in Android I use DBFlow a very powerful Android ORM. In DBFlow I've the class of model and I can add the foreignkey very simple with a column type of linked class. For example:
with this method I can access to MyLinkedTable using the MyTable.linkedValue field, like this.
MyTable.linkedValue.value
accessing to linked table value is very simple.
How can I do some like this with JaguarORM?