Multiplex datastore #2146
-
Hello, I am trying to figure out a way how to have references across multiple datastores (MultiplexManager).
so not sure if this even possible without some workaround? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you are going to bridge between stores, you will want to decorate the relationships with Elide's relationship annotations instead of JPA so JPA doesn't try to search for an entity it doesn't manage: https://github.com/yahoo/elide/blob/master/elide-core/src/main/java/com/yahoo/elide/annotation/ToMany.java Some logic still needs to hydrate those relationships (either done in the store during load or maybe through a life cycle hook on read). If you are just trying to bridge between two stores (two different JPA entity managers), it seems possible to generalize this somehow although Elide doesn't have any logic for this use case. We have one production instance that bridges between Hbase and MySQL. However, that required custom logic. |
Beta Was this translation helpful? Give feedback.
If you are going to bridge between stores, you will want to decorate the relationships with Elide's relationship annotations instead of JPA so JPA doesn't try to search for an entity it doesn't manage:
https://github.com/yahoo/elide/blob/master/elide-core/src/main/java/com/yahoo/elide/annotation/ToMany.java
and
https://github.com/yahoo/elide/blob/master/elide-core/src/main/java/com/yahoo/elide/annotation/ToOne.java
Some logic still needs to hydrate those relationships (either done in the store during load or maybe through a life cycle hook on read).
If you are just trying to bridge between two stores (two different JPA entity managers), it seems possible to generalize this somehow althoug…