Skip to content

Inherit model properties from super classes #13

Closed

Description

@TimothyGillespie

Is your feature request related to a problem? Please describe.
When you look to the last section: I wish that B had the id field as well. Currently, this doesn't seem to be the case. It can lead to reduction of boilerplate code and better maintainability.

I can imagine scenarios where you don't want to inherit these properties. In this case one could add an Annotation on the inheriting class like: @DoNotInheritModelProperties

Describe the solution you'd like
See above

Describe alternatives you've considered
See above.

Additional context
´´´
class A extends Model {
@column
int id;
}

class B extends A {}
´´´

Activity

  1. JanHolger commented on Mar 24, 2021

    @JanHolger
    Member

    Because of the way inheritance works in java (fields aren't actually inherited to the child class, they only exist on the parent class) this would probably break the current implementation. I thought of this before because you sometimes have quite similar models and might want to inherit fields from a base class. This is something we should consider when rebuilding/decoupling the query builder.

  2. self-assigned this
    on Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions