本文整理了Java中javax.persistence.JoinColumn.<init>()
方法的一些代码示例,展示了JoinColumn.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JoinColumn.<init>()
方法的具体详情如下:
包路径:javax.persistence.JoinColumn
类名称:JoinColumn
方法名:<init>
暂无
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne
@JoinColumn( name = "store_id" )
public Store getStore() {
return store;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity
public static class E1 {
@Id
@Column( columnDefinition = "`explicitly quoted`" )
private Integer id;
@ManyToOne
@JoinColumn( columnDefinition = "`explicitly quoted`" )
private E1 other;
}
代码示例来源:origin: hibernate/hibernate-orm
/**
* @author Emmanuel Bernard
*/
@Entity
public class Trousers {
@Id
public Integer id;
@OneToOne
@JoinColumn(name = "zip_id")
public TrousersZip zip;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "SpecialPerson")
public static class SpecialPerson extends Person {
@Column(name = "special")
private String special;
@OneToMany(orphanRemoval = true, cascade = {
CascadeType.PERSIST,
CascadeType.REMOVE
})
@JoinColumn(name = "PERSONID", referencedColumnName = "ID", nullable = false, updatable = false)
@BatchSize(size = 100)
private Set<Address> addresses = new HashSet<Address>();
public void addAddress(Address address) {
this.addresses.add( address );
}
}
代码示例来源:origin: hibernate/hibernate-orm
@ElementCollection( targetClass = String.class, fetch = FetchType.EAGER )
@CollectionType( type = "DefaultableList" )
@JoinColumn( name = "ENT_ID" )
@OrderColumn( name = "POS" )
@Column(name = "VAL")
public List getValues() {
return values;
}
代码示例来源:origin: hibernate/hibernate-orm
/**
* @author Emmanuel Bernard
*/
@Entity
public class Dependent {
@EmbeddedId
DependentId id;
@MapsId("empPK")
@ManyToOne
@JoinColumns( { @JoinColumn(nullable = false), @JoinColumn(nullable = false) })
Employee emp;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity
public static class E2 {
@Id
@Column( columnDefinition = "not explicitly quoted" )
private Integer id;
@ManyToOne
@JoinColumn( columnDefinition = "not explicitly quoted" )
private E2 other;
}
}
代码示例来源:origin: hibernate/hibernate-orm
/**
* @author Emmanuel Bernard
*/
@Entity
@AssociationOverrides({
@AssociationOverride(name = "id.channel", joinColumns = @JoinColumn(name = "chan_id", nullable = false)),
@AssociationOverride(name = "id.presenter", joinColumns = @JoinColumn(name = "presenter_name", nullable = false))})
public class TvMagazin {
@EmbeddedId
public TvMagazinPk id;
@Temporal(TemporalType.TIME)
@Column(name="`time`")
Date time;
}
代码示例来源:origin: hibernate/hibernate-orm
@ElementCollection
@CollectionTable(
name = "MATERIAL_RATINGS",
joinColumns = { @JoinColumn( name = "MATERIAL_ID" ) }
)
@Column( name="RATING")
@Immutable
public Set<String> getRatings() {
return ratings;
}
public void setRatings(Set<String> ratings) {
代码示例来源:origin: hibernate/hibernate-orm
/**
* @author Emmanuel Bernard
*/
@Entity
public class Dependent {
@EmbeddedId
DependentId id;
//@JoinColumn(name="FK") // id attribute mapped by join column default
@MapsId("empPK") // maps empPK attribute of embedded id
@ManyToOne
@JoinColumn(nullable=false)
Employee emp;
}
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne
@JoinColumn
public Customer getCustomer() {
return customer;
}
代码示例来源:origin: hibernate/hibernate-orm
/**
* @author Emmanuel Bernard
*/
@Entity
public class Deal {
@Id @GeneratedValue public Integer id;
@ManyToOne @JoinColumn(referencedColumnName = "userId") public Customer from;
@ManyToOne @JoinColumn(referencedColumnName = "userId") public Customer to;
}
代码示例来源:origin: hibernate/hibernate-orm
@ElementCollection
@CollectionTable(
name = "COLLECTION_TABLE",
joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
)
@Column( name="VALUE")
@Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='SIZE'")
@Immutable
public Set<String> getSizesFromCombined() {
return sizesFromCombined;
}
public void setSizesFromCombined(Set<String> sizesFromCombined) {
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne
@JoinColumn(name="replacement_order_nbr", table="OrderLine_Extension", referencedColumnName = "order_nbr")
public Order getReplacementOrder() {
return replacementOrder;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "Box")
@Table(name = "Box", schema = "PUBLIC", catalog = "DB1")
public static class Box {
@Id
public Integer id;
@ManyToOne
@JoinColumn
public Thing thing1;
}
代码示例来源:origin: hibernate/hibernate-orm
@ElementCollection
@CollectionTable(
name = "COLLECTION_TABLE",
joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
)
@Column( name="VALUE")
@Where( clause = "MAIN_CODE='MATERIAL' AND VALUE_CODE='SIZE'")
@Immutable
public Set<String> getSizesFromCombined() {
return sizesFromCombined;
}
public void setSizesFromCombined(Set<String> sizesFromCombined) {
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class Id implements Serializable {
@ManyToOne
@JoinColumn
private Movie movie;
@ManyToOne
@JoinColumn
private Theater theater;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity
@Table(name = "Address")
private static class Address {
@Id @GeneratedValue
private Integer id;
@ManyToOne
@JoinColumn(name = "userId")
private User user;
@Column(nullable = false)
private String addressType;
@Column(nullable = false)
private String addressText;
}
代码示例来源:origin: hibernate/hibernate-orm
@ElementCollection
@CollectionTable(
name = "COLLECTION_TABLE",
joinColumns = { @JoinColumn( name = "MAIN_ID" ) }
)
@Column( name="VALUE")
@Where( clause = "MAIN_CODE='BUILDING' AND VALUE_CODE='RATING'" )
@Immutable
public Set<String> getRatingsFromCombined() {
return ratingsFromCombined;
}
public void setRatingsFromCombined(Set<String> ratingsFromCombined) {
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumns({
@JoinColumn(name = "parentName"),
@JoinColumn(name = "parentLevel")
})
public Node getParent() {
return parent;
}
内容来源于网络,如有侵权,请联系作者删除!