Green Dao bi-directional One To One mapping

127 views Asked by At

I'm using GreenDao in my Android app and I would like to create a bi-directional One-To-One mapping.

However I don't see how this can be achieved unless a have two foreign key properties on both entities, which is not ideal.

Ideal would is if one entity owns the relationship.

Did anyone come across this problem?

For now a decided as a workaround to create a bi-directional one to many mapping and i create a custom method on the 2nd entity which returns only a entity of the other type. Not ideal, but it works!

0

There are 0 answers