@Test public void testFindAllInMap() throws Exception { }
public Map<String, Contact> findAllInMap(Currency currency) { Map<String,Contact> contacts = new HashMap<>(); Contact contact; Cursor cursor = query( ContactTable.CURRENCY_ID + "=?", new String[]{String.valueOf(currency.getId())},ContactTable.ALIAS+" ASC"); if (cursor.moveToFirst()){ do { contact = fromCursor(cursor); contact.setCurrency(currency); contacts.put(contact.getPublicKey(),contact); }while (cursor.moveToNext()); } cursor.close(); return contacts; }
ContactSql extends AbstractSql<Contact> { public Map<String, Contact> findAllInMap(Currency currency) { Map<String,Contact> contacts = new HashMap<>(); Contact contact; Cursor cursor = query( ContactTable.CURRENCY_ID + "=?", new String[]{String.valueOf(currency.getId())},ContactTable.ALIAS+" ASC"); if (cursor.moveToFirst()){ do { contact = fromCursor(cursor); contact.setCurrency(currency); contacts.put(contact.getPublicKey(),contact); }while (cursor.moveToNext()); } cursor.close(); return contacts; } }
ContactSql extends AbstractSql<Contact> { public Map<String, Contact> findAllInMap(Currency currency) { Map<String,Contact> contacts = new HashMap<>(); Contact contact; Cursor cursor = query( ContactTable.CURRENCY_ID + "=?", new String[]{String.valueOf(currency.getId())},ContactTable.ALIAS+" ASC"); if (cursor.moveToFirst()){ do { contact = fromCursor(cursor); contact.setCurrency(currency); contacts.put(contact.getPublicKey(),contact); }while (cursor.moveToNext()); } cursor.close(); return contacts; } ContactSql(Context context); }
ContactSql extends AbstractSql<Contact> { public Map<String, Contact> findAllInMap(Currency currency) { Map<String,Contact> contacts = new HashMap<>(); Contact contact; Cursor cursor = query( ContactTable.CURRENCY_ID + "=?", new String[]{String.valueOf(currency.getId())},ContactTable.ALIAS+" ASC"); if (cursor.moveToFirst()){ do { contact = fromCursor(cursor); contact.setCurrency(currency); contacts.put(contact.getPublicKey(),contact); }while (cursor.moveToNext()); } cursor.close(); return contacts; } ContactSql(Context context); String isContact(String uid, String publicKey,long currencyId); Map<String,Contact> findByPublicKey(Currency currency, String publicKey); Map<String,Contact> findByName(Currency currency,String search); Map<String, Contact> findAllInMap(Currency currency); @Override String getCreation(); @Override Contact fromCursor(Cursor cursor); @Override ContentValues toContentValues(Contact entity); }
ContactSql extends AbstractSql<Contact> { public Map<String, Contact> findAllInMap(Currency currency) { Map<String,Contact> contacts = new HashMap<>(); Contact contact; Cursor cursor = query( ContactTable.CURRENCY_ID + "=?", new String[]{String.valueOf(currency.getId())},ContactTable.ALIAS+" ASC"); if (cursor.moveToFirst()){ do { contact = fromCursor(cursor); contact.setCurrency(currency); contacts.put(contact.getPublicKey(),contact); }while (cursor.moveToNext()); } cursor.close(); return contacts; } ContactSql(Context context); String isContact(String uid, String publicKey,long currencyId); Map<String,Contact> findByPublicKey(Currency currency, String publicKey); Map<String,Contact> findByName(Currency currency,String search); Map<String, Contact> findAllInMap(Currency currency); @Override String getCreation(); @Override Contact fromCursor(Cursor cursor); @Override ContentValues toContentValues(Contact entity); static final Uri URI; static final int CODE; }