Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support entity inheritance via "extension" tables #247

Open
Tapac opened this issue Feb 16, 2018 · 1 comment
Open

Support entity inheritance via "extension" tables #247

Tapac opened this issue Feb 16, 2018 · 1 comment

Comments

@Tapac
Copy link
Contributor

Tapac commented Feb 16, 2018

Allow to implement inheritance in something like:

object BaseTable : IdTable()
object ExtendTable : IdTable() {
   val parent = reference(BaseTable)
}

class ExtendEntity : Entity {
   val field1 by BaseTable.field1
   val field2 by ExtendTable .field2
   val dependsOnTable = BaseTable innerJoin ExtendTable
...
}

@grv87
Copy link

grv87 commented Oct 14, 2021

How ids are propagated from BaseTable to ExtendTable? Does it depend on the order of innerJoin arguments? What if I need several base tables (one for each interface/superclass)?

How this would work when another table references BaseTable? The code doesn't know whether it is ExtendEntity or Extend2Entity.
In my experience, BaseTable has enum column specifying concrete type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants