Example usage for javax.persistence FetchType EAGER

List of usage examples for javax.persistence FetchType EAGER

Introduction

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

Prototype

FetchType EAGER

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

Click Source Link

Document

Defines that data must be eagerly fetched.

Usage

From source file:no.abmu.questionnaire.domain.data.SchemaDataImpl.java

/**
 * column="id"/*from w w w.ja v a2 s. c o  m*/
 * @hibernate.map table="FINANCE_POST_DATA" cascade="all" outer-join="true" batch-size="50" lazy="false"
 * @hibernate.key column="coll_key"
 * 
 * @hibernate.index column="code" type="string"
 * @hibernate.one-to-many class="no.abmu.finances.domain.PostData"
 * @hibernate.cache usage="nonstrict-read-write"
 * @hibernate.collection-key column="coll_key"
 * @hibernate.collection-index column="code" type="string"
 * @hibernate.collection-one-to-many column="id" class="no.abmu.finances.domain.PostData"
 *
 *    hibernate.collection-cache usage="nonstrict-read-write"
 */

@OneToMany(targetEntity = FieldDataImpl.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "SCHEMADATA_FIELDDATA_MAP", schema = DbSchemaNameConst.QUESTIONNAIRE_DB_SCHEMA_NAME)
@MapKey(columns = { @Column(name = "code") }, targetElement = String.class)
public Map<String, FieldData> getFieldData() {
    return fieldDataMap;
}

From source file:no.abmu.questionnaire.domain.metadata.FieldImpl.java

@OneToMany(cascade = CascadeType.ALL, targetEntity = FieldValidator.class, fetch = FetchType.EAGER)
@JoinColumn(name = "FK_FIELD_ID")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
//    @Fetch(FetchMode.SUBSELECT)
public Set getValidators() {
    return validators;
}

From source file:no.abmu.questionnarie.domain.Account.java

/**
 * @hibernate.set lazy="false"//from  www. j av  a  2  s  . co  m
 * table="FINANCE_ACCOUNT_POST"
 * cascade="save-update"
 * @hibernate.key column="FK_ACCOUNT_ID"
 * @hibernate.many-to-many class="no.abmu.finances.domain.Post"
 * column="FK_POST_ID"
 * @hibernate.cache usage="nonstrict-read-write"
 * @hibernate.collection-key column="FK_ACCOUNT_ID"
 * @hibernate.collection-many-to-many class="no.abmu.finances.domain.Post"
 * column="FK_POST_ID"
 */
@ManyToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER /* TODO FETCH */
)
@JoinTable(
        //            schema = "QUESTIONNARIE"
        name = "QUESTIONNARIE_ACCOUNT_POST", joinColumns = {
                @JoinColumn(name = "ACCOUNT_ID") }, inverseJoinColumns = { @JoinColumn(name = "POST_ID") })
public Set<Post> getPosts() {
    return posts;
}

From source file:no.abmu.questionnarie.domain.Account.java

/**
 * @hibernate.set lazy="true"//  ww  w  .j a  v a  2  s  .c o m
 * inverse="true"
 * cascade="save-update"
 * table="FINANCE_REPORT_SCHEMA_ACCOUNT"
 * @hibernate.key column="FK_ACCOUNT_ID"
 * @hibernate.many-to-many class="no.abmu.finances.domain.ReportSchema"
 * column="FK_REPORT_SCHEMA_ID"
 * @hibernate.cache usage="nonstrict-read-write"
 * @hibernate.collection-key column="FK_ACCOUNT_ID"
 * @hibernate.collection-many-to-many class="no.abmu.finances.domain.ReportSchema"
 * column="FK_REPORT_SCHEMA_ID"
 */
//    @ManyToMany(cascade = {CascadeType.ALL})
//    @ForeignKey(name = "FK_REPORT_SCHEMA_ID", inverseName = "FK_REPORT_SCHEMA_ID")
//    @JoinTable(
//            name = "QUESTIONNARIE_ACCOUNT_REPORTSCHEMA"
////            schema = "QUESTIONNARIE"
//    )
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER /* TODO FETCH */
)
@JoinTable(
        //            schema = "QUESTIONNARIE"
        name = "QUESTIONNARIE_ACCOUNT_MAIN_REPORT_SCHEMA", joinColumns = {
                @JoinColumn(name = "ACCOUNT_ID") }, inverseJoinColumns = { @JoinColumn(name = "RS_ID") })
