HHH-11986 - @LazyGroup is ignored on LazyToOne association with 'mappedBy'

HHH-11986 - Re-format fix code to follow code conventions
This commit is contained in:
Viefhaus 2017-09-20 10:11:08 +02:00 committed by Gail Badner
parent 3292a83223
commit 4531b22e92
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import javax.persistence.ConstraintMode;
import org.hibernate.AnnotationException;
import org.hibernate.MappingException;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.LazyGroup;
import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.cfg.annotations.PropertyBinder;
@ -102,6 +103,12 @@ public class OneToOneSecondPass implements SecondPass {
binder.setValue( value );
binder.setCascade( cascadeStrategy );
binder.setAccessType( inferredData.getDefaultAccess() );
final LazyGroup lazyGroupAnnotation = inferredData.getProperty().getAnnotation( LazyGroup.class );
if ( lazyGroupAnnotation != null ) {
binder.setLazyGroup( lazyGroupAnnotation.value() );
}
Property prop = binder.makeProperty();
prop.setOptional( optional );
if ( BinderHelper.isEmptyAnnotationValue( mappedBy ) ) {