}
@Test
public void testIndexedButNotInNoSqlDatabaseList() {
PartAccount acc = new PartAccount();
acc.setBusinessName("dean");
mgr.put(acc);
PartAccount acc2 = new PartAccount();
acc2.setBusinessName(acc.getBusinessName());
mgr.put(acc2);
mgr.flush();
//Here we have to go raw and update the index ourselves with another fake PartAccount that does
//not exist
NoSqlSession session = mgr.getSession();
DboTableMeta table = mgr.find(DboTableMeta.class, "PartAccount");
DboColumnMeta colMeta = table.getColumnMeta("businessName");
ScanInfo info = ScanInfo.createScanInfo(colMeta, null, null);
IndexColumn col = new IndexColumn();
col.setColumnName("businessName");
String key = "nonexistpk";
byte[] pk = StandardConverters.convertToBytes(key);
byte[] value = StandardConverters.convertToBytes(acc.getBusinessName());
col.setIndexedValue(value);
col.setPrimaryKey(pk);
session.persistIndex(table, info.getIndexColFamily(), info.getRowKey(), col);
mgr.flush();
Iterable<KeyValue<PartAccount>> all = PartAccount.findWithBizName(mgr, acc.getBusinessName());
List keys = new ArrayList();
KeyValue<PartAccount> kVal = null;
for(KeyValue<PartAccount> k : all) {
keys.add(k);
if(k.getKey().equals(key))
kVal = k;
}
PartAccount pa = kVal.getValue();
Assert.assertNull(pa);
// try {
// kVal.getValue();