@Test public void testFindByElement() throws Exception { MetadataField found = MetadataField.findByElement(context, MetadataSchema.DC_SCHEMA_ID, element, qualifier); assertThat("testFindByElement 0",found, notNullValue()); assertThat("testFindByElement 1",found.getFieldID(), equalTo(mf.getFieldID())); assertThat("testFindByElement 2",found.getElement(), equalTo(mf.getElement())); assertThat("testFindByElement 3",found.getQualifier(), equalTo(mf.getQualifier())); }
public static MetadataField findByElement(Context context, int schemaID, String element, String qualifier) throws SQLException, AuthorizeException { TableRowIterator tri; if (qualifier == null) { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier is NULL ", schemaID, element); } else { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier= ? ", schemaID, element, qualifier); } TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataField(row); } }
MetadataField { public static MetadataField findByElement(Context context, int schemaID, String element, String qualifier) throws SQLException, AuthorizeException { TableRowIterator tri; if (qualifier == null) { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier is NULL ", schemaID, element); } else { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier= ? ", schemaID, element, qualifier); } TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataField(row); } } }
MetadataField { public static MetadataField findByElement(Context context, int schemaID, String element, String qualifier) throws SQLException, AuthorizeException { TableRowIterator tri; if (qualifier == null) { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier is NULL ", schemaID, element); } else { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier= ? ", schemaID, element, qualifier); } TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataField(row); } } MetadataField();  MetadataField(MetadataSchema schema);  MetadataField(MetadataSchema schema, String element,
            String qualifier, String scopeNote);  MetadataField(int schemaID, int fieldID, String element,
            String qualifier, String scopeNote);  MetadataField(TableRow row); }
MetadataField { public static MetadataField findByElement(Context context, int schemaID, String element, String qualifier) throws SQLException, AuthorizeException { TableRowIterator tri; if (qualifier == null) { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier is NULL ", schemaID, element); } else { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier= ? ", schemaID, element, qualifier); } TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataField(row); } } MetadataField();  MetadataField(MetadataSchema schema);  MetadataField(MetadataSchema schema, String element,
            String qualifier, String scopeNote);  MetadataField(int schemaID, int fieldID, String element,
            String qualifier, String scopeNote);  MetadataField(TableRow row); String getElement(); void setElement(String element); int getFieldID(); String getQualifier(); void setQualifier(String qualifier); int getSchemaID(); void setSchemaID(int schemaID); String getScopeNote(); void setScopeNote(String scopeNote); void create(Context context); static MetadataField findByElement(Context context, int schemaID,
            String element, String qualifier); static MetadataField[] findAll(Context context); static MetadataField[] findAllInSchema(Context context, int schemaID); void update(Context context); void delete(Context context); static String formKey(String schema, String element, String qualifier); static MetadataField find(Context context, int id); @Override boolean equals(Object obj); @Override int hashCode(); }
MetadataField { public static MetadataField findByElement(Context context, int schemaID, String element, String qualifier) throws SQLException, AuthorizeException { TableRowIterator tri; if (qualifier == null) { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier is NULL ", schemaID, element); } else { tri = DatabaseManager.queryTable(context,"MetadataFieldRegistry", "SELECT * FROM MetadataFieldRegistry WHERE metadata_schema_id= ? " + "AND element= ? AND qualifier= ? ", schemaID, element, qualifier); } TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataField(row); } } MetadataField();  MetadataField(MetadataSchema schema);  MetadataField(MetadataSchema schema, String element,
            String qualifier, String scopeNote);  MetadataField(int schemaID, int fieldID, String element,
            String qualifier, String scopeNote);  MetadataField(TableRow row); String getElement(); void setElement(String element); int getFieldID(); String getQualifier(); void setQualifier(String qualifier); int getSchemaID(); void setSchemaID(int schemaID); String getScopeNote(); void setScopeNote(String scopeNote); void create(Context context); static MetadataField findByElement(Context context, int schemaID,
            String element, String qualifier); static MetadataField[] findAll(Context context); static MetadataField[] findAllInSchema(Context context, int schemaID); void update(Context context); void delete(Context context); static String formKey(String schema, String element, String qualifier); static MetadataField find(Context context, int id); @Override boolean equals(Object obj); @Override int hashCode();  }