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.cloud.utils.db.SqlGenerator.java

protected boolean supportsElementCollection(Field field) {
    ElementCollection otm = field.getAnnotation(ElementCollection.class);
    if (otm.fetch() == FetchType.LAZY) {
        assert (false) : "Doesn't support laz fetch: " + field.getName();
        return false;
    }/*from w  w  w .  j  av  a 2  s. com*/

    CollectionTable ct = field.getAnnotation(CollectionTable.class);
    if (ct == null) {
        assert (false) : "No collection table sepcified for " + field.getName();
        return false;
    }

    return true;
}

From source file:org.tonguetied.usermanagement.User.java

/**
 * @return the set of authorized permissions granted to a User
 *///from  w ww . j  a  v a  2 s .  c o  m
@CollectionOfElements(fetch = FetchType.LAZY)
@Sort(type = SortType.NATURAL)
@JoinTable(name = TABLE_AUTHORITIES, joinColumns = @JoinColumn(name = "user_id"))
@Cascade(CascadeType.ALL)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "authorities_generator")
@SequenceGenerator(name = "authorities_generator", sequenceName = "authorities_user_id_seq")
@ForeignKey(name = FK_AUTHORITIES)
public SortedSet<UserRight> getUserRights() {
    return userRights;
}

From source file:com.sccl.attech.modules.sys.entity.Office.java

@OneToMany(mappedBy = "office", fetch = FetchType.LAZY)
@Where(clause = "del_flag='" + DEL_FLAG_NORMAL + "'")
@OrderBy(value = "id")
@Fetch(FetchMode.SUBSELECT)//from  w w w  . ja  va 2  s .c o  m
@NotFound(action = NotFoundAction.IGNORE)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@JsonIgnore
public List<SmsRecords> getSmsRecords() {
    return smsRecords;
}

From source file:com.infinities.keystone4j.model.assignment.Project.java

@XmlTransient
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENTID", nullable = true)
public Project getParent() {
    return parent;
}

From source file:net.groupbuy.entity.Article.java

/**
 * ?
 * 
 * @return 
 */
@NotNull
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(nullable = false)
public ArticleCategory getArticleCategory() {
    return articleCategory;
}

From source file:ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentPE.java

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = ColumnNames.EXPERIMENT_COLUMN, updatable = false)
@Private//  www  .  ja  v  a  2  s. co m
// for Hibernate and bean conversion only
@ContainedIn
public ExperimentPE getExperimentParentInternal() {
    return experimentParent;
}

From source file:com.esoft.jdp2p.borrower.model.BorrowerAuthentication.java

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "marriage_certificate")
public AuthenticationMaterials getMarriageCertificate() {
    return this.marriageCertificate;
}

From source file:edu.ku.brc.specify.datamodel.Discipline.java

/**
 *      * @hibernate.many-to-one/*from   www  .  j  av  a  2s .c  om*/
 */
@ManyToOne(fetch = FetchType.LAZY)
@Cascade({ CascadeType.ALL })
@JoinColumn(name = "LithoStratTreeDefID")
public LithoStratTreeDef getLithoStratTreeDef() {
    return this.lithoStratTreeDef;
}

From source file:com.hmsinc.epicenter.model.health.Interaction.java

/**
 * @return the patientClass/*from ww w . j  a  v a2s .c o  m*/
 */
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ID_PATIENT_CLASS", unique = false, nullable = false, insertable = true, updatable = true)
@org.hibernate.annotations.ForeignKey(name = "FK_INTERACTION_4")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public PatientClass getPatientClass() {
    return patientClass;
}