本文整理汇总了Java中org.apache.olingo.odata2.api.edm.provider.Schema.setAssociations方法的典型用法代码示例。如果您正苦于以下问题:Java Schema.setAssociations方法的具体用法?Java Schema.setAssociations怎么用?Java Schema.setAssociations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.olingo.odata2.api.edm.provider.Schema
的用法示例。
在下文中一共展示了Schema.setAssociations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import org.apache.olingo.odata2.api.edm.provider.Schema; //导入方法依赖的package包/类
public Schema build() {
Schema s = new Schema();
s.setUsings(usings);
s.setEntityTypes(entityTypes);
s.setComplexTypes(complexTypes);
s.setAssociations(new ArrayList<Association>(name2Associations.values()));
s.setEntityContainers(entityContainers);
s.setAnnotationAttributes(annotationAttributes);
s.setAnnotationElements(annotationElements);
s.setNamespace(namespace);
return s;
}
示例2: createMockEdmSchema
import org.apache.olingo.odata2.api.edm.provider.Schema; //导入方法依赖的package包/类
public static Schema createMockEdmSchema() {
Schema schema = new Schema();
schema.setNamespace(NAMESPACE);
schema.setComplexTypes(createComplexTypes());
schema.setEntityContainers(createEntityContainer());
schema.setEntityTypes(createEntityTypes());
schema.setAssociations(createAssociations());
return schema;
}
示例3: getSchemas
import org.apache.olingo.odata2.api.edm.provider.Schema; //导入方法依赖的package包/类
@Override
public List<Schema> getSchemas() throws ODataException
{
List<Schema> schemas = new ArrayList<>();
Schema schema = new Schema();
schema.setNamespace(NAMESPACE);
fr.gael.dhus.database.object.User u = Security.getCurrentUser();
ArrayList<EntityType> entities = new ArrayList<>();
ArrayList<EntitySet> entitysets = new ArrayList<>();
ArrayList<Association> associations = new ArrayList<>();
ArrayList<AssociationSet> association_sets = new ArrayList<>();
List<FunctionImport> function_imports = new ArrayList<>();
for (AbstractEntitySet<?> entitySet: ENTITYSETS.values())
{
if (entitySet.isAuthorized(u))
{
entities.add(entitySet.getEntityType());
entitysets.add(entitySet.getEntitySet());
associations.addAll(entitySet.getAssociations());
association_sets.addAll(entitySet.getAssociationSets());
}
}
for (AbstractOperation op: OPERATIONS.values())
{
if (op.canExecute(u))
{
function_imports.add(op.getFunctionImport());
}
}
schema.setEntityTypes(entities);
schema.setComplexTypes(new ArrayList<>(COMPLEX_TYPES.values()));
schema.setAssociations(new ArrayList<>(associations));
EntityContainer entityContainer = new EntityContainer();
entityContainer.setName(ENTITY_CONTAINER).setDefaultEntityContainer(true);
entityContainer.setEntitySets(entitysets);
entityContainer.setAssociationSets(new ArrayList<>(association_sets));
entityContainer.setFunctionImports(function_imports);
schema.setEntityContainers(Collections.singletonList(entityContainer));
schemas.add(schema);
return schemas;
}
示例4: getSchemas
import org.apache.olingo.odata2.api.edm.provider.Schema; //导入方法依赖的package包/类
@Override
public List<Schema> getSchemas() throws ODataException {
List<Schema> schemas = new ArrayList<Schema>();
Schema schema = new Schema();
schema.setNamespace(NAMESPACE);
List<EntityType> entityTypes = new ArrayList<EntityType>();
entityTypes.add(getEntityType(ENTITY_TYPE_1_1));
entityTypes.add(getEntityType(ENTITY_TYPE_1_2));
schema.setEntityTypes(entityTypes);
List<ComplexType> complexTypes = new ArrayList<ComplexType>();
complexTypes.add(getComplexType(COMPLEX_TYPE));
schema.setComplexTypes(complexTypes);
List<Association> associations = new ArrayList<Association>();
associations.add(getAssociation(ASSOCIATION_CAR_MANUFACTURER));
schema.setAssociations(associations);
List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
EntityContainer entityContainer = new EntityContainer();
entityContainer.setName(ENTITY_CONTAINER).setDefaultEntityContainer(true);
List<EntitySet> entitySets = new ArrayList<EntitySet>();
entitySets.add(getEntitySet(ENTITY_CONTAINER, ENTITY_SET_NAME_CARS));
entitySets.add(getEntitySet(ENTITY_CONTAINER, ENTITY_SET_NAME_MANUFACTURERS));
entityContainer.setEntitySets(entitySets);
List<AssociationSet> associationSets = new ArrayList<AssociationSet>();
associationSets.add(getAssociationSet(ENTITY_CONTAINER, ASSOCIATION_CAR_MANUFACTURER,
ENTITY_SET_NAME_MANUFACTURERS, ROLE_1_2));
entityContainer.setAssociationSets(associationSets);
List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
functionImports.add(getFunctionImport(ENTITY_CONTAINER, FUNCTION_IMPORT));
entityContainer.setFunctionImports(functionImports);
entityContainers.add(entityContainer);
schema.setEntityContainers(entityContainers);
schemas.add(schema);
return schemas;
}
示例5: getSchemas
import org.apache.olingo.odata2.api.edm.provider.Schema; //导入方法依赖的package包/类
@Override
public List<Schema> getSchemas() throws ODataException {
List<Schema> schemas = new ArrayList<>();
Schema schema = new Schema();
schema.setNamespace(NAMESPACE);
List<EntityType> entityTypes = new ArrayList<>();
entityTypes.add(getEntityType(ENTITY_TYPE_1_1));
entityTypes.add(getEntityType(ENTITY_TYPE_1_2));
schema.setEntityTypes(entityTypes);
List<ComplexType> complexTypes = new ArrayList<>();
complexTypes.add(getComplexType(COMPLEX_TYPE));
schema.setComplexTypes(complexTypes);
List<Association> associations = new ArrayList<>();
associations.add(getAssociation(ASSOCIATION_CAR_MANUFACTURER));
schema.setAssociations(associations);
List<EntityContainer> entityContainers = new ArrayList<>();
EntityContainer entityContainer = new EntityContainer();
entityContainer.setName(ENTITY_CONTAINER).setDefaultEntityContainer(true);
List<EntitySet> entitySets = new ArrayList<>();
entitySets.add(getEntitySet(ENTITY_CONTAINER, ENTITY_SET_NAME_CARS));
entitySets.add(getEntitySet(ENTITY_CONTAINER, ENTITY_SET_NAME_MANUFACTURERS));
entityContainer.setEntitySets(entitySets);
List<AssociationSet> associationSets = new ArrayList<>();
associationSets.add(getAssociationSet(ENTITY_CONTAINER, ASSOCIATION_CAR_MANUFACTURER, ENTITY_SET_NAME_MANUFACTURERS, ROLE_1_2));
entityContainer.setAssociationSets(associationSets);
List<FunctionImport> functionImports = new ArrayList<>();
functionImports.add(getFunctionImport(ENTITY_CONTAINER, FUNCTION_IMPORT));
entityContainer.setFunctionImports(functionImports);
entityContainers.add(entityContainer);
schema.setEntityContainers(entityContainers);
schemas.add(schema);
return schemas;
}