public boolean isLazy() { if ( value instanceof ToOne ) { // both many-to-one and one-to-one are represented as a // Property. EntityPersister is relying on this value to // determine "lazy fetch groups" in terms of field-level // interception. So we need to make sure that we return // true here for the case of many-to-one and one-to-one // with lazy="no-proxy" // // * impl note - lazy="no-proxy" currently forces both // lazy and unwrap to be set to true. The other case we // are extremely interested in here is that of lazy="proxy" // where lazy is set to true, but unwrap is set to false. // thus we use both here under the assumption that this // return is really only ever used during persister // construction to determine the lazy property/field fetch // groupings. If that assertion changes then this check // needs to change as well. Partially, this is an issue with // the overloading of the term "lazy" here... ToOne toOneValue = ( ToOne ) value; return toOneValue.isLazy() && toOneValue.isUnwrapProxy(); } return lazy; }
public boolean isLazy() { if ( value instanceof ToOne ) { // both many-to-one and one-to-one are represented as a // Property. EntityPersister is relying on this value to // determine "lazy fetch groups" in terms of field-level // interception. So we need to make sure that we return // true here for the case of many-to-one and one-to-one // with lazy="no-proxy" // // * impl note - lazy="no-proxy" currently forces both // lazy and unwrap to be set to true. The other case we // are extremely interested in here is that of lazy="proxy" // where lazy is set to true, but unwrap is set to false. // thus we use both here under the assumption that this // return is really only ever used during persister // construction to determine the lazy property/field fetch // groupings. If that assertion changes then this check // needs to change as well. Partially, this is an issue with // the overloading of the term "lazy" here... ToOne toOneValue = ( ToOne ) value; return toOneValue.isLazy() && toOneValue.isUnwrapProxy(); } return lazy; }
public boolean isLazy() { if ( value instanceof ToOne ) { // both many-to-one and one-to-one are represented as a // Property. EntityPersister is relying on this value to // determine "lazy fetch groups" in terms of field-level // interception. So we need to make sure that we return // true here for the case of many-to-one and one-to-one // with lazy="no-proxy" // // * impl note - lazy="no-proxy" currently forces both // lazy and unwrap to be set to true. The other case we // are extremely interested in here is that of lazy="proxy" // where lazy is set to true, but unwrap is set to false. // thus we use both here under the assumption that this // return is really only ever used during persister // construction to determine the lazy property/field fetch // groupings. If that assertion changes then this check // needs to change as well. Partially, this is an issue with // the overloading of the term "lazy" here... ToOne toOneValue = ( ToOne ) value; return toOneValue.isLazy() && toOneValue.isUnwrapProxy(); } return lazy; }
public boolean isLazy() { if ( value instanceof ToOne ) { // both many-to-one and one-to-one are represented as a // Property. EntityPersister is relying on this value to // determine "lazy fetch groups" in terms of field-level // interception. So we need to make sure that we return // true here for the case of many-to-one and one-to-one // with lazy="no-proxy" // // * impl note - lazy="no-proxy" currently forces both // lazy and unwrap to be set to true. The other case we // are extremely interested in here is that of lazy="proxy" // where lazy is set to true, but unwrap is set to false. // thus we use both here under the assumption that this // return is really only ever used during persister // construction to determine the lazy property/field fetch // groupings. If that assertion changes then this check // needs to change as well. Partially, this is an issue with // the overloading of the term "lazy" here... ToOne toOneValue = ( ToOne ) value; return toOneValue.isLazy() && toOneValue.isUnwrapProxy(); } return lazy; }
@Override public boolean isLazy() { if ( value instanceof ToOne ) { // both many-to-one and one-to-one are represented as a // Property. EntityPersister is relying on this value to // determine "lazy fetch groups" in terms of field-level // interception. So we need to make sure that we return // true here for the case of many-to-one and one-to-one // with lazy="no-proxy" // // * impl note - lazy="no-proxy" currently forces both // lazy and unwrap to be set to true. The other case we // are extremely interested in here is that of lazy="proxy" // where lazy is set to true, but unwrap is set to false. // thus we use both here under the assumption that this // return is really only ever used during persister // construction to determine the lazy property/field fetch // groupings. If that assertion changes then this check // needs to change as well. Partially, this is an issue with // the overloading of the term "lazy" here... ToOne toOneValue = ( ToOne ) value; return toOneValue.isLazy() && toOneValue.isUnwrapProxy(); } return lazy; }
if (property.getValue() instanceof ToOne) { ToOne toOne = (ToOne)property.getValue(); if (toOne.isLazy()) { toOne.setUnwrapProxy(true);
public String getFetchType(Property property) { Value value = property.getValue(); String fetchType = importType( "javax.persistence.FetchType"); boolean lazy = false; if ( value instanceof ToOne ) { lazy = ( (ToOne) value ).isLazy(); } else if ( value instanceof Collection ) { lazy = ( (Collection) value ).isLazy(); } else { //we're not collection neither *toone so we are looking for property fetching lazy = property.isLazy(); } if ( lazy ) { return fetchType + "." + "LAZY"; } else { return fetchType + "." + "EAGER"; } }
public String getFetchType(Property property) { Value value = property.getValue(); String fetchType = importType( "javax.persistence.FetchType"); boolean lazy = false; if ( value instanceof ToOne ) { lazy = ( (ToOne) value ).isLazy(); } else if ( value instanceof Collection ) { lazy = ( (Collection) value ).isLazy(); } else { //we're not collection neither *toone so we are looking for property fetching lazy = property.isLazy(); } if ( lazy ) { return fetchType + "." + "LAZY"; } else { return fetchType + "." + "EAGER"; } }