• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RelationshipDefinition类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.kuali.rice.krad.datadictionary.RelationshipDefinition的典型用法代码示例。如果您正苦于以下问题:Java RelationshipDefinition类的具体用法?Java RelationshipDefinition怎么用?Java RelationshipDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RelationshipDefinition类属于org.kuali.rice.krad.datadictionary包,在下文中一共展示了RelationshipDefinition类的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getRelationshipEntriesForSourceAttribute

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipEntriesForSourceAttribute(String entryName, String sourceAttributeName) {
    List<String> relationships = new ArrayList<String>();

    DataDictionaryEntryBase entry =
            (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

    for (RelationshipDefinition def : entry.getRelationships()) {
        for (PrimitiveAttributeDefinition pddef : def.getPrimitiveAttributes()) {
            if (StringUtils.equals(sourceAttributeName, pddef.getSourceName())) {
                relationships.add(def.getObjectAttributeName());
                break;
            }
        }
    }
    return relationships;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:TestDataDictionaryService.java

示例2: getRelationshipEntriesForTargetAttribute

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipEntriesForTargetAttribute(String entryName, String targetAttributeName) {
    List<String> relationships = new ArrayList<String>();

    DataDictionaryEntryBase entry =
            (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

    for (RelationshipDefinition def : entry.getRelationships()) {
        for (PrimitiveAttributeDefinition pddef : def.getPrimitiveAttributes()) {
            if (StringUtils.equals(targetAttributeName, pddef.getTargetName())) {
                relationships.add(def.getObjectAttributeName());
                break;
            }
        }
    }
    return relationships;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:TestDataDictionaryService.java

示例3: getRelationshipDefinition

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
/**
 * @param entryName
 * @param relationshipName
 * @return RelationshipDefinition for the given entryName and relationshipName, or null if there is none
 */
private RelationshipDefinition getRelationshipDefinition(String entryName, String relationshipName) {
    if (StringUtils.isBlank(relationshipName)) {
        throw new IllegalArgumentException("invalid (blank) relationshipName");
    }

    RelationshipDefinition relationshipDefinition = null;

    DataDictionaryEntryBase entry =
            (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);
    if (entry != null) {
        relationshipDefinition = entry.getRelationshipDefinition(relationshipName);
    }

    return relationshipDefinition;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:21,
代码来源:TestDataDictionaryService.java

示例4: getRelationshipMetadata

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
protected org.kuali.rice.krad.bo.DataObjectRelationship getRelationshipMetadata(Class<?> dataObjectClass,
        String attributeName, String attributePrefix) {

    RelationshipDefinition relationshipDefinition = getDictionaryRelationship(dataObjectClass, attributeName);
    if (relationshipDefinition == null) {
        return null;
    }

    org.kuali.rice.krad.bo.DataObjectRelationship dataObjectRelationship =
            new org.kuali.rice.krad.bo.DataObjectRelationship(relationshipDefinition.getSourceClass(),
                    relationshipDefinition.getObjectAttributeName(), relationshipDefinition.getTargetClass());

    if (!StringUtils.isEmpty(attributePrefix)) {
        attributePrefix += ".";
    }

    List<PrimitiveAttributeDefinition> primitives = relationshipDefinition.getPrimitiveAttributes();
    for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitives) {
        dataObjectRelationship.getParentToChildReferences().put(
                attributePrefix + primitiveAttributeDefinition.getSourceName(),
                primitiveAttributeDefinition.getTargetName());
    }

    return dataObjectRelationship;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:KRADLegacyDataAdapterImpl.java

示例5: getRelationshipEntriesForSourceAttribute

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipEntriesForSourceAttribute(String entryName, String sourceAttributeName) {
       List<String> relationships = new ArrayList<String>();

       DataDictionaryEntryBase entry =
               (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

       for (RelationshipDefinition def : entry.getRelationships()) {
           for (PrimitiveAttributeDefinition pddef : def.getPrimitiveAttributes()) {
               if (StringUtils.equals(sourceAttributeName, pddef.getSourceName())) {
                   relationships.add(def.getObjectAttributeName());
                   break;
               }
           }
       }
       return relationships;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:DataDictionaryServiceImpl.java

示例6: getRelationshipEntriesForTargetAttribute

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipEntriesForTargetAttribute(String entryName, String targetAttributeName) {
       List<String> relationships = new ArrayList<String>();

       DataDictionaryEntryBase entry =
               (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

       for (RelationshipDefinition def : entry.getRelationships()) {
           for (PrimitiveAttributeDefinition pddef : def.getPrimitiveAttributes()) {
               if (StringUtils.equals(targetAttributeName, pddef.getTargetName())) {
                   relationships.add(def.getObjectAttributeName());
                   break;
               }
           }
       }
       return relationships;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:DataDictionaryServiceImpl.java

示例7: getRelationshipMetadata

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
protected DataObjectRelationship getRelationshipMetadata(Class<?> dataObjectClass, String attributeName,
        String attributePrefix) {

    RelationshipDefinition relationshipDefinition = getDictionaryRelationship(dataObjectClass, attributeName);
    if (relationshipDefinition == null) {
        return null;
    }

    DataObjectRelationship dataObjectRelationship = new DataObjectRelationship(
            relationshipDefinition.getSourceClass(), relationshipDefinition.getObjectAttributeName(),
            relationshipDefinition.getTargetClass());

    if (!StringUtils.isEmpty(attributePrefix)) {
        attributePrefix += ".";
    }

    List<PrimitiveAttributeDefinition> primitives = relationshipDefinition.getPrimitiveAttributes();
    for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitives) {
        dataObjectRelationship.getParentToChildReferences().put(
                attributePrefix + primitiveAttributeDefinition.getSourceName(),
                primitiveAttributeDefinition.getTargetName());
    }

    return dataObjectRelationship;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:26,
代码来源:DataObjectMetaDataServiceImpl.java

示例8: buildRelationshipMap

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
private ExportMap buildRelationshipMap(RelationshipDefinition relationship) {
    ExportMap relationshipMap = new ExportMap(relationship.getObjectAttributeName());

    ExportMap attributesMap = new ExportMap("primitiveAttributes");

    int count = 0;
    for (PrimitiveAttributeDefinition primitiveAttributeDefinition : relationship.getPrimitiveAttributes()) {
        ExportMap attributeMap = new ExportMap(Integer.toString(count++));
        attributeMap.set("sourceName", primitiveAttributeDefinition.getSourceName());
        attributeMap.set("targetName", primitiveAttributeDefinition.getTargetName());

        attributesMap.set(attributeMap);
    }

    relationshipMap.set(attributesMap);

    return relationshipMap;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:RelationshipsMapBuilder.java

示例9: getForeignKeyFieldName

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
   public String getForeignKeyFieldName(Class businessObjectClass, String attributeName, String targetName) {

	String fkName = "";

	// first try DD-based relationships
	RelationshipDefinition relationshipDefinition = getDictionaryRelationship(businessObjectClass, attributeName);

	if (relationshipDefinition != null) {
		List<PrimitiveAttributeDefinition> primitives = relationshipDefinition.getPrimitiveAttributes();
		for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitives) {
			if (primitiveAttributeDefinition.getTargetName().equals(targetName)) {
				fkName = primitiveAttributeDefinition.getSourceName();
				break;
			}
		}
	}

	// if we can't find anything in the DD, then try the persistence service
	if (StringUtils.isBlank(fkName) && PersistableBusinessObject.class.isAssignableFrom(businessObjectClass)
			&& getPersistenceStructureService().isPersistable(businessObjectClass)) {
		fkName = getPersistenceStructureService().getForeignKeyFieldName(businessObjectClass, attributeName,
				targetName);
	}
	return fkName;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:27,
代码来源:BusinessObjectMetaDataServiceImpl.java

示例10: getRelationshipEntriesForSourceAttribute

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
public List<String> getRelationshipEntriesForSourceAttribute(String entryName, String sourceAttributeName) {
    List<String> relationships = new ArrayList<String>();

    DataDictionaryEntryBase entry =
            (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

    for (RelationshipDefinition def : entry.getRelationships()) {
        for (PrimitiveAttributeDefinition pddef : def.getPrimitiveAttributes()) {
            if (StringUtils.equals(sourceAttributeName, pddef.getSourceName())) {
                relationships.add(def.getObjectAttributeName());
                break;
            }
        }
    }
    return relationships;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:17,
代码来源:DataDictionaryServiceImpl.java

示例11: getRelationshipEntriesForTargetAttribute

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
public List<String> getRelationshipEntriesForTargetAttribute(String entryName, String targetAttributeName) {
    List<String> relationships = new ArrayList<String>();

    DataDictionaryEntryBase entry =
            (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

    for (RelationshipDefinition def : entry.getRelationships()) {
        for (PrimitiveAttributeDefinition pddef : def.getPrimitiveAttributes()) {
            if (StringUtils.equals(targetAttributeName, pddef.getTargetName())) {
                relationships.add(def.getObjectAttributeName());
                break;
            }
        }
    }
    return relationships;
}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:17,
代码来源:DataDictionaryServiceImpl.java

示例12: getForeignKeyFieldName

点赞 3

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
public String getForeignKeyFieldName(Class businessObjectClass, String attributeName, String targetName) {

		String fkName = "";

		// first try DD-based relationships
		RelationshipDefinition relationshipDefinition = getDictionaryRelationship(businessObjectClass, attributeName);

		if (relationshipDefinition != null) {
			List<PrimitiveAttributeDefinition> primitives = relationshipDefinition.getPrimitiveAttributes();
			for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitives) {
				if (primitiveAttributeDefinition.getTargetName().equals(targetName)) {
					fkName = primitiveAttributeDefinition.getSourceName();
					break;
				}
			}
		}

		// if we can't find anything in the DD, then try the persistence service
		if (StringUtils.isBlank(fkName) && PersistableBusinessObject.class.isAssignableFrom(businessObjectClass)
				&& getPersistenceStructureService().isPersistable(businessObjectClass)) {
			fkName = getPersistenceStructureService().getForeignKeyFieldName(businessObjectClass, attributeName,
					targetName);
		}
		return fkName;
	}
 

开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:26,
代码来源:BusinessObjectMetaDataServiceImpl.java

示例13: verifyDefaultedRelationship_existence

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Test
public void verifyDefaultedRelationship_existence() {
    DataObjectEntry dataObjectEntry = getDataObjectEntry(MAIN_DATA_OBJECT_FOR_TESTING);
    String relationshipName = "referencedObject";
    RelationshipDefinition relationshipDefinition = dataObjectEntry.getRelationshipDefinition(relationshipName);
    assertNotNull(relationshipName + " should have been present in the relationship list", relationshipDefinition );
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:8,
代码来源:DataDictionaryMetadataDefaultingTest.java

示例14: retrieveExternalizableBusinessObjectsList

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
/**
 * This method assumes that the externalizableClazz is an interface
 * and gets the concrete implementation for it
 *
 * {@inheritDoc}
 */
@Override
public List<? extends ExternalizableBusinessObject> retrieveExternalizableBusinessObjectsList(
        BusinessObject businessObject, String externalizableRelationshipName, Class externalizableClazz) {

    if (businessObject == null) {
        return null;
    }
    //Get the business object entry for this business object from data dictionary
    //using the class name (without the package) as key
    String className = businessObject.getClass().getName();
    String key = className.substring(className.lastIndexOf(".") + 1);
    BusinessObjectEntry entry =
            KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntries().get(
                    key);
    RelationshipDefinition relationshipDefinition = entry.getRelationshipDefinition(externalizableRelationshipName);
    List<PrimitiveAttributeDefinition> primitiveAttributeDefinitions =
            relationshipDefinition.getPrimitiveAttributes();
    Map<String, Object> fieldValuesInEBO = new HashMap<String, Object>();
    Object sourcePropertyValue;
    for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitiveAttributeDefinitions) {
        sourcePropertyValue = KradDataServiceLocator.getDataObjectService().wrap(businessObject).getPropertyValueNullSafe(
                primitiveAttributeDefinition.getSourceName());
        if (sourcePropertyValue == null) {
            return null;
        }
        fieldValuesInEBO.put(primitiveAttributeDefinition.getTargetName(), sourcePropertyValue);
    }
    return getExternalizableBusinessObjectsList(getExternalizableBusinessObjectImplementation(externalizableClazz),
            fieldValuesInEBO);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:37,
代码来源:RemoteModuleServiceBase.java

示例15: getRelationshipSourceClass

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public Class<? extends BusinessObject> getRelationshipSourceClass(String entryName, String relationshipName) {
    Class sourceClass = null;

    RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
    if (rd != null) {
        sourceClass = rd.getSourceClass();
    }

    return sourceClass;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:TestDataDictionaryService.java

示例16: getRelationshipTargetClass

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public Class<? extends BusinessObject> getRelationshipTargetClass(String entryName, String relationshipName) {
    Class targetClass = null;

    RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
    if (rd != null) {
        targetClass = rd.getTargetClass();
    }

    return targetClass;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:TestDataDictionaryService.java

示例17: getRelationshipSourceAttributes

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipSourceAttributes(String entryName, String relationshipName) {
    List<String> sourceAttributes = null;

    RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
    if (rd != null) {
        sourceAttributes = new ArrayList<String>();

        for (PrimitiveAttributeDefinition pad : rd.getPrimitiveAttributes()) {
            sourceAttributes.add(pad.getSourceName());
        }
    }

    return sourceAttributes;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TestDataDictionaryService.java

示例18: getRelationshipTargetAttributes

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipTargetAttributes(String entryName, String relationshipName) {
    List<String> targetAttributes = null;

    RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
    if (rd != null) {
        targetAttributes = new ArrayList<String>();

        for (PrimitiveAttributeDefinition pad : rd.getPrimitiveAttributes()) {
            targetAttributes.add(pad.getTargetName());
        }
    }

    return targetAttributes;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TestDataDictionaryService.java

示例19: getRelationshipAttributeMap

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DataDictionaryService#getRelationshipAttributeMap(java.lang.String, java.lang.String)
 */
@Override
public Map<String, String> getRelationshipAttributeMap(String entryName, String relationshipName) {
    Map<String, String> attributeMap = new HashMap<String, String>();
    RelationshipDefinition relationshipDefinition = getRelationshipDefinition(entryName, relationshipName);
    for (Iterator iter = relationshipDefinition.getPrimitiveAttributes().iterator(); iter.hasNext(); ) {
        PrimitiveAttributeDefinition attribute = (PrimitiveAttributeDefinition) iter.next();
        attributeMap.put(attribute.getTargetName(), attribute.getSourceName());
    }
    return attributeMap;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:14,
代码来源:TestDataDictionaryService.java

示例20: getRelationshipNames

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipNames(String entryName) {
    DataDictionaryEntryBase entry =
            (DataDictionaryEntryBase) getDataDictionary().getDictionaryObjectEntry(entryName);

    List<String> relationshipNames = new ArrayList<String>();
    for (RelationshipDefinition def : entry.getRelationships()) {
        relationshipNames.add(def.getObjectAttributeName());
    }
    return relationshipNames;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:TestDataDictionaryService.java

示例21: getRelationshipSourceClass

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public Class<? extends BusinessObject> getRelationshipSourceClass(String entryName, String relationshipName) {
       Class sourceClass = null;

       RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
       if (rd != null) {
           sourceClass = rd.getSourceClass();
       }

       return sourceClass;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:DataDictionaryServiceImpl.java

示例22: getRelationshipTargetClass

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public Class<? extends BusinessObject> getRelationshipTargetClass(String entryName, String relationshipName) {
       Class targetClass = null;

       RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
       if (rd != null) {
           targetClass = rd.getTargetClass();
       }

       return targetClass;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:DataDictionaryServiceImpl.java

示例23: getRelationshipSourceAttributes

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipSourceAttributes(String entryName, String relationshipName) {
       List<String> sourceAttributes = null;

       RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
       if (rd != null) {
           sourceAttributes = new ArrayList<String>();

           for (PrimitiveAttributeDefinition pad : rd.getPrimitiveAttributes()) {
               sourceAttributes.add(pad.getSourceName());
           }
       }

       return sourceAttributes;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:DataDictionaryServiceImpl.java

示例24: getRelationshipTargetAttributes

点赞 2

import org.kuali.rice.krad.datadictionary.RelationshipDefinition; //导入依赖的package包/类
@Override
public List<String> getRelationshipTargetAttributes(String entryName, String relationshipName) {
       List<String> targetAttributes = null;

       RelationshipDefinition rd = getRelationshipDefinition(entryName, relationshipName);
       if (rd != null) {
           targetAttributes = new ArrayList<String>();

           for (PrimitiveAttributeDefinition pad : rd.getPrimitiveAttributes()) {
               targetAttributes.add(pad.getTargetName());
           }
       }

       return targetAttributes;
   }
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:DataDictionaryServiceImpl.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)