@Override public org.kuali.rice.krad.bo.DataObjectRelationship getDataObjectRelationship(Object dataObject, Class<?> dataObjectClass, String attributeName, String attributePrefix, boolean keysOnly, boolean supportsLookup, boolean supportsInquiry) { RelationshipDefinition ddReference = getDictionaryRelationship(dataObjectClass, attributeName); return dataObjectMetaDataService.getDataObjectRelationship(dataObject, dataObjectClass, attributeName, attributePrefix, keysOnly, supportsLookup, supportsInquiry); }
@Override public Class<?> getInquiryObjectClassIfNotTitle(Object dataObject, String propertyName) { Class<?> objectClass = ObjectUtils.materializeClassForProxiedObject(dataObject); org.kuali.rice.krad.bo.DataObjectRelationship relationship = dataObjectMetaDataService.getDataObjectRelationship(dataObject, objectClass, propertyName, "", true, false, true); if (relationship != null) { return relationship.getRelatedClass(); } return null; }
@Override public Map<String, String> getInquiryParameters(Object dataObject, List<String> keys, String propertyName) { Map<String, String> inquiryParameters = new HashMap<String, String>(); Class<?> objectClass = ObjectUtils.materializeClassForProxiedObject(dataObject); org.kuali.rice.krad.bo.DataObjectRelationship relationship = dataObjectMetaDataService.getDataObjectRelationship(dataObject, objectClass, propertyName, "", true, false, true); for (String keyName : keys) { String keyConversion = keyName; if (relationship != null) { keyConversion = relationship.getParentAttributeForChildAttribute(keyName); } else if (PropertyAccessorUtils.isNestedOrIndexedProperty(propertyName)) { String nestedAttributePrefix = KRADUtils.getNestedAttributePrefix(propertyName); keyConversion = nestedAttributePrefix + "." + keyName; } inquiryParameters.put(keyConversion, keyName); } return inquiryParameters; }
DataObjectRelationship boRel = getDataObjectMetaDataService().getDataObjectRelationship(bo, bo.getClass(), referenceName, "", true, false, false); final Map<String,String> fkMap = boRel != null ? boRel.getParentToChildReferences() : Collections.<String, String>emptyMap();