javax.persistence.Inheritance.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中javax.persistence.Inheritance.<init>()方法的一些代码示例,展示了Inheritance.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Inheritance.<init>()方法的具体详情如下:
包路径:javax.persistence.Inheritance
类名称:Inheritance
方法名:<init>

Inheritance.<init>介绍

暂无

代码示例

代码示例来源:origin: ctripcorp/apollo

@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class BaseEntity {
 @Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 @Column(name = "Id")
 private long id;
 @Column(name = "IsDeleted", columnDefinition = "Bit default '0'")
 protected boolean isDeleted = false;
 @Column(name = "DataChange_CreatedBy", nullable = false)
 private String dataChangeCreatedBy;

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Andrea Boriero
 */
@javax.persistence.Entity
@Inheritance(strategy = InheritanceType.JOINED)
public interface TestEntityInterface extends Common {
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(schema = "schema1", name = "entity")
public static class Entity1 {
  private String id;
  @Id
  public String getId() {
    return id;
  }
  public void setId(String id) {
    this.id = id;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Test entities ANN-722.
 * 
 * @author Hardy Ferentschik
 *
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class B {
  @Id
  private int id;

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Andrea Boriero
 */

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class Mammal extends Animal {

  @Column(name = "IS_PREGNANT")
  @Type(type = "numeric_boolean")
  private boolean isPregnant;

  public boolean isPregnant() {
    return isPregnant;
  }

  public void setPregnant(boolean isPregnant) {
    this.isPregnant = isPregnant;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@MappedSuperclass
public static class Employee {
  @Id
  @GeneratedValue
  private Long id;
  private String jobType;
  private String firstName;
  private String lastName;
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "InheritanceRootEntity")
@Table(name = "InheritanceRootEntity", catalog = "hibernate_orm_test_collation", schema = "dbo")
@Inheritance(strategy = InheritanceType.JOINED)
public static class InheritanceRootEntity {
  @Id
  protected Long id;
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * The intermediate entity in the hierarchy
 *
 * @author Saša Obradović
 */
@Entity
@Table(name = "`ACCOUNT`")
@Inheritance(strategy = InheritanceType.JOINED)
public class Account extends AccountBase {
  public Account() {
  }

  public Account(String accountNumber) {
    super( accountNumber );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "BaseEntity")
@Inheritance(strategy = InheritanceType.JOINED)
public static abstract class BaseEntity {
  @Id
  private Long id;
  private String field;
  public Long getId() {
    return id;
  }
  public void setId(Long id) {
    this.id = id;
  }
  public String getField() {
    return field;
  }
  public void setField(String field) {
    this.field = field;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "Human")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public static class Human extends Animal {
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Entity having a many to one in its pk
 *
 * @author Emmanuel Bernard
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class Child {
  @EmbeddedId
  @AttributeOverride(name = "nthChild", column = @Column(name = "nth"))
  public ChildPk id;
}

代码示例来源:origin: hibernate/hibernate-orm

@MappedSuperclass
@Inheritance( strategy = InheritanceType.SINGLE_TABLE )
@DiscriminatorColumn( name = "type", discriminatorType = DiscriminatorType.STRING )
private static abstract class Item {
  @Id
  @GeneratedValue
  Long id;
  @ManyToOne( fetch = FetchType.LAZY )
  Author author;
}

代码示例来源:origin: hibernate/hibernate-orm

@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Entity(name = "Vehicle")
public static class Vehicle {
  @Id
  @GeneratedValue
  private Long id;
  private String name;
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Test entities ANN-730.
 * 
 * @author Hardy Ferentschik
 * 
 */
@Entity
@Table(name = "class_a")
@Inheritance(strategy = InheritanceType.JOINED)
public class ClassA {

  private int id;

  @Id
  @Column(name = "id")
  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "Human")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public static class Human {
  private Long realId;
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "realId")
  public Long getRealId() {
    return realId;
  }
  public void setRealId(Long realId) {
    this.realId = realId;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "RootTable")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract static class RootTable {
  @Id
  @GeneratedValue
  public int sysId;
}

代码示例来源:origin: BroadleafCommerce/BroadleafCommerce

/**
 * 
 * @author jfischer
 *
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_DYN_DISCRETE_ORDER_ITEM")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="blOrderElements")
@AdminPresentationClass(friendlyName = "DynamicPriceDiscreteOrderItemImpl_dynamicPriceOrderItem")
public class DynamicPriceDiscreteOrderItemImpl extends DiscreteOrderItemImpl implements DynamicPriceDiscreteOrderItem {

  private static final long serialVersionUID = 1L;

  @Override
  public void setSku(Sku sku) {
    this.sku = sku;
    this.name = sku.getName();
  }

  @Override
  public boolean updateSaleAndRetailPrices() {
    return false;
  }

}

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "Human")
@Inheritance(strategy = InheritanceType.JOINED)
public static class Human {
  private Long realId;
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "realId")
  public Long getRealId() {
    return realId;
  }
  public void setRealId(Long realId) {
    this.realId = realId;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Entity( name = "Animal" )
@Table( name = "animal" )
@Inheritance( strategy = InheritanceType.JOINED )
public static abstract class Animal {
  @Id
  public Integer id;
  protected Animal() {
  }
  protected Animal(Integer id) {
    this.id = id;
  }
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * @author Emmanuel Bernard
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "TBLASSET")
public class Asset {
  private Integer id;

  private Parent parent = null;

  @Id @GeneratedValue public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  @ManyToOne(targetEntity = Parent.class)
  @JoinColumn(name = "PARENTID")
  public Parent getParent() {
    return parent;
  }

  public void setParent(Parent parent) {
    this.parent = parent;
  }
}

相关文章