mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
44 lines
836 B
Java
44 lines
836 B
Java
package org.tests.inheritance;
|
|
|
|
import io.ebean.annotation.Index;
|
|
|
|
import javax.persistence.*;
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
/**
|
|
* Model class to reference an organization node.
|
|
*
|
|
* @author Christian Hartl, FOCONIS AG
|
|
*/
|
|
@Entity
|
|
@MappedSuperclass
|
|
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
|
@DiscriminatorColumn(name = "kind")
|
|
@Index(unique = false, columnNames = "kind")
|
|
public abstract class OrganizationNode {
|
|
|
|
@Id
|
|
private Long id;
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
@OneToOne(cascade = {})
|
|
@NotNull
|
|
private OrganizationTreeNode parentTreeNode;
|
|
|
|
public OrganizationTreeNode getParentTreeNode() {
|
|
return parentTreeNode;
|
|
}
|
|
|
|
public void setParentTreeNode(OrganizationTreeNode parentTreeNode) {
|
|
this.parentTreeNode = parentTreeNode;
|
|
}
|
|
|
|
}
|