javax.persistence.Embeddable类的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(119)

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

Embeddable介绍

暂无

代码示例

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

@Embeddable
  public static class Recorder {
    @NotNull
    @Column(name = "`time`")
    public BigDecimal time;
  }
}

代码示例来源:origin: hopshadoop/hopsworks

@Embeddable
public class FilesToRemovePK implements Serializable {
 @Basic(optional = false)
 @NotNull
 @Column(name = "execution_id")
 private long executionId;
 @Basic(optional = false)
 @NotNull
 @Size(min = 1,
   max = 255)
 @Column(name = "filepath")
 private String filepath;

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

@Embeddable
public class PolicyId implements Serializable {
  @Column(name="`type`", length=32)
  String type;
  DependentId depPK;
}

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

@Embeddable
public class ShoppingBasketsPK implements Serializable {
  private static final long serialVersionUID = 4121297376338222776L;
  @ManyToOne(cascade={ CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
  @JoinColumns({ @JoinColumn(name="customerID", referencedColumnName="customerID") })
  @Basic(fetch= FetchType.LAZY)
  private Customers owner;
  @Column(name="basketDatetime", nullable=false)
  @Id
  private java.util.Date basketDatetime;

代码示例来源:origin: callicoder/jpa-hibernate-tutorials

@Embeddable
public class Name {
  @NotNull
  @Size(max = 40)
  private String firstName;
  @Size(max = 40)
  private String middleName;
  @Size(max = 40)
  private String lastName;

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

/**
 * @author Brett Meyer
 */
@Embeddable
public class EmbeddableA {
  
  @Embedded
  @AttributeOverrides({@AttributeOverride(name = "embedAttrB" , column = @Column(table = "TableB"))})
  private EmbeddableB embedB;
  
  private String embedAttrA;

  public EmbeddableB getEmbedB() {
    return embedB;
  }

  public void setEmbedB(EmbeddableB embedB) {
    this.embedB = embedB;
  }

  public String getEmbedAttrA() {
    return embedAttrA;
  }

  public void setEmbedAttrA(String embedAttrA) {
    this.embedAttrA = embedAttrA;
  }

}

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

@Embeddable
public static class Tuner {
  @NotNull
  public String frequency;
}

代码示例来源:origin: Impetus/Kundera

@Embeddable
public class PhoneDirectory
  @Column
  private String phoneDirectoryName;
  @Column
  private List<String> contactName;
  @Column
  @Size(message = "The size should be at least equal to one but not more than 2", min = 1, max = 2)
  private Map<String, String> contactMap;

代码示例来源:origin: spring-projects/spring-framework

/**
 * Test candidate for {@link Embeddable}.
 *
 * @author Stephane Nicoll
 */
@Embeddable
public class SampleEmbeddable {
}

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

@Embeddable
public static class Identifier implements Serializable {
  private Integer id1;
  @Embedded
  private Identifier2 id2;
  public Identifier() {
  }
  public Identifier(Integer id1, Identifier2 id2) {
    this.id1 = id1;
    this.id2 = id2;
  }
}

代码示例来源:origin: com.clusterra/clusterra-pmbok-document

@Embeddable
public class Version {
  @Basic
  private Integer major;
  @Basic
  private Integer minor;

代码示例来源:origin: hopshadoop/hopsworks

@Embeddable
public class JupyterSettingsPK implements Serializable {
 @Basic(optional = false)
 @NotNull
 @Column(name = "project_id")
 private int projectId;
 @Basic(optional = false)
 @NotNull
 @Size(min = 1,
     max = 150)
 @Column(name = "team_member")
 private String email;

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

@Embeddable
public static class Phone {
  @Column
  private String mobile;
  public Phone() {}
  public Phone(String mobile) {
    this.mobile = mobile;
  }
}
//end::locking-jpa-query-hints-scope-entity-example[]

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

@Embeddable
public class BasketItemsPK implements Serializable {
  @ManyToOne(cascade={ CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
  @JoinColumns({ @JoinColumn(name="basketDatetime", referencedColumnName="basketDatetime"), @JoinColumn(name="customerID", referencedColumnName="customerID") })
  @Basic(fetch= FetchType.LAZY)
  private ShoppingBaskets shoppingBaskets;
  @Column(name="cost", nullable=false)
  @Id
  private Double cost;

代码示例来源:origin: callicoder/jpa-hibernate-tutorials

@Embeddable
public class EmployeeIdentity implements Serializable {
  @NotNull
  @Size(max = 20)
  private String employeeId;
  @NotNull
  @Size(max = 20)
  private String companyId;

代码示例来源:origin: Impetus/Kundera

@Embeddable
public class PersonalDetailEmbedded
  @Column(name="PHONENO")
  private long phoneNo;
  @Embedded
  private PhoneDirectory phone;

代码示例来源:origin: CollaborationInEncapsulation/get-reactive-with-spring5-demo

@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor(staticName = "of")
@EqualsAndHashCode
@Embeddable
public class Issue implements Serializable {
  @NonNull
  @NotNull
  @Getter
  private Long id;
}

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

/**
 * @author Chris Cranford
 */
@Embeddable
public class RoleExternal implements Role {
  public static String TYPE = "External";

  @Override
  public String getType() {
    return TYPE;
  }
}

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

@Embeddable
public class ContactInfo {
  @ManyToOne(cascade = CascadeType.ALL)
  List<PhoneNumber> phoneNumbers;
  @Embedded
  SocialTouchPoints social;

代码示例来源:origin: com.clusterra/pmbok-document

@Embeddable
public class Version {
  @Basic
  private Integer major;
  @Basic
  private Integer minor;

相关文章

微信公众号

最新文章

更多

Embeddable类方法