本文整理了Java中org.hibernate.annotations.Fetch.<init>()
方法的一些代码示例,展示了Fetch.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fetch.<init>()
方法的具体详情如下:
包路径:org.hibernate.annotations.Fetch
类名称:Fetch
方法名:<init>
暂无
代码示例来源:origin: hibernate/hibernate-orm
@OneToMany(cascade=CascadeType.ALL, mappedBy = "veryOldPerson")
@Fetch(FetchMode.SELECT)
public Collection<Stay> getVeryOldStays() {
return veryOldStays;
}
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne(targetEntity = Team.class)
@Fetch(FetchMode.SELECT)
@JoinColumn(name = "team_id")
public Team getTeam() {
return team;
}
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne(cascade = CascadeType.ALL)
@LazyToOne(LazyToOneOption.PROXY)
@Fetch(FetchMode.SELECT)
@JoinColumn(name = "oldperson")
public Person getOldPerson() {
return oldPerson;
}
代码示例来源:origin: hibernate/hibernate-orm
@OneToMany(cascade=CascadeType.ALL, mappedBy = "oldPerson")
@LazyCollection(LazyCollectionOption.EXTRA)
@Fetch(FetchMode.SUBSELECT)
public Collection<Stay> getOldStays() {
return oldStays;
}
代码示例来源:origin: hibernate/hibernate-orm
@OneToMany(targetEntity = Player.class, mappedBy = "team", fetch = FetchType.EAGER)
@Fetch(FetchMode.SELECT)
@Loader(namedQuery = "loadByTeam")
public Set<Player> getPlayers() {
return players;
}
代码示例来源:origin: hibernate/hibernate-orm
@OneToMany(targetEntity = ChildEntity.class, mappedBy = "parent")
@LazyCollection(LazyCollectionOption.EXTRA)
@Fetch(FetchMode.SELECT)
public Set<ChildEntity> getChildren() {
return children;
}
代码示例来源:origin: hibernate/hibernate-orm
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@LazyToOne(LazyToOneOption.PROXY)
@Fetch(FetchMode.JOIN)
@JoinColumn(name = "veryoldperson")
public Person getVeryOldPerson() {
return veryOldPerson;
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "Product")
public static class Product {
@Id
@GeneratedValue
private int id;
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "categoryId")
@Fetch(FetchMode.SELECT)
private Category category;
private ContainedCategory containedCategory;
@ElementCollection(fetch = FetchType.EAGER)
private Set<ContainedCategory> containedCategories = new HashSet<>();
}
代码示例来源:origin: hibernate/hibernate-orm
@Entity(name = "Product")
public static class Product {
@Id
@GeneratedValue
private int id;
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "categoryId")
@Fetch(FetchMode.JOIN)
private Category category;
private ContainedCategory containedCategory;
@ElementCollection(fetch = FetchType.EAGER)
private Set<ContainedCategory> containedCategories = new HashSet<>();
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class ContainedCategory {
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "containedCategoryId")
@Fetch(FetchMode.JOIN)
private Category category;
public ContainedCategory() {
}
public ContainedCategory(Category category) {
this.category = category;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class ContainedCategory {
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "containedCategoryId")
@Fetch(FetchMode.SELECT)
private Category category;
public ContainedCategory() {
}
public ContainedCategory(Category category) {
this.category = category;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@OneToOne(cascade = CascadeType.PERSIST)
@NotFound( action = NotFoundAction.IGNORE )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Fetch( FetchMode.JOIN )
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@ManyToOne(cascade = CascadeType.PERSIST)
@NotFound( action = NotFoundAction.IGNORE )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Fetch( FetchMode.JOIN )
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@OneToOne(cascade = CascadeType.PERSIST)
@NotFound( action = NotFoundAction.IGNORE )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Fetch( FetchMode.SELECT )
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@ManyToOne(cascade = CascadeType.PERSIST)
@NotFound( action = NotFoundAction.IGNORE )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Fetch( FetchMode.SELECT )
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@OneToOne(cascade = CascadeType.PERSIST)
@PrimaryKeyJoinColumn
@Fetch(FetchMode.JOIN )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@OneToMany(cascade=CascadeType.ALL)
@LazyCollection(LazyCollectionOption.EXTRA)
@Fetch(FetchMode.SUBSELECT)
@OrderColumn(name="orderedStayIndex")
public List<Stay> getOrderedStay() {
return orderedStay;
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@OneToOne(cascade = CascadeType.PERSIST)
@PrimaryKeyJoinColumn
@Fetch(FetchMode.SELECT )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@OneToOne
@MapsId
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "fk", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Fetch(FetchMode.JOIN)
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Embeddable
public static class CityInEmbeddable {
@OneToOne(cascade = CascadeType.PERSIST)
@PrimaryKeyJoinColumn
@NotFound(action = NotFoundAction.IGNORE)
@Fetch(FetchMode.JOIN )
@JoinColumn(foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private City city;
public City getCity() {
return city;
}
public void setCity(City city) {
this.city = city;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!