DocumentRepositoryImpl extends AbstractCRUDRepository<Document> implements DocumentRepository { @Override public Document read(Identifier identifier) { Table table = identifier.getTable(); PreparedStatement readStmt = PreparedStatementFactory.getPreparedStatement(String.format(READ_CQL, table.toDbTable(), Columns.ID), getSession()); BoundStatement bs = new BoundStatement(readStmt); bindIdentifier(bs, identifier); Document item = DocumentPersistanceUtils.marshalRow(getSession().execute(bs).one()); if (item == null) { throw new ItemNotFoundException("ID not found: " + identifier.toString()); } item.setTable(table); return item; } DocumentRepositoryImpl(Session session); @Override Document create(Document entity); @Override Document read(Identifier identifier); @Override QueryResponseWrapper readAll(String database, String tableString, int limit, long offset); @Override Document update(Document entity); @Override void delete(Document entity); @Override void delete(Identifier id); @Override boolean exists(Identifier identifier);  }
@Test public void testDoRead() { System.out.println("doRead"); Document testDocument = Fixtures.createTestDocument(); f.insertDocument(testDocument); Identifier identifier = testDocument.getId(); DocumentRepository instance = new DocumentRepositoryImpl(f.getSession()); Document expResult = testDocument; Document result = instance.read(identifier); assertEquals(expResult, result); f.deleteDocument(testDocument); }