1 19 package org.apache.cayenne.jpa.enhancer; 20 21 import org.apache.cayenne.enhancer.AccessorVisitor; 22 import org.apache.cayenne.jpa.map.JpaClassDescriptor; 23 import org.apache.cayenne.jpa.map.JpaPropertyDescriptor; 24 import org.objectweb.asm.ClassVisitor; 25 26 29 class JpaAccessorVisitor extends AccessorVisitor { 30 31 private JpaClassDescriptor descriptor; 32 33 public JpaAccessorVisitor(ClassVisitor visitor, JpaClassDescriptor descriptor) { 34 super(visitor); 35 this.descriptor = descriptor; 36 } 37 38 @Override 39 protected boolean isEnhancedProperty(String property) { 40 return descriptor.getProperty(property) != null; 41 } 42 43 @Override 44 protected boolean isLazyFaulted(String property) { 45 JpaPropertyDescriptor propertyDescriptor = descriptor.getProperty(property); 46 47 return propertyDescriptor != null 50 && propertyDescriptor.getTargetEntityType() != null; 51 } 52 } 53 | Popular Tags |