Example usage for javax.persistence FetchType LAZY

List of usage examples for javax.persistence FetchType LAZY

Introduction

In this page you can find the example usage for javax.persistence FetchType LAZY.

Prototype

FetchType LAZY

To view the source code for javax.persistence FetchType LAZY.

Click Source Link

Document

Defines that data can be lazily fetched.

Usage

From source file:com.hrdb.Department.java

@JsonInclude(Include.NON_EMPTY)
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE, mappedBy = "department")
public List<Employee> getEmployees() {
    return this.employees;
}

From source file:gov.nih.nci.cabig.caaers.domain.StudyAgent.java

/**
 * Gets the study agent ind associations internal.
 *
 * @return the study agent ind associations internal
 *///from  w  w w . j  a  v  a2 s.c o  m
@OneToMany(mappedBy = "studyAgent", fetch = FetchType.LAZY, orphanRemoval = true)
@Cascade({ CascadeType.ALL })
@Fetch(value = org.hibernate.annotations.FetchMode.SUBSELECT)
public List<StudyAgentINDAssociation> getStudyAgentINDAssociationsInternal() {
    return lazyListHelper.getInternalList(StudyAgentINDAssociation.class);
}

From source file:com.hmsinc.epicenter.model.attribute.PatientClass.java

/**
 * @return the interactions/*from  w ww  .  j  a  v a 2s . c  om*/
 */
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "patientClass")
public Set<Interaction> getInteractions() {
    return interactions;
}

From source file:com.infinities.skyport.entity.Role.java

@XmlTransient
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ORGANIZATIONID")
public Organization getOrganization() {
    return organization;
}

From source file:com.impetus.ankush.common.domain.Node.java

/**
 * @return the configuration/*from ww w.  ja va  2 s. c  o m*/
 */
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@JoinColumns({ @JoinColumn(name = "node", referencedColumnName = "publicIp") })
public List<Service> getServices() {
    return services;
}

From source file:gt.entities.Forum.java

@ManyToOne(fetch = FetchType.LAZY)
@JsonIgnoreProperties()/*from  w  w  w.ja v  a 2 s . c o  m*/
@JoinColumn(name = "idForumParent", referencedColumnName = "idForum", nullable = false, insertable = false, updatable = false)
public Forum getForumParent() {
    return forumParent;
}

From source file:org.dspace.orm.entity.Collection.java

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "logo_bitstream_id", nullable = true)
public Bitstream getLogo() {
    return logo;
}

From source file:com.hmsinc.epicenter.model.surveillance.SurveillanceSet.java

/**
 * @return the organization/*from  w w w  .  ja va2 s .  co m*/
 */
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinColumn(name = "ID_ORGANIZATION", unique = false, nullable = true, insertable = true, updatable = true)
@ForeignKey(name = "FK_SURVEILLANCE_SET_1")
public Organization getOrganization() {
    return organization;
}

From source file:com.hmsinc.epicenter.model.geography.State.java

/**
 * @return the counties/*from www.  j a  va  2  s.c om*/
 */
@XmlElementWrapper(name = "counties", namespace = "http://epicenter.hmsinc.com/model")
@XmlElement(name = "county", namespace = "http://epicenter.hmsinc.com/model")
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "state")
@Where(clause = "type = 'C'")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "com.hmsinc.epicenter.model.GeographyCache")
@Sort(type = SortType.NATURAL)
public Set<County> getCounties() {
    return counties;
}

From source file:com.eryansky.entity.base.User.java

@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
// ,????/*from  ww  w .  jav a  2 s. c  o  m*/
@JoinTable(name = "T_BASE_USER_ROLE", joinColumns = { @JoinColumn(name = "USER_ID") }, inverseJoinColumns = {
        @JoinColumn(name = "ROLE_ID") })
// Fecth
//   @Fetch(FetchMode.SUBSELECT)
// ?id?.
@OrderBy("id")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = CacheConstants.HIBERNATE_CACHE_BASE)
public List<Role> getRoles() {
    return roles;
}