@OneToMany(cascade=CascadeType.ALL, mappedBy = "oldPerson") @LazyCollection(LazyCollectionOption.EXTRA) @Fetch(FetchMode.SUBSELECT) public Collection<Stay> getOldStays() { return oldStays; }
@OneToMany(mappedBy = "forum", cascade = CascadeType.ALL , orphanRemoval = true, fetch = FetchType.LAZY) @LazyCollection(LazyCollectionOption.EXTRA) @OrderColumn(name = "idx3") public List<User> getUsers() { return users; }
@OneToMany(mappedBy = "post", cascade = CascadeType.ALL , orphanRemoval = false, fetch = FetchType.LAZY) @LazyCollection(LazyCollectionOption.EXTRA) @OrderColumn(name = "idx") public List<Comment> getComments() { return comments; }
@OneToMany(targetEntity = ChildEntity.class, mappedBy = "parent") @LazyCollection(LazyCollectionOption.EXTRA) @Fetch(FetchMode.SELECT) public Set<ChildEntity> getChildren() { return children; }
@OneToMany(mappedBy = "forum", cascade = CascadeType.ALL , orphanRemoval = false, fetch = FetchType.LAZY) @LazyCollection(LazyCollectionOption.EXTRA) @OrderColumn(name = "idx2") public List<Comment> getPosts() { return posts; }
@Entity(name = "Parent") public static class Parent { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", orphanRemoval = true) @LazyCollection( value = LazyCollectionOption.EXTRA) private Set<Child> children = new HashSet<Child>(); public Parent() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Set<Child> getChildren() { return children; } public void addChild(Child child) { children.add(child); child.setParent(this); } public void removeChild(Child child) { children.remove(child); child.setParent(null); } }
@OneToMany(cascade=CascadeType.ALL) @LazyCollection(LazyCollectionOption.EXTRA) @Fetch(FetchMode.SUBSELECT) @OrderColumn(name="orderedStayIndex") public List<Stay> getOrderedStay() { return orderedStay; }
@Entity(name = "Department") public static class Department { @Id private Long id; @OneToMany(mappedBy = "department", cascade = CascadeType.ALL) @OrderColumn(name = "order_id") @LazyCollection( LazyCollectionOption.EXTRA ) private List<Employee> employees = new ArrayList<>(); //Getters and setters omitted for brevity //end::fetching-LazyCollection-domain-model-example[] public Long getId() { return id; } public void setId(Long id) { this.id = id; } public List<Employee> getEmployees() { return employees; } public void setEmployees(List<Employee> employees) { this.employees = employees; } public void addEmployee(Employee employee) { this.employees.add( employee ); employee.setDepartment( this ); } //tag::fetching-LazyCollection-domain-model-example[] }
@ManyToMany @LazyCollection(LazyCollectionOption.FALSE) public Set<Site> getSites() { return sites; }
@ElementCollection @LazyCollection(LazyCollectionOption.FALSE) public Set<String> getAuthorities() { return authorities; }
@ElementCollection @LazyCollection(LazyCollectionOption.FALSE) public Set<String> getScopes() { return scopes; }
@ElementCollection @LazyCollection(LazyCollectionOption.FALSE) public Set<String> getResourceIds() { return resourceIds; }
@ManyToMany( targetEntity = InteractionImpl.class, mappedBy = "experiments", cascade = CascadeType.REMOVE ) @LazyCollection(LazyCollectionOption.EXTRA) @OrderBy("created") public Collection<Interaction> getInteractions() { return interactions; }
@ManyToMany( targetEntity = InteractionImpl.class, mappedBy = "experiments", cascade = CascadeType.REMOVE ) @LazyCollection(LazyCollectionOption.EXTRA) @OrderBy("created") public Collection<Interaction> getInteractions() { return interactions; }
@LazyCollection(LazyCollectionOption.FALSE) private Map<String, String> properties;
@LazyCollection(LazyCollectionOption.FALSE) private Map<String, String> properties;
@Override @ManyToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.LAZY, targetEntity = JpaProduct.class) @JoinTable(name = DBNamespace.TABLE_PREFIX + "product_category_product") @IndexColumn(name = "product_position") @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA) public List<ProductData> getProducts() { return super.getProducts(); }
/** * User: ntoro * Date: 06/11/2013 * Time: 13:18 */ @Entity @DiscriminatorValue(value = "GENE") public class GeneGroup extends ProteinGroup { @ManyToMany @JoinTable(name = "PROT_PGRP", schema = "PRIDEPROT", inverseJoinColumns = @JoinColumn(name = "PROTEIN_ID"), joinColumns = @JoinColumn(name = "PROT_GROUP_ID")) @LazyCollection(LazyCollectionOption.TRUE) private Collection<Protein> geneProteins; public Collection<Protein> getGeneProteins() { return geneProteins; } public void setGeneProteins(Collection<Protein> proteins) { this.geneProteins = proteins; } }
/** * User: ntoro * Date: 06/11/2013 * Time: 13:18 */ //This group identified all the proteins and isoform under the same Uniprot Entry @Entity @DiscriminatorValue(value = "ENTRY") public class EntryGroup extends ProteinGroup { @ManyToMany @JoinTable(name = "PROT_PGRP", schema = "PRIDEPROT", inverseJoinColumns = @JoinColumn(name = "PROTEIN_ID"), joinColumns = @JoinColumn(name = "PROT_GROUP_ID")) @LazyCollection(LazyCollectionOption.TRUE) private Collection<Protein> entryProteins; public Collection<Protein> getEntryProteins() { return entryProteins; } public void setEntryProteins(Collection<Protein> proteins) { this.entryProteins = proteins; } }
@LazyCollection(LazyCollectionOption.FALSE) private Set<IdentifierKeyValuePair> identifiers = new HashSet<>(); private String categoryName;