Investigate allowing an entity to extend entity ( ~"Customization" )#2696
Open
rbygrave wants to merge 1 commit into
Open
Investigate allowing an entity to extend entity ( ~"Customization" )#2696rbygrave wants to merge 1 commit into
rbygrave wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Normally
@Entitybeans can not extend another@Entitybean without using the inheritance annotations and discriminator column.What this is about is allowing an
@Entitybean to extend another@Entity. There are 2 use cases that I have in mind that I think this could be useful for.Customisation
With this, we have existing models (entity beans) and we can't or don't want to modify those entity beans. Either we didn't author them ourselves or they represent some common or core functionality that can be extended.
We are authoring an extension that uses the common entity beans but for the purposes of this extension we desire additional columns on an entity. With this we can create a new entity that extends another and adds properties/columns.
Under the hood:
Logical replication
The other potential use case is where we are using logical replication. We have a common/central table (say product) and this is logically replicated to a few other databases. Logical typically replication requires that the destination table has at LEAST the columns of the source table but it can have ADDITIONAL columns. This exactly matches what this feature allows. For example, a service extends Product to have its own ProductCustom entity with additional columns specific to that service.