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.hmsinc.epicenter.model.health.Interaction.java

@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumn(name = "ID_PATIENT_DETAIL", unique = false, nullable = false, insertable = true, updatable = true)
@org.hibernate.annotations.ForeignKey(name = "FK_INTERACTION_3")
public PatientDetail getPatientDetail() {
    return this.patientDetail;
}

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

@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinTable(name = "T_BASE_USER_RESOURCE", joinColumns = {
        @JoinColumn(name = "RESOURCE_ID") }, inverseJoinColumns = { @JoinColumn(name = "USER_ID") })
public List<User> getUsers() {
    return users;
}

From source file:de.pro.dbw.file.reflection.api.ReflectionModel.java

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = JOIN_TABLE__NAME__MAPPING_REFLECTION_COMMENT, joinColumns = @JoinColumn(name = IReflectionCommentConfiguration.REFLECTION_COMMENT_MODEL__COLUMN_NAME__ID), inverseJoinColumns = @JoinColumn(name = IReflectionCommentConfiguration.REFLECTION_COMMENT_MODEL__COLUMN_NAME__ID))
public List<ReflectionCommentModel> getReflectionCommentModels() {
    if (reflectionCommentModelsProperty == null) {
        return _reflectionCommentModels;
    } else {/*w  ww .  j  av a2 s.c om*/
        return (List<ReflectionCommentModel>) reflectionCommentModelsProperty.getValue();
    }
}

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "submitter", nullable = true)
public EpersonGroup getSubmitter() {
    return submitter;
}

From source file:com.hmsinc.epicenter.model.workflow.Event.java

/**
 * @return the organization/*from ww  w  . j ava 2 s  . c o m*/
 */
@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumn(name = "ID_ORGANIZATION", unique = false, nullable = false, insertable = true, updatable = true)
@ForeignKey(name = "FK_EVENT_1")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public Organization getOrganization() {
    return organization;
}

From source file:gov.nih.nci.caarray.domain.protocol.Protocol.java

/**
 * Gets the parameters./*from   ww  w.  j av  a 2 s  . c om*/
 *
 * @return the parameters
 */
@OneToMany(mappedBy = "protocol", fetch = FetchType.LAZY)
@Cascade(CascadeType.SAVE_UPDATE)
public Set<Parameter> getParameters() {
    return this.parameters;
}

From source file:com.jasperreports.hrdb.Employee.java

@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "employee")
public List<Vacation> getVacations() {
    return this.vacations;
}

From source file:com.hmsinc.epicenter.model.permission.EpiCenterRole.java

/**
 * @return the users//ww w .  j av  a  2s .  c o  m
 */
@ManyToMany(cascade = { CascadeType.PERSIST,
        CascadeType.MERGE }, fetch = FetchType.LAZY, mappedBy = "roles", targetEntity = EpiCenterUser.class)
@ForeignKey(name = "FK_APP_USER_ROLE_1", inverseName = "FK_APP_USER_ROLE_2")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public Set<EpiCenterUser> getUsers() {
    return users;
}

From source file:com.jeefuse.system.security.model.GsysResource.java

/**
 * ------------------------------------------------------------------------
 * gsysRelRoleResources//  w w w.  j a  v  a2  s. c om
 * ------------------------------------------------------------------------
 * @generated
 */
@OneToMany(fetch = FetchType.LAZY, mappedBy = "gsysResource", cascade = CascadeType.REMOVE)
public List<GsysRelRoleResource> getGsysRelRoleResources() {
    if (this.gsysRelRoleResources == null) {
        this.gsysRelRoleResources = new ArrayList<GsysRelRoleResource>();
    }
    return gsysRelRoleResources;
}

From source file:edu.harvard.med.screensaver.model.AttachedFile.java

@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "screenId", nullable = true, updatable = false)
@org.hibernate.annotations.ForeignKey(name = "fk_attached_file_to_screen")
@org.hibernate.annotations.LazyToOne(value = org.hibernate.annotations.LazyToOneOption.PROXY)
@ToOne(hasNonconventionalSetterMethod = true /* mutually-exclusive parenting relationships */)
public Screen getScreen() {
    return _screen;
}