elide
elide copied to clipboard
Support external relationship annotation
Currently we want a polymorphic relationship in a model to unrelated entities.
{
"relationships": {
"item": {
"data": {
"type": "foo", //or could be "bar", or "spam" of unrelated entities inheritance-wise
"id": "2"
}
}
}
}
We can model this easily with Hibernate's @Any or @ManyToAny annotation
@Any( metaColumn = @Column( name="item_type" ) )
@AnyMetDef(
idType = "long"
metaValues = {
@MetaValue( value="foo", targetEntity=Foo.class ),
@MetaValue( value="bar", targetEntity=Bar.class ),
}
)
@JoinColumn(name = "item_id")
public SimilarInterface getItem() { return item; }
But despite being able to do this in Hibernate, Elide doesn't seem to be able to recognize these as relationships. So we would like to implement an annotation that allows us to annotate relationships outside of just the JPA supported ones. So we can continue to map relationships with non JPA supported annotations.