private static String getAssociationKey(Schema schema, Association association) { return schema.getNamespace() + "~" + association.getName(); }
public static void addCrossServiceNavigationPropertyName(IServiceInfo mashService, Schema schema, String sourceEntityTypeName, String navigationPropertyName) throws EdmException { synchronized (__crossServiceNavigationPropertyNamesByEntityTypeKey) { HashSet<String> navigationPropertyNames; String key = getServiceKey(mashService) + "~" + getEntityTypeKey(schema.getNamespace(), sourceEntityTypeName); if (!__crossServiceNavigationPropertyNamesByEntityTypeKey.containsKey(key)) { navigationPropertyNames = new HashSet<String>(); __crossServiceNavigationPropertyNamesByEntityTypeKey.put(key, navigationPropertyNames); } else { navigationPropertyNames = __crossServiceNavigationPropertyNamesByEntityTypeKey.get(key); } navigationPropertyNames.add(navigationPropertyName); } }
private static String getEntitySetKey(Schema schema, EntityContainer container, EntitySet set) { return schema.getNamespace() + "~" + container.getName() + "~" + set.getName(); }
@Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.getName().equals(edmFQName.getName())) { return entityType; } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (ComplexType complexType : schema.getComplexTypes()) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (ComplexType complexType : schema.getComplexTypes()) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } } return null; }
@Override public ComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (ComplexType complexType : schema.getComplexTypes()) { if (complexType.getName().equals(edmFQName.getName())) { return complexType; } } } } return null; }
@Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (association.getName().equals(edmFQName.getName())) { return association; } } } } return null; }
@Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (association.getName().equals(edmFQName.getName())) { return association; } } } } return null; }
@Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.getName().equals(edmFQName.getName())) { return entityType; } } } } return null; }
@Override public Association getAssociation(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (Association association : schema.getAssociations()) { if (association.getName().equals(edmFQName.getName())) { return association; } } } } return null; }
@Override public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException { for (Schema schema : dataServices.getSchemas()) { if (schema.getNamespace().equals(edmFQName.getNamespace())) { for (EntityType entityType : schema.getEntityTypes()) { if (entityType.getName().equals(edmFQName.getName())) { return entityType; } } } } return null; }
private void finish() { // Collection<ContainerBuilder> containers = containerName2ContainerBuilder.values(); for (ContainerBuilder containerBuilder : containers) { SchemaBuilder schemaBuilder = namespace2SchemaBuilder.get(containerBuilder.getNamespace()); containerBuilder.addAssociationSets(schemaBuilder.name2Associations.values()); final EntityContainer container = containerBuilder.build(); schemaBuilder.addEntityContainer(container); name2Container.put(container.getName(), container); if (container.isDefaultEntityContainer()) { defaultContainer = container; } } // Collection<SchemaBuilder> schemaBuilders = namespace2SchemaBuilder.values(); for (SchemaBuilder schemaBuilder : schemaBuilders) { final Schema schema = schemaBuilder.build(); namespace2Schema.put(schema.getNamespace(), schema); } }
private void finish() throws ODataException { // Collection<ContainerBuilder> containers = containerName2ContainerBuilder.values(); for (ContainerBuilder containerBuilder : containers) { SchemaBuilder schemaBuilder = namespace2SchemaBuilder.get(containerBuilder.getNamespace()); containerBuilder.addAssociationSets(schemaBuilder.name2Associations.values()); final EntityContainer container = containerBuilder.build(); schemaBuilder.addEntityContainer(container); name2Container.put(container.getName(), container); if (container.isDefaultEntityContainer()) { defaultContainer = container; } } // Collection<SchemaBuilder> schemaBuilders = namespace2SchemaBuilder.values(); for (SchemaBuilder schemaBuilder : schemaBuilders) { final Schema schema = schemaBuilder.build(); namespace2Schema.put(schema.getNamespace(), schema); } }
private void finish() throws ODataException { // Collection<ContainerBuilder> containers = containerName2ContainerBuilder.values(); for (ContainerBuilder containerBuilder : containers) { SchemaBuilder schemaBuilder = namespace2SchemaBuilder.get(containerBuilder.getNamespace()); containerBuilder.addAssociationSets(schemaBuilder.name2Associations.values()); final EntityContainer container = containerBuilder.build(); schemaBuilder.addEntityContainer(container); name2Container.put(container.getName(), container); if (container.isDefaultEntityContainer()) { defaultContainer = container; } } // Collection<SchemaBuilder> schemaBuilders = namespace2SchemaBuilder.values(); for (SchemaBuilder schemaBuilder : schemaBuilders) { final Schema schema = schemaBuilder.build(); namespace2Schema.put(schema.getNamespace(), schema); } }
@Override public List<AliasInfo> getAliasInfos() { List<AliasInfo> aliasInfos = new ArrayList<AliasInfo>(); for (Schema schema : dataServices.getSchemas()) { if (schema.getAlias() != null) { aliasInfos.add(new AliasInfo().setAlias(schema.getAlias()).setNamespace(schema.getNamespace())); } } return aliasInfos; } }
@Override public List<AliasInfo> getAliasInfos() { List<AliasInfo> aliasInfos = new ArrayList<AliasInfo>(); for (Schema schema : dataServices.getSchemas()) { if (schema.getAlias() != null) { aliasInfos.add(new AliasInfo().setAlias(schema.getAlias()).setNamespace(schema.getNamespace())); } } return aliasInfos; } }
@Override public List<AliasInfo> getAliasInfos() { List<AliasInfo> aliasInfos = new ArrayList<AliasInfo>(); for (Schema schema : dataServices.getSchemas()) { if (schema.getAlias() != null) { aliasInfos.add(new AliasInfo().setAlias(schema.getAlias()).setNamespace(schema.getNamespace())); } } return aliasInfos; } }
@Override public List<AliasInfo> getAliasInfos() throws ODataException { List<AliasInfo> aliasInfos = new ArrayList<AliasInfo>(); List<Schema> schemas = (List<Schema>) getSchemas(); if (schemas == null) { return null; } for (Schema schema : schemas) { if (schema.getAlias() != null) { aliasInfos.add(new AliasInfo().setAlias(schema.getAlias()).setNamespace(schema.getNamespace())); } } return aliasInfos; }
private void includeAssociationSet(Schema targetSchema, EntityContainer targetContainer, IServiceInfo service, AssociationSet sourceSet) throws ODataException { List<AssociationSet> sets = targetContainer.getAssociationSets(); if (sets != null) { for (AssociationSet set : sets) { if (set.getName().equals(sourceSet.getName())) { throw new ODataException("association set " + sourceSet.getName() + " already defined"); } } } else { sets = new ArrayList<AssociationSet>(); } AssociationSet newSet = clone(sourceSet); newSet.setAssociation(new FullQualifiedName( targetSchema.getNamespace(), newSet.getAssociation().getName())); sets.add(newSet); targetContainer.setAssociationSets(sets); }