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:org.openhie.openempi.model.PersonMatch.java

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "left_dataset_id", nullable = false)
public Dataset getLeftDataset() {
    return this.leftDataset;
}

From source file:org.openhie.openempi.model.PersonMatch.java

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "right_dataset_id"/*, nullable = false*/)
public Dataset getRightDataset() {
    return this.rightDataset;
}

From source file:org.openhie.openempi.model.PersonMatchRequest.java

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "dataset_id", nullable = false)
public Dataset getDataset() {
    return this.dataset;
}

From source file:org.openhie.openempi.model.PersonMatchRequest.java

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "creator_id"/*, nullable = false*/)
public User getUserCreatedBy() {
    return this.userCreatedBy;
}

From source file:org.openhie.openempi.model.UserFile.java

@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user_id", nullable = false)
public User getOwner() {
    return owner;
}

From source file:org.openlegacy.utils.ProxyUtil.java

private static void processField(Field field, Object proxy, Dehibernator dehibernator, boolean children,
        Map<Object, Object> processed)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    OneToMany otmAnnotation = field.getAnnotation(OneToMany.class);
    ManyToOne mtoAnnotation = field.getAnnotation(ManyToOne.class);

    if (otmAnnotation != null || mtoAnnotation != null) {
        if (children || (otmAnnotation != null && otmAnnotation.fetch().equals(FetchType.EAGER))
                || (mtoAnnotation != null && mtoAnnotation.fetch().equals(FetchType.EAGER))) {
            for (Method method : proxy.getClass().getMethods()) {
                if (method.getName().equals("get" + StringUtils.capitalize(field.getName()))) {
                    Object res = method.invoke(proxy, new Object[0]);
                    if (res != null) {
                        res.toString();/*from   ww w . j  a  v a2 s . c o  m*/
                        res = dehibernator.clean(res);
                        processed.put(proxy.getClass().getSimpleName(), proxy);
                        setFieldValue(field, proxy, res);
                        getTargetJpaObject(res, children, dehibernator, processed);
                    }
                }
            }
        } else {
            setFieldValue(field, proxy, null);
        }
    }
}

From source file:org.openremote.devicediscovery.domain.DiscoveredDevice.java

/**
 * Gets the device attrs./*  w  ww . ja  va 2  s  . c o m*/
 * 
 * @return the device attrs
 */
@OneToMany(mappedBy = "discoveredDevice", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
public List<DiscoveredDeviceAttr> getDeviceAttrs() {
    return deviceAttrs;
}

From source file:org.orcid.persistence.jpa.entities.ProfileEntity.java

/**
 * @return the primary profile for this deprecated account
 *//*from w ww  .ja  v  a  2s.co  m*/
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "primary_record")
public ProfileEntity getPrimaryRecord() {
    return this.primaryRecord;
}

From source file:org.projectforge.access.GroupTaskAccessDO.java

/**
 * Get the history entries for this object.
 * //from www  . j a  v  a 2  s.  c  o  m
 */
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
@JoinColumn(name = "group_task_access_fk", insertable = true, updatable = true)
public Set<AccessEntryDO> getAccessEntries() {
    return this.accessEntries;
}

From source file:org.projectforge.business.address.AddressDO.java

@OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", targetEntity = AddressAttrDO.class, orphanRemoval = true, fetch = FetchType.EAGER)
@MapKey(name = "propertyName")
@Override//from w ww  . j  av a2s  .co  m
@HistoryProperty(converter = TabAttrHistoryPropertyConverter.class)
public Map<String, JpaTabAttrBaseDO<AddressDO, Integer>> getAttrs() {
    return super.getAttrs();
}