本文整理汇总了Java中org.kuali.rice.krms.api.repository.typerelation.RelationshipType类的典型用法代码示例。如果您正苦于以下问题:Java RelationshipType类的具体用法?Java RelationshipType怎么用?Java RelationshipType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RelationshipType类属于org.kuali.rice.krms.api.repository.typerelation包,在下文中一共展示了RelationshipType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadTypeRelation
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
public void loadTypeRelation(String id, String fromTypeId, String toTypeId, String relType, Integer sequenceNumber) {
RelationshipType relationshipType = RelationshipType.USAGE_ALLOWED;
if (!relType.equals("A")) {
relationshipType = RelationshipType.UNKNOWN;
}
TypeTypeRelation.Builder bldr = TypeTypeRelation.Builder.create(fromTypeId, relationshipType, sequenceNumber, toTypeId);
bldr.setId(id);
bldr.setActive(true);
TypeTypeRelation existing = this.findExisting(bldr);
if (existing == null) {
this.getKrmsTypeRepositoryService().createTypeTypeRelation(bldr.build());
} else {
// consider comparing and only update if different!
bldr.setVersionNumber(existing.getVersionNumber());
this.getKrmsTypeRepositoryService().updateTypeTypeRelation(bldr.build());
}
}
示例2: test_updateTypeTypeRelation
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Test
public void test_updateTypeTypeRelation() {
test_createTypeTypeRelation();
TypeTypeRelation def = getTypeTypeRelation();
String id = def.getId();
assertNotEquals(RelationshipType.USAGE_ALLOWED, def.getRelationshipType());
TypeTypeRelationBo bo = typeTypeRelationBoServiceImpl.from(def);
bo.setRelationshipType(RelationshipType.USAGE_ALLOWED);
TypeTypeRelation updatedData = typeTypeRelationBoServiceImpl.updateTypeTypeRelation(TypeTypeRelation.Builder.create(bo).build());
assertNotNull(updatedData);
TypeTypeRelation def2 = typeTypeRelationBoServiceImpl.getTypeTypeRelation(id);
assertEquals(RelationshipType.USAGE_ALLOWED,def2.getRelationshipType());
}
示例3: findTypeTypeRelationsByRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
/**
* find type type relations by relationship type
*
* @param relationshipType to search on
* @return type type relations given the specified type
*/
@WebMethod(operationName = "findTypeTypeRelationsByRelationshipType")
@XmlElementWrapper(name = "typeTypeRelations", required = true)
@XmlElement(name = "typeTypeRelation", required = false)
@WebResult(name = "typeTypeRelations")
List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(@WebParam(name = "relationshipType") RelationshipType relationshipType)
throws RiceIllegalArgumentException;
示例4: findTypeTypeRelationsByRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(RelationshipType relationshipType)
throws RiceIllegalArgumentException {
List<TypeTypeRelation> list = new ArrayList<TypeTypeRelation>();
for (TypeTypeRelation rel : this.typeTypeRelationMap.values()) {
if (rel.getRelationshipType().equals(relationshipType)) {
list.add(rel);
}
}
return list;
}
示例5: convertToDatabaseColumn
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public String convertToDatabaseColumn(RelationshipType objectValue) {
if (objectValue != null) {
return objectValue.getCode();
}
return null;
}
示例6: convertToEntityAttribute
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public RelationshipType convertToEntityAttribute(String dataValue) {
RelationshipType result = null;
if (dataValue != null) {
result = RelationshipType.fromCode(dataValue);
}
return result;
}
示例7: findTypeTypeRelationsByRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(RelationshipType relationshipType) {
if (relationshipType == null) {
throw new IllegalArgumentException("relationshipType is null");
}
final Map<String, Object> map = new HashMap<String, Object>();
map.put("relationshipType", relationshipType);
List<TypeTypeRelationBo> bos = findMatching(dataObjectService, TypeTypeRelationBo.class, map);
return convertBosToImmutables(bos);
}
示例8: getCustomOperatorsKeyValuesForContextType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
/**
* Gets the {@link KeyValue}s for the {@link CustomOperator}s allowed to be used by the given context type.
*
* @param contextTypeId the context's type id
* @return the KeyValue list for the allowed custom operator types
*/
private List<KeyValue> getCustomOperatorsKeyValuesForContextType(String contextTypeId) {
List<KeyValue> keyValues = new ArrayList<KeyValue>();
if (contextTypeId == null) {
return keyValues;
}
// Runtime checking for the CustomOperator service interface needs to be done
List<TypeTypeRelation> typeRelations =
getTypeRepositoryService().findTypeTypeRelationsByFromType(contextTypeId);
for (TypeTypeRelation typeRelation : typeRelations) {
if (typeRelation.getRelationshipType().equals(RelationshipType.USAGE_ALLOWED)) {
KrmsTypeDefinition krmsType = getTypeRepositoryService().getTypeById(typeRelation.getToTypeId());
Object service = getTypeServiceImplementation(krmsType);
if (service != null && service instanceof CustomOperator) {
// Bingo, we have a custom operator to add to the list
keyValues.add(getKeyValueForCustomOperator(krmsType, (CustomOperator)service));
}
}
}
return keyValues;
}
示例9: javaToSql
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public Object javaToSql(Object source) throws ConversionException {
if (source instanceof RelationshipType) {
if (source != null) {
RelationshipType relationshipType = (RelationshipType) source;
return relationshipType.getCode();
}
}
return null;
}
示例10: sqlToJava
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public Object sqlToJava(Object source) throws ConversionException {
if (source instanceof String) {
if (source != null) {
String s = (String) source;
for (RelationshipType relType : RelationshipType.values()) {
if (relType.getCode().equals(s)) {
return relType;
}
}
}
}
return null;
}
示例11: test_updateTypeTypeRelation
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Test
public void test_updateTypeTypeRelation() {
test_createTypeTypeRelation();
TypeTypeRelation def = getTypeTypeRelation();
String id = def.getId();
assert(!RelationshipType.USAGE_ALLOWED.equals(def.getRelationshipType()));
TypeTypeRelationBo bo = typeTypeRelationBoServiceImpl.from(def);
bo.setRelationshipType(RelationshipType.USAGE_ALLOWED);
typeTypeRelationBoServiceImpl.updateTypeTypeRelation(TypeTypeRelation.Builder.create(bo).build());
TypeTypeRelation def2 = typeTypeRelationBoServiceImpl.getTypeTypeRelation(id);
assert(RelationshipType.USAGE_ALLOWED.equals(def2.getRelationshipType()));
}
示例12: findTypeTypeRelationsByRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(RelationshipType relationshipType) {
if (relationshipType == null) {
throw new IllegalArgumentException("relationshipType is null");
}
final Map<String, Object> map = new HashMap<String, Object>();
map.put("relationshipType", relationshipType);
List<TypeTypeRelationBo> bos = (List<TypeTypeRelationBo>) businessObjectService.findMatching(TypeTypeRelationBo.class, map);
return convertBosToImmutables(bos);
}
示例13: findTypeTypeRelationsByRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(RelationshipType relationshipType) {
return typeTypeRelationBoService.findTypeTypeRelationsByRelationshipType(relationshipType);
}
示例14: getRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public RelationshipType getRelationshipType() {
return this.relationshipType;
}
示例15: setRelationshipType
import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
/**
* Sets the value of relationshipType on this builder to the given value.
*
* @param relationshipType the relationshipType value to set.
*
*/
public void setRelationshipType(RelationshipType relationshipType) {
this.relationshipType = relationshipType;
}