Example usage for org.hibernate.mapping ManyToOne setIgnoreNotFound

List of usage examples for org.hibernate.mapping ManyToOne setIgnoreNotFound

Introduction

In this page you can find the example usage for org.hibernate.mapping ManyToOne setIgnoreNotFound.

Prototype

public void setIgnoreNotFound(boolean ignoreNotFound) 

Source Link

Usage

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

/**
 * @param property/*from   w  w  w .  j  a  va2  s. co  m*/
 * @param manyToOne
 */
protected void bindUnidirectionalOneToManyInverseValues(GrailsDomainClassProperty property,
        ManyToOne manyToOne) {
    PropertyConfig config = getPropertyConfig(property);
    if (config != null) {
        manyToOne.setLazy(config.getLazy());
        manyToOne.setIgnoreNotFound(config.getIgnoreNotFound());
    } else {
        manyToOne.setLazy(true);
    }

    // set referenced entity
    manyToOne.setReferencedEntityName(property.getReferencedPropertyType().getName());
}

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

/**
 *///from   ww w.  j a v  a 2s.  c om
protected void bindManyToOneValues(GrailsDomainClassProperty property, ManyToOne manyToOne) {
    PropertyConfig config = getPropertyConfig(property);

    if (config != null && config.getFetch() != null) {
        manyToOne.setFetchMode(config.getFetch());
    } else {
        manyToOne.setFetchMode(FetchMode.DEFAULT);
    }

    manyToOne.setLazy(getLaziness(property));

    if (config != null) {
        manyToOne.setIgnoreNotFound(config.getIgnoreNotFound());
    }

    // set referenced entity
    manyToOne.setReferencedEntityName(property.getReferencedPropertyType().getName());
}

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.java

License:Apache License

/**
 * @param property/* w w w .  j av a 2s  .  c o  m*/
 * @param manyToOne
 */
private static void bindUnidirectionalOneToManyInverseValues(GrailsDomainClassProperty property,
        ManyToOne manyToOne) {
    PropertyConfig config = getPropertyConfig(property);
    if (config != null) {
        manyToOne.setLazy(config.getLazy());
        manyToOne.setIgnoreNotFound(config.getIgnoreNotFound());
    } else {
        manyToOne.setLazy(true);
    }

    // set referenced entity
    manyToOne.setReferencedEntityName(property.getReferencedPropertyType().getName());
}

From source file:org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.java

License:Apache License

/**
 */// www . ja v  a  2 s  . c o  m
private static void bindManyToOneValues(GrailsDomainClassProperty property, ManyToOne manyToOne) {
    PropertyConfig config = getPropertyConfig(property);

    if (config != null && config.getFetch() != null) {
        manyToOne.setFetchMode(config.getFetch());
    } else {
        manyToOne.setFetchMode(FetchMode.DEFAULT);
    }

    manyToOne.setLazy(getLaziness(property));

    if (config != null) {
        manyToOne.setIgnoreNotFound(config.getIgnoreNotFound());
    }

    // set referenced entity
    manyToOne.setReferencedEntityName(property.getReferencedPropertyType().getName());
}

From source file:org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

/**
 * @param property//from   ww  w .ja v  a 2s  .co  m
 * @param manyToOne
 */
protected void bindUnidirectionalOneToManyInverseValues(ToMany property, ManyToOne manyToOne) {
    PropertyConfig config = getPropertyConfig(property);
    if (config == null) {
        manyToOne.setLazy(true);
    } else {
        manyToOne.setIgnoreNotFound(config.getIgnoreNotFound());
        final FetchMode fetch = config.getFetchMode();
        if (!fetch.equals(FetchMode.JOIN) && !fetch.equals(FetchMode.EAGER)) {
            manyToOne.setLazy(true);
        }

        final Boolean lazy = config.getLazy();
        if (lazy != null) {
            manyToOne.setLazy(lazy);
        }
    }

    // set referenced entity
    manyToOne.setReferencedEntityName(property.getAssociatedEntity().getName());
}

From source file:org.grails.orm.hibernate.cfg.AbstractGrailsDomainBinder.java

License:Apache License

/**
 *///from  www  .j  a va2s .  c  o m
protected void bindManyToOneValues(org.grails.datastore.mapping.model.types.Association property,
        ManyToOne manyToOne) {
    PropertyConfig config = getPropertyConfig(property);

    if (config != null && config.getFetchMode() != null) {
        manyToOne.setFetchMode(config.getFetchMode());
    } else {
        manyToOne.setFetchMode(FetchMode.DEFAULT);
    }

    manyToOne.setLazy(getLaziness(property));

    if (config != null) {
        manyToOne.setIgnoreNotFound(config.getIgnoreNotFound());
    }

    // set referenced entity
    manyToOne.setReferencedEntityName(property.getAssociatedEntity().getName());
}