@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; } }