/** * INTERNAL: * Set the getter and setter access methods for this accessor. */ protected void setAccessorMethods(DatabaseMapping mapping) { if (usesPropertyAccess() || usesVirtualAccess()) { if (usesVirtualAccess()) { mapping.setAttributeAccessor(new VirtualAttributeAccessor()); } mapping.setGetMethodName(getGetMethodName()); mapping.setSetMethodName(getSetMethodName()); } }
/** * Update the targetMapping to have the same accessor as the originMapping * @param originMapping * @param targetMapping */ private static void copyAccessorToMapping(DatabaseMapping originMapping, DatabaseMapping targetMapping) { if (originMapping.getAttributeAccessor().isVirtualAttributeAccessor()) { VirtualAttributeAccessor accessor = new VirtualAttributeAccessor(); accessor.setGetMethodName(originMapping.getGetMethodName()); accessor.setSetMethodName(originMapping.getSetMethodName()); targetMapping.setAttributeAccessor(accessor); } if (originMapping.getAttributeAccessor().isValuesAccessor()) { ValuesAccessor accessor = new ValuesAccessor(originMapping); accessor.setAttributeName(originMapping.getAttributeAccessor().getAttributeName()); targetMapping.setAttributeAccessor(accessor); } else { targetMapping.setAttributeName(originMapping.getAttributeName()); targetMapping.setGetMethodName(originMapping.getGetMethodName()); targetMapping.setSetMethodName(originMapping.getSetMethodName()); } }
/** * Update the targetMapping to have the same accessor as the originMapping * @param originMapping * @param targetMapping */ private static void copyAccessorToMapping(DatabaseMapping originMapping, DatabaseMapping targetMapping) { if (originMapping.getAttributeAccessor().isVirtualAttributeAccessor()) { VirtualAttributeAccessor accessor = new VirtualAttributeAccessor(); accessor.setGetMethodName(originMapping.getGetMethodName()); accessor.setSetMethodName(originMapping.getSetMethodName()); targetMapping.setAttributeAccessor(accessor); } if (originMapping.getAttributeAccessor().isValuesAccessor()) { ValuesAccessor accessor = new ValuesAccessor(originMapping); accessor.setAttributeName(originMapping.getAttributeAccessor().getAttributeName()); targetMapping.setAttributeAccessor(accessor); } else { targetMapping.setAttributeName(originMapping.getAttributeName()); targetMapping.setGetMethodName(originMapping.getGetMethodName()); targetMapping.setSetMethodName(originMapping.getSetMethodName()); } }
Mapping mapping = generateMapping(next, descriptor, descriptorJavaClass, namespaceInfo); if (next.isVirtual()) { VirtualAttributeAccessor accessor = new VirtualAttributeAccessor(); accessor.setAttributeName(mapping.getAttributeName());
Mapping mapping = generateMapping(next, descriptor, descriptorJavaClass, namespaceInfo); if (next.isVirtual()) { VirtualAttributeAccessor accessor = new VirtualAttributeAccessor(); accessor.setAttributeName(mapping.getAttributeName());