@Test public void testKeyMaytches() { Column c1 = new Column(); c1.setName("one"); Column c2 = new Column(); c2.setName("two"); KeyRecord record = new KeyRecord(Type.Primary); record.addColumn(c1); record.addColumn(c2); ODataMetadataProcessor p = new ODataMetadataProcessor(); assertTrue(p.keyMatches(Arrays.asList("one", "one"), record)); assertTrue(p.keyMatches(Arrays.asList("two", "one"), record)); }
boolean keyMatches(List<String> names, KeyRecord record) { if (names.size() != record.getColumns().size()) { return false; } Set<String> keyNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (Column c: record.getColumns()) { keyNames.add(c.getName()); } for (int i = 0; i < names.size(); i++) { if (!keyNames.contains(names.get(i))) { return false; } } return true; }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { boolean keyMatches(List<String> names, KeyRecord record) { if (names.size() != record.getColumns().size()) { return false; } Set<String> keyNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (Column c: record.getColumns()) { keyNames.add(c.getName()); } for (int i = 0; i < names.size(); i++) { if (!keyNames.contains(names.get(i))) { return false; } } return true; } }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { boolean keyMatches(List<String> names, KeyRecord record) { if (names.size() != record.getColumns().size()) { return false; } Set<String> keyNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (Column c: record.getColumns()) { keyNames.add(c.getName()); } for (int i = 0; i < names.size(); i++) { if (!keyNames.contains(names.get(i))) { return false; } } return true; }  }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { boolean keyMatches(List<String> names, KeyRecord record) { if (names.size() != record.getColumns().size()) { return false; } Set<String> keyNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (Column c: record.getColumns()) { keyNames.add(c.getName()); } for (int i = 0; i < names.size(); i++) { if (!keyNames.contains(names.get(i))) { return false; } } return true; }  void setExecutionfactory(ODataExecutionFactory ef); @Override void process(MetadataFactory mf, WSConnection conn); void getMetadata(MetadataFactory mf, EdmDataServices eds); void setEntityContainer(String entityContainer); void setSchemaNamespace(String namespace); @TranslatorProperty(display="Entity Container Name", category=PropertyType.IMPORT, description="Entity Container Name to import") String getEntityContainer(); @TranslatorProperty(display="Schema Namespace", category=PropertyType.IMPORT, description="Namespace of the schema to import") String getSchemaNamespace(); }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { boolean keyMatches(List<String> names, KeyRecord record) { if (names.size() != record.getColumns().size()) { return false; } Set<String> keyNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (Column c: record.getColumns()) { keyNames.add(c.getName()); } for (int i = 0; i < names.size(); i++) { if (!keyNames.contains(names.get(i))) { return false; } } return true; }  void setExecutionfactory(ODataExecutionFactory ef); @Override void process(MetadataFactory mf, WSConnection conn); void getMetadata(MetadataFactory mf, EdmDataServices eds); void setEntityContainer(String entityContainer); void setSchemaNamespace(String namespace); @TranslatorProperty(display="Entity Container Name", category=PropertyType.IMPORT, description="Entity Container Name to import") String getEntityContainer(); @TranslatorProperty(display="Schema Namespace", category=PropertyType.IMPORT, description="Namespace of the schema to import") String getSchemaNamespace(); @ExtensionMetadataProperty(applicable=Table.class, datatype=String.class, display="Link Tables", description="Used to define navigation relationship in many to many case")
    static final String LINK_TABLES; @ExtensionMetadataProperty(applicable=Procedure.class, datatype=String.class, display="Http Method", description="Http method used for procedure invocation", required=true)
    static final String HTTP_METHOD; @ExtensionMetadataProperty(applicable=Column.class, datatype=Boolean.class, display="Join Column", description="On Link tables this property defines the join column")
    static final String JOIN_COLUMN; @ExtensionMetadataProperty(applicable= {Table.class, Procedure.class}, datatype=String.class, display="Entity Type Name", description="Name of the Entity Type in EDM", required=true)
    static final String ENTITY_TYPE; @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Complex Type Name", description="Name of the Complex Type in EDM")
    static final String COMPLEX_TYPE; @ExtensionMetadataProperty(applicable=Column.class, datatype=String.class, display="Column Group", description="Name of the Column Group")
    static final String COLUMN_GROUP; }