@Test public void testFind() throws Exception { mv.create(context); int id = mv.getValueId(); MetadataValue found = MetadataValue.find(context, id); assertThat("testFind 0",found, notNullValue()); assertThat("testFind 1",found.getValueId(), equalTo(id)); }
public static MetadataValue find(Context context, int valueId) throws IOException, SQLException, AuthorizeException { TableRowIterator tri = DatabaseManager.queryTable(context, "MetadataValue", "SELECT * FROM MetadataValue where metadata_value_id= ? ", valueId); TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataValue(row); } }
MetadataValue { public static MetadataValue find(Context context, int valueId) throws IOException, SQLException, AuthorizeException { TableRowIterator tri = DatabaseManager.queryTable(context, "MetadataValue", "SELECT * FROM MetadataValue where metadata_value_id= ? ", valueId); TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataValue(row); } } }
MetadataValue { public static MetadataValue find(Context context, int valueId) throws IOException, SQLException, AuthorizeException { TableRowIterator tri = DatabaseManager.queryTable(context, "MetadataValue", "SELECT * FROM MetadataValue where metadata_value_id= ? ", valueId); TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataValue(row); } } MetadataValue(TableRow row);  MetadataValue();  MetadataValue(MetadataField field); }
MetadataValue { public static MetadataValue find(Context context, int valueId) throws IOException, SQLException, AuthorizeException { TableRowIterator tri = DatabaseManager.queryTable(context, "MetadataValue", "SELECT * FROM MetadataValue where metadata_value_id= ? ", valueId); TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataValue(row); } } MetadataValue(TableRow row);  MetadataValue();  MetadataValue(MetadataField field); int getFieldId(); void setFieldId(int fieldId); int getItemId(); void setItemId(int itemId); String getLanguage(); void setLanguage(String language); int getPlace(); void setPlace(int place); int getValueId(); String getValue(); void setValue(String value); String getAuthority(); void setAuthority(String value); int getConfidence(); void setConfidence(int value); void create(Context context); static MetadataValue find(Context context, int valueId); static List<MetadataValue> findByField(Context context, int fieldId); void update(Context context); void delete(Context context); @Override boolean equals(Object obj); @Override int hashCode(); }
MetadataValue { public static MetadataValue find(Context context, int valueId) throws IOException, SQLException, AuthorizeException { TableRowIterator tri = DatabaseManager.queryTable(context, "MetadataValue", "SELECT * FROM MetadataValue where metadata_value_id= ? ", valueId); TableRow row = null; try { if (tri.hasNext()) { row = tri.next(); } } finally { if (tri != null) { tri.close(); } } if (row == null) { return null; } else { return new MetadataValue(row); } } MetadataValue(TableRow row);  MetadataValue();  MetadataValue(MetadataField field); int getFieldId(); void setFieldId(int fieldId); int getItemId(); void setItemId(int itemId); String getLanguage(); void setLanguage(String language); int getPlace(); void setPlace(int place); int getValueId(); String getValue(); void setValue(String value); String getAuthority(); void setAuthority(String value); int getConfidence(); void setConfidence(int value); void create(Context context); static MetadataValue find(Context context, int valueId); static List<MetadataValue> findByField(Context context, int fieldId); void update(Context context); void delete(Context context); @Override boolean equals(Object obj); @Override int hashCode(); public String value; public String language; public int place; public String authority; public int confidence; }