//    @Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public Set<MainReportSchema> getMainReportSchemas() {
    return mainReportSchemas;
}

From source file:no.abmu.questionnarie.domain.Account.java

@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER /* TODO FETCH */
)
@JoinTable(// w  ww  .  j  a v  a 2 s .co m
        //            schema = "QUESTIONNARIE"
        name = "QUESTIONNARIE_ACCOUNT_SUB_REPORT_SCHEMA", joinColumns = {
                @JoinColumn(name = "ACCOUNT_ID") }, inverseJoinColumns = { @JoinColumn(name = "RS_ID") })
//    @Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public Set<SubReportSchema> getSubReportSchemas() {
    return subReportSchemas;
}

From source file:no.abmu.questionnarie.domain.MainReportData.java

@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER /* TODO FETCH */)
@MapKey(name = "code")
@JoinColumn(name = "mainreportdata_fk")
public Map<String, PostData> getPostData() {
    return super.getPostData();
}

From source file:no.abmu.questionnarie.domain.MainReportSchema.java

/**
 * @hibernate.set lazy="false"/*  w  w w . j av a  2s . c  o m*/
 * cascade="save-update"
 * table="FINANCE_REPORT_SCHEMA_ACCOUNT"
 * @hibernate.key column="FK_REPORT_SCHEMA_ID"
 * @hibernate.many-to-many class="no.abmu.finances.domain.Account"
 * column="FK_ACCOUNT_ID"
 * @hibernate.collection-key column="FK_REPORT_SCHEMA_ID"
 * @hibernate.collection-many-to-many class="no.abmu.finances.domain.Account"
 * column="FK_ACCOUNT_ID"
 */
//    @ManyToMany(cascade = {CascadeType.ALL})
//    @ForeignKey(name = "FK_REPORT_SCHEMA_ID", inverseName = "FK_ACCOUNT_ID")
//    @JoinTable(
////            schema = "QUESTIONNARIE"
//    )
@ManyToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, //TODO
        mappedBy = "mainReportSchemas")
//    @Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public Set<Account> getAccounts() {
    return super.getAccounts();
}

From source file:no.abmu.questionnarie.domain.ReportDataOrgUnitMapping.java

/**
 * unique_key="unique_orgunitid_repdata"
 *
 * @hibernate.set lazy="true"// www. jav a2  s. com
 * cascade="save-update"
 * table="FINANCE_REPDATA_ORGUNIT_MAPPING_REPORT_DATA"
 * @hibernate.key column="FK_MAPPING_ID"
 * @hibernate.many-to-many class="no.abmu.finances.domain.MainReportData"
 * column="FK_REPORT_DATA_ID"
 * @hibernate.collection-key column="FK_MAPPING_ID"
 * @hibernate.collection-many-to-many class="no.abmu.finances.domain.MainReportData"
 * column="FK_REPORT_DATA_ID"
 */
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "ORGUNIT_MAPPING_ID")
@NotNull
public Set<MainReportData> getReportDatas() {
    return reportDatas;
}

From source file:no.abmu.user.domain.UserGroup.java

/**
 * getPrincipalChildren.//from   w ww.  j  a  v a2s  . com
 * 
 * @return
 *
 * @hibernate.bag cascade="save-update" lazy="true" inverse="false"
 * @hibernate.key column="FK_GROUP_ID"
 * @hibernate.key-column name="FK_GROUP_ID" index="principal_FK_GROUP_ID_idx"
 * @hibernate.one-to-many class="no.abmu.user.domain.Principal"
 * @hibernate.collection-key column="FK_GROUP_ID"
 * @hibernate.collection-key-column name="FK_GROUP_ID" index="principal_FK_GROUP_ID_idx"
 * @hibernate.collection-one-to-many class="no.abmu.user.domain.Principal"
 */
@OneToMany(cascade = {
        CascadeType.ALL }, targetEntity = Principal.class, mappedBy = "parentGroup", fetch = FetchType.EAGER)
public List<Principal> getPrincipalChildren() {
    return principalChildren;
}

From source file:org.akaza.openclinica.domain.rule.RuleSetRuleBean.java

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@Fetch(value = FetchMode.SUBSELECT)/*w  w w . j  a  v  a2s .c o m*/
@JoinColumn(name = "rule_set_rule_id", nullable = false)
public List<RuleActionBean> getActions() {
    return actions;
}