当前位置: 首页>>代码示例>>Java>>正文


Java RelationshipType类代码示例

本文整理汇总了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());
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:KrmsTypeRelationLoader.java

示例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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:TypeTypeRelationIntegrationGenTest.java

示例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;
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:KrmsTypeRepositoryService.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:KrmsTypeRepositoryServiceMockImpl.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:RelationshipTypeConverter.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:RelationshipTypeConverter.java

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:TypeTypeRelationBoServiceImpl.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:PropositionOpCodeValuesFinder.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:OjbRelationshipTypeStringConversion.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:OjbRelationshipTypeStringConversion.java

示例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()));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:13,代码来源:TypeTypeRelationIntegrationGenTest.java

示例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);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:11,代码来源:TypeTypeRelationBoServiceImpl.java

示例13: findTypeTypeRelationsByRelationshipType

import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(RelationshipType relationshipType) {
    return typeTypeRelationBoService.findTypeTypeRelationsByRelationshipType(relationshipType);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:KrmsTypeRepositoryServiceImpl.java

示例14: getRelationshipType

import org.kuali.rice.krms.api.repository.typerelation.RelationshipType; //导入依赖的package包/类
@Override
public RelationshipType getRelationshipType() {
    return this.relationshipType;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:TypeTypeRelationBo.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:TypeTypeRelationBo.java


注:本文中的org.kuali.rice.krms.api.repository.typerelation.RelationshipType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。