Java 类org.hibernate.annotations.Proxy 实例源码

项目:lams    文件:EntityBinder.java   
@SuppressWarnings({ "unchecked" })
public void setProxy(Proxy proxy) {
    if ( proxy != null ) {
        lazy = proxy.lazy();
        if ( !lazy ) {
            proxyClass = null;
        }
        else {
            if ( AnnotationBinder.isDefault(
                    mappings.getReflectionManager().toXClass( proxy.proxyClass() ), mappings
            ) ) {
                proxyClass = annotatedClass;
            }
            else {
                proxyClass = mappings.getReflectionManager().toXClass( proxy.proxyClass() );
            }
        }
    }
    else {
        lazy = true; //needed to allow association lazy loading.
        proxyClass = annotatedClass;
    }
}