8000 add support for @Inheritance · Issue #41 · buggins/hibernated · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
add support for @Inheritance #41
Open
@SingingBush

Description

@SingingBush

Hibernate allows support for inheritance making it possible to things like this:

@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="content_type", discriminatorType=DiscriminatorType.STRING)
@Table("site_content")
public class SiteContent {
    @Id
    @Generated
    public uint id;

    @Column("title") @NotNull
    public string title;

    @Column("content") @NotNull
    public string content; // LONGTEXT
}

@Entity
@DiscriminatorValue("wikipage")
public class WikiPage : SiteContent {}

@Entity
@DiscriminatorValue("blogpost")
public class BlogPost : SiteContent {}

More information on @Inheritance and the related annotations can be found here.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0