target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test(expected = RuntimeException.class) public void testDeleteCollectionThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.delete((Collection<Foo>) null... | @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionS... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionS... |
@Test(expected = RuntimeException.class) public void testDeleteIdsThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.deleteIds(null)).andThrow(new SQLExc... | @Override public int deleteIds(Collection<ID> ids) { try { return dao.deleteIds(ids); } catch (SQLException e) { logMessage(e, "deleteIds threw exception on: " + ids); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int deleteIds(Collection<ID> ids) { try { return dao.deleteIds(ids); } catch (SQLException e) { logMessage(e, "deleteIds threw exception on: " + ids); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int deleteIds(Collection<ID> ids) { try { return dao.deleteIds(ids); } catch (SQLException e) { logMessage(e, "deleteIds threw exception on: " + ids); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int deleteIds(Collection<ID> ids) { try { return dao.deleteIds(ids); } catch (SQLException e) { logMessage(e, "deleteIds threw exception on: " + ids); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> cr... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int deleteIds(Collection<ID> ids) { try { return dao.deleteIds(ids); } catch (SQLException e) { logMessage(e, "deleteIds threw exception on: " + ids); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> cr... |
@Test(expected = RuntimeException.class) public void testDeletePreparedThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.delete((PreparedDelete<Foo>) nu... | @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionS... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int delete(T data) { try { return dao.delete(data); } catch (SQLException e) { logMessage(e, "delete threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionS... |
@Test(expected = RuntimeException.class) public void testCloseLastIteratorThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.closeLastIterator(); expectLastCall... | @Override public void closeLastIterator() { try { dao.closeLastIterator(); } catch (IOException e) { logMessage(e, "closeLastIterator threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void closeLastIterator() { try { dao.closeLastIterator(); } catch (IOException e) { logMessage(e, "closeLastIterator threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void closeLastIterator() { try { dao.closeLastIterator(); } catch (IOException e) { logMessage(e, "closeLastIterator threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void closeLastIterator() { try { dao.closeLastIterator(); } catch (IOException e) { logMessage(e, "closeLastIterator threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Connect... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void closeLastIterator() { try { dao.closeLastIterator(); } catch (IOException e) { logMessage(e, "closeLastIterator threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Connect... |
@Test(expected = RuntimeException.class) public void testIteratorThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.iterator(null)).andThrow(new SQLExcep... | @Override public CloseableIterator<T> iterator() { return dao.iterator(); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connec... | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connec... |
@Test public void testCloseableIterator() { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.closeableIterator()).andReturn(null); replay(dao); rtDao.closeableIterator(); verify(... | @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(Conne... | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(Conne... |
@Test public void testGetParameterNameByPosition() throws Exception { List<Annotation> empty = Collections.emptyList(); ParameterDescriptor p0 = ParameterDescriptor.create(0, String.class, empty, "param1"); ParameterDescriptor p1 = ParameterDescriptor.create(1, int.class, empty, "param2"); List<ParameterDescriptor> pds... | @Override public String getParameterNameByPosition(int position) { String name = positionToNameMap.get(position); if (name == null) { throw new IllegalStateException("parameter name can not be found by position [" + position + "]"); } return name; } | DefaultParameterContext implements ParameterContext { @Override public String getParameterNameByPosition(int position) { String name = positionToNameMap.get(position); if (name == null) { throw new IllegalStateException("parameter name can not be found by position [" + position + "]"); } return name; } } | DefaultParameterContext implements ParameterContext { @Override public String getParameterNameByPosition(int position) { String name = positionToNameMap.get(position); if (name == null) { throw new IllegalStateException("parameter name can not be found by position [" + position + "]"); } return name; } private Default... | DefaultParameterContext implements ParameterContext { @Override public String getParameterNameByPosition(int position) { String name = positionToNameMap.get(position); if (name == null) { throw new IllegalStateException("parameter name can not be found by position [" + position + "]"); } return name; } private Default... | DefaultParameterContext implements ParameterContext { @Override public String getParameterNameByPosition(int position) { String name = positionToNameMap.get(position); if (name == null) { throw new IllegalStateException("parameter name can not be found by position [" + position + "]"); } return name; } private Default... |
@Test(expected = RuntimeException.class) public void testCloseableIteratorThrow() { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.closeableIterator()).andThrow(new SQLExceptio... | @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(Conne... | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> closeableIterator() { return dao.closeableIterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(Conne... |
@Test(expected = RuntimeException.class) public void testIteratorQueryFlags() { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(rtDao.iterator(null, 0)).andThrow(new SQLException("T... | @Override public CloseableIterator<T> iterator() { return dao.iterator(); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connec... | RuntimeExceptionDao implements Dao<T, ID> { @Override public CloseableIterator<T> iterator() { return dao.iterator(); } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSource, Class<T> clazz); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connec... |
@Test(expected = RuntimeException.class) public void testQueryRawThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.queryRaw(null)).andThrow(new SQLExcep... | @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... |
@Test public void testQueryRawValue() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); String query = "fkeowjfkewfewf"; expect(dao.queryRawValue(query, new String[0])).an... | @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID>... | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID>... | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID>... |
@Test(expected = RuntimeException.class) public void testQueryRawValueThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.queryRawValue(null)).andThrow(ne... | @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID>... | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID>... | RuntimeExceptionDao implements Dao<T, ID> { @Override public long queryRawValue(String query, String... arguments) { try { return dao.queryRawValue(query, arguments); } catch (SQLException e) { logMessage(e, "queryRawValue threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID>... |
@Test(expected = RuntimeException.class) public void testQueryRawRowMapperThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.queryRaw(null, (RawRowMapper... | @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... |
@Test(expected = RuntimeException.class) public void testQueryRawDateTypesThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.queryRaw(null, (DataType[]) ... | @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRawResults<String[]> queryRaw(String query, String... arguments) { try { return dao.queryRaw(query, arguments); } catch (SQLException e) { logMessage(e, "queryRaw threw exception on: " + query); throw new RuntimeException(e); } } RuntimeExceptionDao(Da... |
@Test public void testExecuteRaw() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.executeRaw(null)).andReturn(0); replay(dao); rtDao.executeRaw(null); verify... | @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, I... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, I... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, I... |
@Test(expected = RuntimeException.class) public void testExecuteRawThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.executeRaw(null)).andThrow(new SQLE... | @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, I... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, I... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRaw(String statement, String... arguments) { try { return dao.executeRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "executeRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, I... |
@Test public void testAssignEmptyForeignCollection() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.assignEmptyForeignCollection(null, null); replay(dao); rtDao.ass... | @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... |
@Test public void testGetBindingParameterInvoker() throws Exception { List<Annotation> empty = Collections.emptyList(); ParameterDescriptor p0 = ParameterDescriptor.create(0, String.class, empty, "1"); ParameterDescriptor p1 = ParameterDescriptor.create(1, User.class, empty, "2"); List<ParameterDescriptor> pds = Arrays... | @Override public BindingParameterInvoker getBindingParameterInvoker(BindingParameter bindingParameter) { String parameterName = bindingParameter.getParameterName(); Type type = nameToTypeMap.get(parameterName); if (type == null) { throw new BindingException("Parameter '" + BindingParameter.create(bindingParameter.getPa... | DefaultParameterContext implements ParameterContext { @Override public BindingParameterInvoker getBindingParameterInvoker(BindingParameter bindingParameter) { String parameterName = bindingParameter.getParameterName(); Type type = nameToTypeMap.get(parameterName); if (type == null) { throw new BindingException("Paramet... | DefaultParameterContext implements ParameterContext { @Override public BindingParameterInvoker getBindingParameterInvoker(BindingParameter bindingParameter) { String parameterName = bindingParameter.getParameterName(); Type type = nameToTypeMap.get(parameterName); if (type == null) { throw new BindingException("Paramet... | DefaultParameterContext implements ParameterContext { @Override public BindingParameterInvoker getBindingParameterInvoker(BindingParameter bindingParameter) { String parameterName = bindingParameter.getParameterName(); Type type = nameToTypeMap.get(parameterName); if (type == null) { throw new BindingException("Paramet... | DefaultParameterContext implements ParameterContext { @Override public BindingParameterInvoker getBindingParameterInvoker(BindingParameter bindingParameter) { String parameterName = bindingParameter.getParameterName(); Type type = nameToTypeMap.get(parameterName); if (type == null) { throw new BindingException("Paramet... |
@Test(expected = RuntimeException.class) public void testAssignEmptyForeignCollectionThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.assignEmptyForeignCollec... | @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void assignEmptyForeignCollection(T parent, String fieldName) { try { dao.assignEmptyForeignCollection(parent, fieldName); } catch (SQLException e) { logMessage(e, "assignEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e);... |
@Test public void testExecuteRawNoArgs() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.executeRawNoArgs(null)).andReturn(0); replay(dao); rtDao.executeRawNo... | @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); stati... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); stati... |
@Test(expected = RuntimeException.class) public void testExecuteRawNoArgsThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.executeRawNoArgs(null)).andTh... | @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); stati... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int executeRawNoArgs(String statement) { try { return dao.executeRawNoArgs(statement); } catch (SQLException e) { logMessage(e, "executeRawNoArgs threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); stati... |
@Test public void testSetObjectCache() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.setObjectCache(false); replay(dao); rtDao.setObjectCache(false); verify(dao); ... | @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... |
@Test(expected = RuntimeException.class) public void testSetObjectCacheThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.setObjectCache(false); expectLastCall(... | @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... |
@Test public void testSetObjectCacheCache() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.setObjectCache(null); replay(dao); rtDao.setObjectCache(null); verify(dao... | @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... |
@Test(expected = RuntimeException.class) public void testSetObjectCacheCacheThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); dao.setObjectCache(null); expectLastC... | @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... | RuntimeExceptionDao implements Dao<T, ID> { @Override public void setObjectCache(boolean enabled) { try { dao.setObjectCache(enabled); } catch (SQLException e) { logMessage(e, "setObjectCache(" + enabled + ") threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExcept... |
@Test(expected = RuntimeException.class) public void testUpdateRawThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.updateRaw(null)).andThrow(new SQLExc... | @Override public int updateRaw(String statement, String... arguments) { try { return dao.updateRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "updateRaw threw exception on: " + statement); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int updateRaw(String statement, String... arguments) { try { return dao.updateRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "updateRaw threw exception on: " + statement); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public int updateRaw(String statement, String... arguments) { try { return dao.updateRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "updateRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> ... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int updateRaw(String statement, String... arguments) { try { return dao.updateRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "updateRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> ... | RuntimeExceptionDao implements Dao<T, ID> { @Override public int updateRaw(String statement, String... arguments) { try { return dao.updateRaw(statement, arguments); } catch (SQLException e) { logMessage(e, "updateRaw threw exception on: " + statement); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> ... |
@Test(expected = RuntimeException.class) public void testCallBatchTasksThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.callBatchTasks(null)).andThrow(... | @Override public <CT> CT callBatchTasks(Callable<CT> callable) { try { return dao.callBatchTasks(callable); } catch (Exception e) { logMessage(e, "callBatchTasks threw exception on: " + callable); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public <CT> CT callBatchTasks(Callable<CT> callable) { try { return dao.callBatchTasks(callable); } catch (Exception e) { logMessage(e, "callBatchTasks threw exception on: " + callable); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public <CT> CT callBatchTasks(Callable<CT> callable) { try { return dao.callBatchTasks(callable); } catch (Exception e) { logMessage(e, "callBatchTasks threw exception on: " + callable); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public <CT> CT callBatchTasks(Callable<CT> callable) { try { return dao.callBatchTasks(callable); } catch (Exception e) { logMessage(e, "callBatchTasks threw exception on: " + callable); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static ... | RuntimeExceptionDao implements Dao<T, ID> { @Override public <CT> CT callBatchTasks(Callable<CT> callable) { try { return dao.callBatchTasks(callable); } catch (Exception e) { logMessage(e, "callBatchTasks threw exception on: " + callable); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static ... |
@Test(expected = RuntimeException.class) public void testObjectsEqualThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.objectsEqual(null, null)).andThro... | @Override public boolean objectsEqual(T data1, T data2) { try { return dao.objectsEqual(data1, data2); } catch (SQLException e) { logMessage(e, "objectsEqual threw exception on: " + data1 + " and " + data2); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean objectsEqual(T data1, T data2) { try { return dao.objectsEqual(data1, data2); } catch (SQLException e) { logMessage(e, "objectsEqual threw exception on: " + data1 + " and " + data2); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean objectsEqual(T data1, T data2) { try { return dao.objectsEqual(data1, data2); } catch (SQLException e) { logMessage(e, "objectsEqual threw exception on: " + data1 + " and " + data2); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean objectsEqual(T data1, T data2) { try { return dao.objectsEqual(data1, data2); } catch (SQLException e) { logMessage(e, "objectsEqual threw exception on: " + data1 + " and " + data2); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> da... | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean objectsEqual(T data1, T data2) { try { return dao.objectsEqual(data1, data2); } catch (SQLException e) { logMessage(e, "objectsEqual threw exception on: " + data1 + " and " + data2); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> da... |
@Test public void testGetParameterDescriptors() throws Exception { List<Annotation> empty = Collections.emptyList(); ParameterDescriptor p0 = ParameterDescriptor.create(0, String.class, empty, "1"); ParameterDescriptor p1 = ParameterDescriptor.create(1, User.class, empty, "2"); List<ParameterDescriptor> pds = Arrays.as... | @Override public List<ParameterDescriptor> getParameterDescriptors() { return parameterDescriptors; } | DefaultParameterContext implements ParameterContext { @Override public List<ParameterDescriptor> getParameterDescriptors() { return parameterDescriptors; } } | DefaultParameterContext implements ParameterContext { @Override public List<ParameterDescriptor> getParameterDescriptors() { return parameterDescriptors; } private DefaultParameterContext(List<ParameterDescriptor> parameterDescriptors); } | DefaultParameterContext implements ParameterContext { @Override public List<ParameterDescriptor> getParameterDescriptors() { return parameterDescriptors; } private DefaultParameterContext(List<ParameterDescriptor> parameterDescriptors); static DefaultParameterContext create(List<ParameterDescriptor> parameterDescripto... | DefaultParameterContext implements ParameterContext { @Override public List<ParameterDescriptor> getParameterDescriptors() { return parameterDescriptors; } private DefaultParameterContext(List<ParameterDescriptor> parameterDescriptors); static DefaultParameterContext create(List<ParameterDescriptor> parameterDescripto... |
@Test(expected = RuntimeException.class) public void testExtractIdThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.extractId(null)).andThrow(new SQLExc... | @Override public ID extractId(T data) { try { return dao.extractId(data); } catch (SQLException e) { logMessage(e, "extractId threw exception on: " + data); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public ID extractId(T data) { try { return dao.extractId(data); } catch (SQLException e) { logMessage(e, "extractId threw exception on: " + data); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public ID extractId(T data) { try { return dao.extractId(data); } catch (SQLException e) { logMessage(e, "extractId threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public ID extractId(T data) { try { return dao.extractId(data); } catch (SQLException e) { logMessage(e, "extractId threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Con... | RuntimeExceptionDao implements Dao<T, ID> { @Override public ID extractId(T data) { try { return dao.extractId(data); } catch (SQLException e) { logMessage(e, "extractId threw exception on: " + data); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Con... |
@Test(expected = RuntimeException.class) public void testIsTableExistsThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.isTableExists()).andThrow(new SQ... | @Override public boolean isTableExists() { try { return dao.isTableExists(); } catch (SQLException e) { logMessage(e, "isTableExists threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean isTableExists() { try { return dao.isTableExists(); } catch (SQLException e) { logMessage(e, "isTableExists threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean isTableExists() { try { return dao.isTableExists(); } catch (SQLException e) { logMessage(e, "isTableExists threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean isTableExists() { try { return dao.isTableExists(); } catch (SQLException e) { logMessage(e, "isTableExists threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Connecti... | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean isTableExists() { try { return dao.isTableExists(); } catch (SQLException e) { logMessage(e, "isTableExists threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Connecti... |
@Test(expected = RuntimeException.class) public void testCountOfThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.countOf()).andThrow(new SQLException("... | @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSo... | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSo... |
@Test(expected = RuntimeException.class) public void testCountOfPreparedThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); @SuppressWarnings("unchecked") PreparedQu... | @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSo... | RuntimeExceptionDao implements Dao<T, ID> { @Override public long countOf() { try { return dao.countOf(); } catch (SQLException e) { logMessage(e, "countOf threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(ConnectionSource connectionSo... |
@Test(expected = RuntimeException.class) public void testGetEmptyForeignCollectionThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.getEmptyForeignColle... | @Override public <FT> ForeignCollection<FT> getEmptyForeignCollection(String fieldName) { try { return dao.getEmptyForeignCollection(fieldName); } catch (SQLException e) { logMessage(e, "getEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public <FT> ForeignCollection<FT> getEmptyForeignCollection(String fieldName) { try { return dao.getEmptyForeignCollection(fieldName); } catch (SQLException e) { logMessage(e, "getEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e... | RuntimeExceptionDao implements Dao<T, ID> { @Override public <FT> ForeignCollection<FT> getEmptyForeignCollection(String fieldName) { try { return dao.getEmptyForeignCollection(fieldName); } catch (SQLException e) { logMessage(e, "getEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e... | RuntimeExceptionDao implements Dao<T, ID> { @Override public <FT> ForeignCollection<FT> getEmptyForeignCollection(String fieldName) { try { return dao.getEmptyForeignCollection(fieldName); } catch (SQLException e) { logMessage(e, "getEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e... | RuntimeExceptionDao implements Dao<T, ID> { @Override public <FT> ForeignCollection<FT> getEmptyForeignCollection(String fieldName) { try { return dao.getEmptyForeignCollection(fieldName); } catch (SQLException e) { logMessage(e, "getEmptyForeignCollection threw exception on " + fieldName); throw new RuntimeException(e... |
@Test(expected = RuntimeException.class) public void testMapSelectStarRowThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); DatabaseResults results = createMock(Dat... | @Override public T mapSelectStarRow(DatabaseResults results) { try { return dao.mapSelectStarRow(results); } catch (SQLException e) { logMessage(e, "mapSelectStarRow threw exception on results"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public T mapSelectStarRow(DatabaseResults results) { try { return dao.mapSelectStarRow(results); } catch (SQLException e) { logMessage(e, "mapSelectStarRow threw exception on results"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public T mapSelectStarRow(DatabaseResults results) { try { return dao.mapSelectStarRow(results); } catch (SQLException e) { logMessage(e, "mapSelectStarRow threw exception on results"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public T mapSelectStarRow(DatabaseResults results) { try { return dao.mapSelectStarRow(results); } catch (SQLException e) { logMessage(e, "mapSelectStarRow threw exception on results"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static R... | RuntimeExceptionDao implements Dao<T, ID> { @Override public T mapSelectStarRow(DatabaseResults results) { try { return dao.mapSelectStarRow(results); } catch (SQLException e) { logMessage(e, "mapSelectStarRow threw exception on results"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static R... |
@Test(expected = RuntimeException.class) public void testGetSelectStarRowMapperThrow() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); expect(dao.getSelectStarRowMapper(... | @Override public GenericRowMapper<T> getSelectStarRowMapper() { try { return dao.getSelectStarRowMapper(); } catch (SQLException e) { logMessage(e, "getSelectStarRowMapper threw exception"); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRowMapper<T> getSelectStarRowMapper() { try { return dao.getSelectStarRowMapper(); } catch (SQLException e) { logMessage(e, "getSelectStarRowMapper threw exception"); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRowMapper<T> getSelectStarRowMapper() { try { return dao.getSelectStarRowMapper(); } catch (SQLException e) { logMessage(e, "getSelectStarRowMapper threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRowMapper<T> getSelectStarRowMapper() { try { return dao.getSelectStarRowMapper(); } catch (SQLException e) { logMessage(e, "getSelectStarRowMapper threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static Runtim... | RuntimeExceptionDao implements Dao<T, ID> { @Override public GenericRowMapper<T> getSelectStarRowMapper() { try { return dao.getSelectStarRowMapper(); } catch (SQLException e) { logMessage(e, "getSelectStarRowMapper threw exception"); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static Runtim... |
@Test(expected = RuntimeException.class) public void testIdExists() throws Exception { @SuppressWarnings("unchecked") Dao<Foo, String> dao = (Dao<Foo, String>) createMock(Dao.class); RuntimeExceptionDao<Foo, String> rtDao = new RuntimeExceptionDao<Foo, String>(dao); String id = "eopwjfpwejf"; expect(dao.idExists(id)).a... | @Override public boolean idExists(ID id) { try { return dao.idExists(id); } catch (SQLException e) { logMessage(e, "idExists threw exception on " + id); throw new RuntimeException(e); } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean idExists(ID id) { try { return dao.idExists(id); } catch (SQLException e) { logMessage(e, "idExists threw exception on " + id); throw new RuntimeException(e); } } } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean idExists(ID id) { try { return dao.idExists(id); } catch (SQLException e) { logMessage(e, "idExists threw exception on " + id); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); } | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean idExists(ID id) { try { return dao.idExists(id); } catch (SQLException e) { logMessage(e, "idExists threw exception on " + id); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Connect... | RuntimeExceptionDao implements Dao<T, ID> { @Override public boolean idExists(ID id) { try { return dao.idExists(id); } catch (SQLException e) { logMessage(e, "idExists threw exception on " + id); throw new RuntimeException(e); } } RuntimeExceptionDao(Dao<T, ID> dao); static RuntimeExceptionDao<T, ID> createDao(Connect... |
@Test public void testNestedSave() throws Exception { OurConnectionSource cs = new OurConnectionSource(); DatabaseConnection conn = cs.getReadOnlyConnection(null); cs.saveSpecialConnection(conn); cs.saveSpecialConnection(conn); cs.clearSpecialConnection(conn); assertEquals(conn, cs.getSpecialConnection(null)); cs.close... | @Override public DatabaseConnection getSpecialConnection(String tableName) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return null; } else { return currentSaved.connection; } } | BaseConnectionSource implements ConnectionSource { @Override public DatabaseConnection getSpecialConnection(String tableName) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return null; } else { return currentSaved.connection; } } } | BaseConnectionSource implements ConnectionSource { @Override public DatabaseConnection getSpecialConnection(String tableName) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return null; } else { return currentSaved.connection; } } } | BaseConnectionSource implements ConnectionSource { @Override public DatabaseConnection getSpecialConnection(String tableName) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return null; } else { return currentSaved.connection; } } @Override DatabaseConnection getSpecialConnectio... | BaseConnectionSource implements ConnectionSource { @Override public DatabaseConnection getSpecialConnection(String tableName) { NestedConnection currentSaved = specialConnection.get(); if (currentSaved == null) { return null; } else { return currentSaved.connection; } } @Override DatabaseConnection getSpecialConnectio... |
@Test public void testIsAutoCommitSupported() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); boolean supported = true; expect(conn.isAutoCommitSupported()).andReturn(supported); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); assertEqual... | @Override public boolean isAutoCommitSupported() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommitSupported(); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommitSupported() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommitSupported(); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommitSupported() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommitSupported(); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommitSupported() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommitSupported(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boo... | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommitSupported() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommitSupported(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boo... |
@Test public void testTryExpandBindingParameter() throws Exception { List<Annotation> empty = Collections.emptyList(); ParameterDescriptor p0 = ParameterDescriptor.create(0, String.class, empty, "1"); ParameterDescriptor p1 = ParameterDescriptor.create(1, User.class, empty, "2"); List<ParameterDescriptor> pds = Arrays.... | @Override @Nullable public BindingParameter tryExpandBindingParameter(BindingParameter bindingParameter) { if (!nameToTypeMap.containsKey(bindingParameter.getParameterName())) { BindingParameter newBindingParameter = bindingParameter.rightShift(); List<String> parameterNames = new ArrayList<String>(); for (Map.Entry<St... | DefaultParameterContext implements ParameterContext { @Override @Nullable public BindingParameter tryExpandBindingParameter(BindingParameter bindingParameter) { if (!nameToTypeMap.containsKey(bindingParameter.getParameterName())) { BindingParameter newBindingParameter = bindingParameter.rightShift(); List<String> param... | DefaultParameterContext implements ParameterContext { @Override @Nullable public BindingParameter tryExpandBindingParameter(BindingParameter bindingParameter) { if (!nameToTypeMap.containsKey(bindingParameter.getParameterName())) { BindingParameter newBindingParameter = bindingParameter.rightShift(); List<String> param... | DefaultParameterContext implements ParameterContext { @Override @Nullable public BindingParameter tryExpandBindingParameter(BindingParameter bindingParameter) { if (!nameToTypeMap.containsKey(bindingParameter.getParameterName())) { BindingParameter newBindingParameter = bindingParameter.rightShift(); List<String> param... | DefaultParameterContext implements ParameterContext { @Override @Nullable public BindingParameter tryExpandBindingParameter(BindingParameter bindingParameter) { if (!nameToTypeMap.containsKey(bindingParameter.getParameterName())) { BindingParameter newBindingParameter = bindingParameter.rightShift(); List<String> param... |
@Test public void testIsAutoCommit() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); boolean autoCommit = false; expect(conn.isAutoCommit()).andReturn(autoCommit); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); assertEquals(autoCommit, p... | @Override public boolean isAutoCommit() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommit(); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommit() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommit(); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommit() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommit(); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommit() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommit(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(... | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isAutoCommit() throws SQLException { if (proxy == null) { return false; } else { return proxy.isAutoCommit(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(... |
@Test public void testSetAutoCommit() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); boolean autoCommit = false; conn.setAutoCommit(autoCommit); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); proxy.setAutoCommit(autoCommit); proxy.close... | @Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (proxy != null) { proxy.setAutoCommit(autoCommit); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (proxy != null) { proxy.setAutoCommit(autoCommit); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (proxy != null) { proxy.setAutoCommit(autoCommit); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (proxy != null) { proxy.setAutoCommit(autoCommit); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); ... | DatabaseConnectionProxy implements DatabaseConnection { @Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (proxy != null) { proxy.setAutoCommit(autoCommit); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); ... |
@Test public void testSetSavePoint() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); String name = "savepoint"; expect(conn.setSavePoint(name)).andReturn(null); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); proxy.setSavePoint(name); pro... | @Override public Savepoint setSavePoint(String name) throws SQLException { if (proxy == null) { return null; } else { return proxy.setSavePoint(name); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public Savepoint setSavePoint(String name) throws SQLException { if (proxy == null) { return null; } else { return proxy.setSavePoint(name); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public Savepoint setSavePoint(String name) throws SQLException { if (proxy == null) { return null; } else { return proxy.setSavePoint(name); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public Savepoint setSavePoint(String name) throws SQLException { if (proxy == null) { return null; } else { return proxy.setSavePoint(name); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boole... | DatabaseConnectionProxy implements DatabaseConnection { @Override public Savepoint setSavePoint(String name) throws SQLException { if (proxy == null) { return null; } else { return proxy.setSavePoint(name); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boole... |
@Test public void testCommit() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); conn.commit(null); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); proxy.commit(null); proxy.close(); verify(conn); } | @Override public void commit(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.commit(savePoint); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void commit(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.commit(savePoint); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void commit(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.commit(savePoint); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void commit(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.commit(savePoint); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void... | DatabaseConnectionProxy implements DatabaseConnection { @Override public void commit(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.commit(savePoint); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void... |
@Test public void testRollback() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); conn.rollback(null); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); proxy.rollback(null); proxy.close(); verify(conn); } | @Override public void rollback(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.rollback(savePoint); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void rollback(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.rollback(savePoint); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void rollback(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.rollback(savePoint); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void rollback(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.rollback(savePoint); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override ... | DatabaseConnectionProxy implements DatabaseConnection { @Override public void rollback(Savepoint savePoint) throws SQLException { if (proxy != null) { proxy.rollback(savePoint); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override ... |
@Test public void testInsert() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); String statement = "insert bar"; int result = 13712321; expect(conn.insert(statement, null, null, null)).andReturn(result); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); r... | @Override public int insert(String statement, Object[] args, FieldType[] argfieldTypes, GeneratedKeyHolder keyHolder) throws SQLException { if (proxy == null) { return 0; } else { return proxy.insert(statement, args, argfieldTypes, keyHolder); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int insert(String statement, Object[] args, FieldType[] argfieldTypes, GeneratedKeyHolder keyHolder) throws SQLException { if (proxy == null) { return 0; } else { return proxy.insert(statement, args, argfieldTypes, keyHolder); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int insert(String statement, Object[] args, FieldType[] argfieldTypes, GeneratedKeyHolder keyHolder) throws SQLException { if (proxy == null) { return 0; } else { return proxy.insert(statement, args, argfieldTypes, keyHolder); } } DatabaseConnecti... | DatabaseConnectionProxy implements DatabaseConnection { @Override public int insert(String statement, Object[] args, FieldType[] argfieldTypes, GeneratedKeyHolder keyHolder) throws SQLException { if (proxy == null) { return 0; } else { return proxy.insert(statement, args, argfieldTypes, keyHolder); } } DatabaseConnecti... | DatabaseConnectionProxy implements DatabaseConnection { @Override public int insert(String statement, Object[] args, FieldType[] argfieldTypes, GeneratedKeyHolder keyHolder) throws SQLException { if (proxy == null) { return 0; } else { return proxy.insert(statement, args, argfieldTypes, keyHolder); } } DatabaseConnecti... |
@Test public void testUpdate() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); String statement = "insert bar"; int result = 13212321; expect(conn.update(statement, null, null)).andReturn(result); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(... | @Override public int update(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.update(statement, args, argfieldTypes); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int update(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.update(statement, args, argfieldTypes); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int update(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.update(statement, args, argfieldTypes); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int update(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.update(statement, args, argfieldTypes); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Overr... | DatabaseConnectionProxy implements DatabaseConnection { @Override public int update(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.update(statement, args, argfieldTypes); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Overr... |
@Test public void testDelete() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); String statement = "insert bar"; int result = 13872321; expect(conn.delete(statement, null, null)).andReturn(result); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(... | @Override public int delete(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.delete(statement, args, argfieldTypes); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int delete(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.delete(statement, args, argfieldTypes); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int delete(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.delete(statement, args, argfieldTypes); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public int delete(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.delete(statement, args, argfieldTypes); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Overr... | DatabaseConnectionProxy implements DatabaseConnection { @Override public int delete(String statement, Object[] args, FieldType[] argfieldTypes) throws SQLException { if (proxy == null) { return 0; } else { return proxy.delete(statement, args, argfieldTypes); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Overr... |
@Test public void testQueryForOne() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); String statement = "insert bar"; Object result = new Object(); expect(conn.queryForOne(statement, null, null, null, null)).andReturn(result); conn.close(); DatabaseConnectionProxy proxy = new DatabaseC... | @Override public <T> Object queryForOne(String statement, Object[] args, FieldType[] argfieldTypes, GenericRowMapper<T> rowMapper, ObjectCache objectCache) throws SQLException { if (proxy == null) { return null; } else { return proxy.queryForOne(statement, args, argfieldTypes, rowMapper, objectCache); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public <T> Object queryForOne(String statement, Object[] args, FieldType[] argfieldTypes, GenericRowMapper<T> rowMapper, ObjectCache objectCache) throws SQLException { if (proxy == null) { return null; } else { return proxy.queryForOne(statement, args, a... | DatabaseConnectionProxy implements DatabaseConnection { @Override public <T> Object queryForOne(String statement, Object[] args, FieldType[] argfieldTypes, GenericRowMapper<T> rowMapper, ObjectCache objectCache) throws SQLException { if (proxy == null) { return null; } else { return proxy.queryForOne(statement, args, a... | DatabaseConnectionProxy implements DatabaseConnection { @Override public <T> Object queryForOne(String statement, Object[] args, FieldType[] argfieldTypes, GenericRowMapper<T> rowMapper, ObjectCache objectCache) throws SQLException { if (proxy == null) { return null; } else { return proxy.queryForOne(statement, args, a... | DatabaseConnectionProxy implements DatabaseConnection { @Override public <T> Object queryForOne(String statement, Object[] args, FieldType[] argfieldTypes, GenericRowMapper<T> rowMapper, ObjectCache objectCache) throws SQLException { if (proxy == null) { return null; } else { return proxy.queryForOne(statement, args, a... |
@Test public void testClose() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); proxy.close(); verify(conn); } | @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void setAutoCommit(boolean autoComm... | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void setAutoCommit(boolean autoComm... |
@Test public void testRecordInit() throws Exception { InitStat stat = InitStat.create(); long a = 1000; long b = 500; stat.recordInit(a); assertThat(stat.getInitCount(), equalTo(1L)); assertThat(stat.getTotalInitTime(), equalTo(a)); stat.recordInit(b); assertThat(stat.getInitCount(), equalTo(2L)); assertThat(stat.getTo... | public void recordInit(long initTime) { if (initTime >= 0) { initCount.increment(); totalInitTime.add(initTime); } } | InitStat { public void recordInit(long initTime) { if (initTime >= 0) { initCount.increment(); totalInitTime.add(initTime); } } } | InitStat { public void recordInit(long initTime) { if (initTime >= 0) { initCount.increment(); totalInitTime.add(initTime); } } private InitStat(); } | InitStat { public void recordInit(long initTime) { if (initTime >= 0) { initCount.increment(); totalInitTime.add(initTime); } } private InitStat(); static InitStat create(); void recordInit(long initTime); long getInitCount(); long getTotalInitTime(); } | InitStat { public void recordInit(long initTime) { if (initTime >= 0) { initCount.increment(); totalInitTime.add(initTime); } } private InitStat(); static InitStat create(); void recordInit(long initTime); long getInitCount(); long getTotalInitTime(); } |
@Test public void testCloseNull() throws Exception { new DatabaseConnectionProxy(null).close(); } | @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void setAutoCommit(boolean autoComm... | DatabaseConnectionProxy implements DatabaseConnection { @Override public void close() throws IOException { if (proxy != null) { proxy.close(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void setAutoCommit(boolean autoComm... |
@Test public void testCloseQuietly() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); conn.closeQuietly(); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); proxy.closeQuietly(); proxy.close(); verify(conn); } | @Override public void closeQuietly() { if (proxy != null) { proxy.closeQuietly(); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void closeQuietly() { if (proxy != null) { proxy.closeQuietly(); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void closeQuietly() { if (proxy != null) { proxy.closeQuietly(); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public void closeQuietly() { if (proxy != null) { proxy.closeQuietly(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void setAutoCommit(boolean autoCommit); ... | DatabaseConnectionProxy implements DatabaseConnection { @Override public void closeQuietly() { if (proxy != null) { proxy.closeQuietly(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Override void setAutoCommit(boolean autoCommit); ... |
@Test public void testIsClosed() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); boolean closed = true; expect(conn.isClosed()).andReturn(closed); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(conn); replay(conn); assertEquals(closed, proxy.isClosed()); pro... | @Override public boolean isClosed() throws SQLException { if (proxy == null) { return true; } else { return proxy.isClosed(); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isClosed() throws SQLException { if (proxy == null) { return true; } else { return proxy.isClosed(); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isClosed() throws SQLException { if (proxy == null) { return true; } else { return proxy.isClosed(); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isClosed() throws SQLException { if (proxy == null) { return true; } else { return proxy.isClosed(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Overr... | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isClosed() throws SQLException { if (proxy == null) { return true; } else { return proxy.isClosed(); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Override boolean isAutoCommit(); @Overr... |
@Test public void testIsTableExists() throws Exception { DatabaseConnection conn = createMock(DatabaseConnection.class); boolean tableExists = true; String tableName = "fjewfjwef"; expect(conn.isTableExists(tableName)).andReturn(tableExists); conn.close(); DatabaseConnectionProxy proxy = new DatabaseConnectionProxy(con... | @Override public boolean isTableExists(String tableName) throws SQLException { if (proxy == null) { return false; } else { return proxy.isTableExists(tableName); } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isTableExists(String tableName) throws SQLException { if (proxy == null) { return false; } else { return proxy.isTableExists(tableName); } } } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isTableExists(String tableName) throws SQLException { if (proxy == null) { return false; } else { return proxy.isTableExists(tableName); } } DatabaseConnectionProxy(DatabaseConnection proxy); } | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isTableExists(String tableName) throws SQLException { if (proxy == null) { return false; } else { return proxy.isTableExists(tableName); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Ove... | DatabaseConnectionProxy implements DatabaseConnection { @Override public boolean isTableExists(String tableName) throws SQLException { if (proxy == null) { return false; } else { return proxy.isTableExists(tableName); } } DatabaseConnectionProxy(DatabaseConnection proxy); @Override boolean isAutoCommitSupported(); @Ove... |
@Test(expected = IllegalStateException.class) public void testHasNextThrow() throws Exception { ConnectionSource cs = createMock(ConnectionSource.class); cs.releaseConnection(null); CompiledStatement stmt = createMock(CompiledStatement.class); DatabaseResults results = createMock(DatabaseResults.class); expect(stmt.run... | public boolean hasNextThrow() throws SQLException { if (closed) { return false; } if (alreadyMoved) { return true; } boolean result; if (first) { first = false; result = results.first(); } else { result = results.next(); } if (!result) { IOUtils.closeThrowSqlException(this, "iterator"); } alreadyMoved = true; return re... | SelectIterator implements CloseableIterator<T> { public boolean hasNextThrow() throws SQLException { if (closed) { return false; } if (alreadyMoved) { return true; } boolean result; if (first) { first = false; result = results.first(); } else { result = results.next(); } if (!result) { IOUtils.closeThrowSqlException(th... | SelectIterator implements CloseableIterator<T> { public boolean hasNextThrow() throws SQLException { if (closed) { return false; } if (alreadyMoved) { return true; } boolean result; if (first) { first = false; result = results.first(); } else { result = results.next(); } if (!result) { IOUtils.closeThrowSqlException(th... | SelectIterator implements CloseableIterator<T> { public boolean hasNextThrow() throws SQLException { if (closed) { return false; } if (alreadyMoved) { return true; } boolean result; if (first) { first = false; result = results.first(); } else { result = results.next(); } if (!result) { IOUtils.closeThrowSqlException(th... | SelectIterator implements CloseableIterator<T> { public boolean hasNextThrow() throws SQLException { if (closed) { return false; } if (alreadyMoved) { return true; } boolean result; if (first) { first = false; result = results.first(); } else { result = results.next(); } if (!result) { IOUtils.closeThrowSqlException(th... |
@Test(expected = IllegalStateException.class) public void testNextThrow() throws Exception { ConnectionSource cs = createMock(ConnectionSource.class); cs.releaseConnection(null); CompiledStatement stmt = createMock(CompiledStatement.class); DatabaseResults results = createMock(DatabaseResults.class); expect(stmt.runQue... | @Override public T nextThrow() throws SQLException { if (closed) { return null; } if (!alreadyMoved) { boolean hasResult; if (first) { first = false; hasResult = results.first(); } else { hasResult = results.next(); } if (!hasResult) { first = false; return null; } } first = false; return getCurrent(); } | SelectIterator implements CloseableIterator<T> { @Override public T nextThrow() throws SQLException { if (closed) { return null; } if (!alreadyMoved) { boolean hasResult; if (first) { first = false; hasResult = results.first(); } else { hasResult = results.next(); } if (!hasResult) { first = false; return null; } } fir... | SelectIterator implements CloseableIterator<T> { @Override public T nextThrow() throws SQLException { if (closed) { return null; } if (!alreadyMoved) { boolean hasResult; if (first) { first = false; hasResult = results.first(); } else { hasResult = results.next(); } if (!hasResult) { first = false; return null; } } fir... | SelectIterator implements CloseableIterator<T> { @Override public T nextThrow() throws SQLException { if (closed) { return null; } if (!alreadyMoved) { boolean hasResult; if (first) { first = false; hasResult = results.first(); } else { hasResult = results.next(); } if (!hasResult) { first = false; return null; } } fir... | SelectIterator implements CloseableIterator<T> { @Override public T nextThrow() throws SQLException { if (closed) { return null; } if (!alreadyMoved) { boolean hasResult; if (first) { first = false; hasResult = results.first(); } else { hasResult = results.next(); } if (!hasResult) { first = false; return null; } } fir... |
@Test(expected = IllegalStateException.class) public void testRemoveThrow() throws Exception { ConnectionSource cs = createMock(ConnectionSource.class); cs.releaseConnection(null); CompiledStatement stmt = createMock(CompiledStatement.class); DatabaseResults results = createMock(DatabaseResults.class); expect(results.f... | public void removeThrow() throws SQLException { if (last == null) { throw new IllegalStateException("No last " + dataClass + " object to remove. Must be called after a call to next."); } if (classDao == null) { throw new IllegalStateException("Cannot remove " + dataClass + " object because classDao not initialized"); }... | SelectIterator implements CloseableIterator<T> { public void removeThrow() throws SQLException { if (last == null) { throw new IllegalStateException("No last " + dataClass + " object to remove. Must be called after a call to next."); } if (classDao == null) { throw new IllegalStateException("Cannot remove " + dataClass... | SelectIterator implements CloseableIterator<T> { public void removeThrow() throws SQLException { if (last == null) { throw new IllegalStateException("No last " + dataClass + " object to remove. Must be called after a call to next."); } if (classDao == null) { throw new IllegalStateException("Cannot remove " + dataClass... | SelectIterator implements CloseableIterator<T> { public void removeThrow() throws SQLException { if (last == null) { throw new IllegalStateException("No last " + dataClass + " object to remove. Must be called after a call to next."); } if (classDao == null) { throw new IllegalStateException("Cannot remove " + dataClass... | SelectIterator implements CloseableIterator<T> { public void removeThrow() throws SQLException { if (last == null) { throw new IllegalStateException("No last " + dataClass + " object to remove. Must be called after a call to next."); } if (classDao == null) { throw new IllegalStateException("Cannot remove " + dataClass... |
@Test public void testSelectAll() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); StringBuilder sb = new StringBuilder(); sb.append("SELECT * FROM "); databaseType.appendEscapedEntityName(sb, baseFooTableInfo.getTableName()); sb.append(' '); asser... | @Override protected String getTableName() { return (alias == null ? tableName : alias); } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ... | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ... |
@Test(expected = IllegalArgumentException.class) public void testAddBadColumn() { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); qb.selectColumns("unknown-column"); } | public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> selectColumns(String... columns) { for (String column : columns) { addSelectColumnToList(column); } return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID... |
@Test public void testGroupBy() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); String field1 = Foo.VAL_COLUMN_NAME; qb.groupBy(field1); String field2 = Foo.ID_COLUMN_NAME; qb.groupBy(field2); StringBuilder sb = new StringBuilder(); sb.append("SEL... | public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign colletion field: " + columnName); } addGroupBy(ColumnNameOrRawSql.withColumnName(columnName)); return this; } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign colletion field: " + columnName); } addGroupBy(ColumnNameOrRawSql.wi... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign colletion field: " + columnName); } addGroupBy(ColumnNameOrRawSql.wi... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign colletion field: " + columnName); } addGroupBy(ColumnNameOrRawSql.wi... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> groupBy(String columnName) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't groupBy foreign colletion field: " + columnName); } addGroupBy(ColumnNameOrRawSql.wi... |
@Test public void hasAttr() { Document doc = Jsoup.parse("<p title=foo><p title=bar><p class=foo><p class=bar>"); Elements ps = doc.select("p"); assertTrue(ps.hasAttr("class")); assertFalse(ps.hasAttr("style")); } | public boolean hasAttr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return true; } return false; } | Elements extends ArrayList<Element> { public boolean hasAttr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return true; } return false; } } | Elements extends ArrayList<Element> { public boolean hasAttr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return true; } return false; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Elements(Element..... | Elements extends ArrayList<Element> { public boolean hasAttr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return true; } return false; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Elements(Element..... | Elements extends ArrayList<Element> { public boolean hasAttr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return true; } return false; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Elements(Element..... |
@Test public void testSetPackages() throws Exception { MangoDaoScanner mc = new MangoDaoScanner(); List<String> packages = Lists.newArrayList("org.jfaster.mango", "", "org.jfaster"); mc.setPackages(packages); assertThat(mc.locationPatterns.get(0), is("classpath*:org/jfaster/mango*Dao.class")); assertThat(mc.locationPat... | public void setPackages(List<String> packages) { for (String p : packages) { for (String daoEnd : DAO_ENDS) { String locationPattern = "classpath*:" + p.replaceAll("\\.", "/") + "*" + daoEnd + ".class"; logger.info("trnas package[" + p + "] to locationPattern[" + locationPattern + "]"); locationPatterns.add(locationPat... | MangoDaoScanner implements BeanFactoryPostProcessor { public void setPackages(List<String> packages) { for (String p : packages) { for (String daoEnd : DAO_ENDS) { String locationPattern = "classpath*:" + p.replaceAll("\\.", "/") + "*" + daoEnd + ".class"; logger.info("trnas package[" + p + "] to locationPattern[" + lo... | MangoDaoScanner implements BeanFactoryPostProcessor { public void setPackages(List<String> packages) { for (String p : packages) { for (String daoEnd : DAO_ENDS) { String locationPattern = "classpath*:" + p.replaceAll("\\.", "/") + "*" + daoEnd + ".class"; logger.info("trnas package[" + p + "] to locationPattern[" + lo... | MangoDaoScanner implements BeanFactoryPostProcessor { public void setPackages(List<String> packages) { for (String p : packages) { for (String daoEnd : DAO_ENDS) { String locationPattern = "classpath*:" + p.replaceAll("\\.", "/") + "*" + daoEnd + ".class"; logger.info("trnas package[" + p + "] to locationPattern[" + lo... | MangoDaoScanner implements BeanFactoryPostProcessor { public void setPackages(List<String> packages) { for (String p : packages) { for (String daoEnd : DAO_ENDS) { String locationPattern = "classpath*:" + p.replaceAll("\\.", "/") + "*" + daoEnd + ".class"; logger.info("trnas package[" + p + "] to locationPattern[" + lo... |
@Test public void testOrderBy() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); String field1 = Foo.VAL_COLUMN_NAME; qb.orderBy(field1, true); String field2 = Foo.ID_COLUMN_NAME; qb.orderBy(field2, true); StringBuilder sb = new StringBuilder(); sb... | public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } addOrderBy(new OrderBy(columnName, ascending)); return this;... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } addOrderBy(ne... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } addOrderBy(ne... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } addOrderBy(ne... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } addOrderBy(ne... |
@Test public void testDistinct() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); qb.distinct(); StringBuilder sb = new StringBuilder(); sb.append("SELECT DISTINCT * FROM "); databaseType.appendEscapedEntityName(sb, baseFooTableInfo.getTableName())... | public QueryBuilder<T, ID> distinct() { distinct = true; selectIdColumn = false; return this; } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> distinct() { distinct = true; selectIdColumn = false; return this; } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> distinct() { distinct = true; selectIdColumn = false; return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> distinct() { distinct = true; selectIdColumn = false; return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuild... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> distinct() { distinct = true; selectIdColumn = false; return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuild... |
@Test public void testLimit() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); long limit = 103; qb.limit(limit); StringBuilder sb = new StringBuilder(); sb.append("SELECT * FROM "); databaseType.appendEscapedEntityName(sb, baseFooTableInfo.getTabl... | public QueryBuilder<T, ID> limit(Long maxRows) { limit = maxRows; return this; } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> limit(Long maxRows) { limit = maxRows; return this; } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> limit(Long maxRows) { limit = maxRows; return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> limit(Long maxRows) { limit = maxRows; return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ID> selec... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> limit(Long maxRows) { limit = maxRows; return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ID> selec... |
@Test public void testOffset() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); long offset = 1; long limit = 2; qb.offset(offset); qb.limit(limit); StringBuilder sb = new StringBuilder(); sb.append("SELECT * FROM "); databaseType.appendEscapedEnti... | public QueryBuilder<T, ID> offset(Long startRow) throws SQLException { if (databaseType.isOffsetSqlSupported()) { offset = startRow; return this; } else { throw new SQLException("Offset is not supported by this database"); } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> offset(Long startRow) throws SQLException { if (databaseType.isOffsetSqlSupported()) { offset = startRow; return this; } else { throw new SQLException("Offset is not supported by this database"); } } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> offset(Long startRow) throws SQLException { if (databaseType.isOffsetSqlSupported()) { offset = startRow; return this; } else { throw new SQLException("Offset is not supported by this database"); } } QueryBuilder(DatabaseType databaseType, TableI... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> offset(Long startRow) throws SQLException { if (databaseType.isOffsetSqlSupported()) { offset = startRow; return this; } else { throw new SQLException("Offset is not supported by this database"); } } QueryBuilder(DatabaseType databaseType, TableI... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> offset(Long startRow) throws SQLException { if (databaseType.isOffsetSqlSupported()) { offset = startRow; return this; } else { throw new SQLException("Offset is not supported by this database"); } } QueryBuilder(DatabaseType databaseType, TableI... |
@Test public void testWhere() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); Where<Foo, Integer> where = qb.where(); String val = "1"; where.eq(Foo.ID_COLUMN_NAME, val); StringBuilder sb = new StringBuilder(); sb.append("SELECT * FROM "); databas... | @Override protected String getTableName() { return (alias == null ? tableName : alias); } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ... | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ... |
@Test public void testWhereSelectArg() throws Exception { QueryBuilder<Foo, Integer> qb = new QueryBuilder<Foo, Integer>(databaseType, baseFooTableInfo, null); Where<Foo, Integer> where = qb.where(); SelectArg val = new SelectArg(); where.eq(Foo.ID_COLUMN_NAME, val); StringBuilder sb = new StringBuilder(); sb.append("S... | @Override protected String getTableName() { return (alias == null ? tableName : alias); } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ... | QueryBuilder extends StatementBuilder<T, ID> { @Override protected String getTableName() { return (alias == null ? tableName : alias); } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumns(String... columns); QueryBuilder<T, ... |
@Test public void testOrderByRaw() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); Foo foo1 = new Foo(); foo1.val = 1; foo1.equal = 10; assertEquals(1, dao.create(foo1)); Foo foo2 = new Foo(); foo2.val = 5; foo2.equal = 7; assertEquals(1, dao.create(foo2)); List<Foo> results = dao.queryBuilder() ... | public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumn... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> orderByRaw(String rawSql) { addOrderBy(new OrderBy(rawSql, (ArgumentHolder[]) null)); return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao); PreparedQuery<T> prepare(); QueryBuilder<T, ID> selectColumn... |
@SuppressWarnings("unchecked") @Test public void testMixAndOrInline() throws Exception { Dao<Foo, String> dao = createDao(Foo.class, true); Foo foo1 = new Foo(); foo1.val = 10; foo1.stringField = "zip"; assertEquals(1, dao.create(foo1)); Foo foo2 = new Foo(); foo2.val = foo1.val; foo2.stringField = foo1.stringField + "... | public QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao) { super(databaseType, tableInfo, dao, StatementType.SELECT); this.idField = tableInfo.getIdField(); this.selectIdColumn = (idField != null); } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao) { super(databaseType, tableInfo, dao, StatementType.SELECT); this.idField = tableInfo.getIdField(); this.selectIdColumn = (idField != null); } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao) { super(databaseType, tableInfo, dao, StatementType.SELECT); this.idField = tableInfo.getIdField(); this.selectIdColumn = (idField != null); } QueryBuilder(DatabaseType databaseType,... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao) { super(databaseType, tableInfo, dao, StatementType.SELECT); this.idField = tableInfo.getIdField(); this.selectIdColumn = (idField != null); } QueryBuilder(DatabaseType databaseType,... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao) { super(databaseType, tableInfo, dao, StatementType.SELECT); this.idField = tableInfo.getIdField(); this.selectIdColumn = (idField != null); } QueryBuilder(DatabaseType databaseType,... |
@Test public void testLeftJoin() throws Exception { Dao<Bar, Integer> barDao = createDao(Bar.class, true); Dao<Baz, Integer> bazDao = createDao(Baz.class, true); Bar bar1 = new Bar(); bar1.val = 2234; assertEquals(1, barDao.create(bar1)); Bar bar2 = new Bar(); bar2.val = 324322234; assertEquals(1, barDao.create(bar2));... | public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; } } | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID... | QueryBuilder extends StatementBuilder<T, ID> { public QueryBuilder<T, ID> leftJoin(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException { addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.AND); return this; } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID... |
@Test public void testCountOf() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); QueryBuilder<Foo, Integer> qb = dao.queryBuilder(); assertEquals(0, qb.countOf()); Foo foo1 = new Foo(); int val = 123213; foo1.val = val; assertEquals(1, dao.create(foo1)); assertEquals(1, qb.countOf()); Foo foo2 = n... | public long countOf() throws SQLException { String countOfQuerySave = this.countOfQuery; try { setCountOf(true); return dao.countOf(prepare()); } finally { setCountOf(countOfQuerySave); } } | QueryBuilder extends StatementBuilder<T, ID> { public long countOf() throws SQLException { String countOfQuerySave = this.countOfQuery; try { setCountOf(true); return dao.countOf(prepare()); } finally { setCountOf(countOfQuerySave); } } } | QueryBuilder extends StatementBuilder<T, ID> { public long countOf() throws SQLException { String countOfQuerySave = this.countOfQuery; try { setCountOf(true); return dao.countOf(prepare()); } finally { setCountOf(countOfQuerySave); } } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao)... | QueryBuilder extends StatementBuilder<T, ID> { public long countOf() throws SQLException { String countOfQuerySave = this.countOfQuery; try { setCountOf(true); return dao.countOf(prepare()); } finally { setCountOf(countOfQuerySave); } } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao)... | QueryBuilder extends StatementBuilder<T, ID> { public long countOf() throws SQLException { String countOfQuerySave = this.countOfQuery; try { setCountOf(true); return dao.countOf(prepare()); } finally { setCountOf(countOfQuerySave); } } QueryBuilder(DatabaseType databaseType, TableInfo<T, ID> tableInfo, Dao<T, ID> dao)... |
@Test public void attr() { Document doc = Jsoup.parse("<p title=foo><p title=bar><p class=foo><p class=bar>"); String classVal = doc.select("p").attr("class"); assertEquals("foo", classVal); } | public String attr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return element.attr(attributeKey); } return ""; } | Elements extends ArrayList<Element> { public String attr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return element.attr(attributeKey); } return ""; } } | Elements extends ArrayList<Element> { public String attr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return element.attr(attributeKey); } return ""; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Ele... | Elements extends ArrayList<Element> { public String attr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return element.attr(attributeKey); } return ""; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Ele... | Elements extends ArrayList<Element> { public String attr(String attributeKey) { for (Element element : this) { if (element.hasAttr(attributeKey)) return element.attr(attributeKey); } return ""; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Ele... |
@Test(expected = IllegalArgumentException.class) public void testAppendValueNull() throws Exception { List<Object> objList = new ArrayList<Object>(); objList.add(null); In in = new In("foo", numberFieldType, objList, true); in.appendValue(null, new StringBuilder(), null); } | @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" + columnName + "' is null"); ... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... |
@Test public void testAppendValue() throws Exception { List<Object> objList = new ArrayList<Object>(); Random random = new Random(); int numArgs = 100; for (int i = 0; i < numArgs; i++) { objList.add((Integer) random.nextInt()); } In in = new In("foo", numberFieldType, objList, true); StringBuilder sb = new StringBuild... | @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" + columnName + "' is null"); ... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... | In extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> columnArgList) throws SQLException { sb.append('('); boolean first = true; for (Object value : objects) { if (value == null) { throw new IllegalArgumentException("one of the IN values for '" +... |
@Test public void testAppendOperation() throws Exception { int low = 10; int high = 20; Between btw = new Between(COLUMN_NAME, numberFieldType, low, high); StringBuilder sb = new StringBuilder(); btw.appendOperation(sb); assertTrue(sb.toString().contains("BETWEEN")); sb.setLength(0); btw.appendValue(null, sb, new Array... | @Override public void appendOperation(StringBuilder sb) { sb.append("BETWEEN "); } | Between extends BaseComparison { @Override public void appendOperation(StringBuilder sb) { sb.append("BETWEEN "); } } | Between extends BaseComparison { @Override public void appendOperation(StringBuilder sb) { sb.append("BETWEEN "); } Between(String columnName, FieldType fieldType, Object low, Object high); } | Between extends BaseComparison { @Override public void appendOperation(StringBuilder sb) { sb.append("BETWEEN "); } Between(String columnName, FieldType fieldType, Object low, Object high); @Override void appendOperation(StringBuilder sb); @Override void appendValue(DatabaseType databaseType, StringBuilder sb, List<Arg... | Between extends BaseComparison { @Override public void appendOperation(StringBuilder sb) { sb.append("BETWEEN "); } Between(String columnName, FieldType fieldType, Object low, Object high); @Override void appendOperation(StringBuilder sb); @Override void appendValue(DatabaseType databaseType, StringBuilder sb, List<Arg... |
@Test(expected = IllegalArgumentException.class) public void testAppendValueLowNull() throws Exception { new Between(COLUMN_NAME, numberFieldType, null, 20L).appendValue(null, new StringBuilder(), new ArrayList<ArgumentHolder>()); } | @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgumentException("BETWEEN high value for... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... |
@Test(expected = IllegalArgumentException.class) public void testAppendValueHighNull() throws Exception { new Between(COLUMN_NAME, numberFieldType, 10L, null).appendValue(null, new StringBuilder(), new ArrayList<ArgumentHolder>()); } | @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgumentException("BETWEEN high value for... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... | Between extends BaseComparison { @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) throws SQLException { if (low == null) { throw new IllegalArgumentException("BETWEEN low value for '" + columnName + "' is null"); } if (high == null) { throw new IllegalArgument... |
@Test(expected = SQLException.class) public void testAppendArgOrValueNull() throws Exception { cmpInt.appendArgOrValue(null, numberFieldType, new StringBuilder(), new ArrayList<ArgumentHolder>(), null); } | protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFieldName() + "' is null"); } else if (arg... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... |
@Test public void testAppendArgOrValueString() throws SQLException { String value = "23wbdqwbdq13"; StringBuilder sb = new StringBuilder(); DatabaseType databaseType = createMock(DatabaseType.class); databaseType.appendEscapedWord(sb, value); replay(databaseType); cmpString.appendArgOrValue(databaseType, stringFieldTyp... | protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFieldName() + "' is null"); } else if (arg... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... |
@Test(expected = SQLException.class) public void testForeignIdNull() throws Exception { StringBuilder sb = new StringBuilder(); Field field = ForeignNull.class.getDeclaredField("foreign"); FieldType fieldType = FieldType.createFieldType(connectionSource, "BaseFoo", field, ForeignNull.class); fieldType.configDaoInformat... | protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFieldName() + "' is null"); } else if (arg... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... | BaseComparison implements Comparison { protected void appendArgOrValue(DatabaseType databaseType, FieldType fieldType, StringBuilder sb, List<ArgumentHolder> argList, Object argOrValue) throws SQLException { boolean appendSpace = true; if (argOrValue == null) { throw new SQLException("argument for '" + fieldType.getFie... |
@Test(expected = IllegalArgumentException.class) public void test() { Not not = new Not(); Clause clause = new Comparison() { @Override public void appendOperation(StringBuilder sb) { } @Override public void appendValue(DatabaseType databaseType, StringBuilder sb, List<ArgumentHolder> argList) { } @Override public Stri... | @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instanceof Exists) { this.exists = (Exists) clause;... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... |
@Test(expected = IllegalStateException.class) public void testNoClause() throws Exception { Not not = new Not(); not.appendSql(databaseType, null, new StringBuilder(), new ArrayList<ArgumentHolder>()); } | @Override public void appendSql(DatabaseType databaseType, String tableName, StringBuilder sb, List<ArgumentHolder> selectArgList) throws SQLException { if (comparison == null && exists == null) { throw new IllegalStateException("Clause has not been set in NOT operation"); } if (comparison == null) { sb.append("(NOT ")... | Not implements Clause, NeedsFutureClause { @Override public void appendSql(DatabaseType databaseType, String tableName, StringBuilder sb, List<ArgumentHolder> selectArgList) throws SQLException { if (comparison == null && exists == null) { throw new IllegalStateException("Clause has not been set in NOT operation"); } i... | Not implements Clause, NeedsFutureClause { @Override public void appendSql(DatabaseType databaseType, String tableName, StringBuilder sb, List<ArgumentHolder> selectArgList) throws SQLException { if (comparison == null && exists == null) { throw new IllegalStateException("Clause has not been set in NOT operation"); } i... | Not implements Clause, NeedsFutureClause { @Override public void appendSql(DatabaseType databaseType, String tableName, StringBuilder sb, List<ArgumentHolder> selectArgList) throws SQLException { if (comparison == null && exists == null) { throw new IllegalStateException("Clause has not been set in NOT operation"); } i... | Not implements Clause, NeedsFutureClause { @Override public void appendSql(DatabaseType databaseType, String tableName, StringBuilder sb, List<ArgumentHolder> selectArgList) throws SQLException { if (comparison == null && exists == null) { throw new IllegalStateException("Clause has not been set in NOT operation"); } i... |
@Test public void text() { String h = "<div><p>Hello<p>there<p>world</div>"; Document doc = Jsoup.parse(h); assertEquals("Hello there world", doc.select("div > *").text()); } | public String text() { StringBuilder sb = new StringBuilder(); for (Element element : this) { if (sb.length() != 0) sb.append(" "); sb.append(element.text()); } return sb.toString(); } | Elements extends ArrayList<Element> { public String text() { StringBuilder sb = new StringBuilder(); for (Element element : this) { if (sb.length() != 0) sb.append(" "); sb.append(element.text()); } return sb.toString(); } } | Elements extends ArrayList<Element> { public String text() { StringBuilder sb = new StringBuilder(); for (Element element : this) { if (sb.length() != 0) sb.append(" "); sb.append(element.text()); } return sb.toString(); } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(Li... | Elements extends ArrayList<Element> { public String text() { StringBuilder sb = new StringBuilder(); for (Element element : this) { if (sb.length() != 0) sb.append(" "); sb.append(element.text()); } return sb.toString(); } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(Li... | Elements extends ArrayList<Element> { public String text() { StringBuilder sb = new StringBuilder(); for (Element element : this) { if (sb.length() != 0) sb.append(" "); sb.append(element.text()); } return sb.toString(); } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(Li... |
@Test(expected = IllegalArgumentException.class) public void testBaseNotClause() { Not not = new Not(); not.setMissingClause(new ManyClause((Clause) null, "AND")); } | @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instanceof Exists) { this.exists = (Exists) clause;... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... | Not implements Clause, NeedsFutureClause { @Override public void setMissingClause(Clause clause) { if (this.comparison != null) { throw new IllegalArgumentException("NOT operation already has a comparison set"); } else if (clause instanceof Comparison) { this.comparison = (Comparison) clause; } else if (clause instance... |
@Test public void testToString() throws Exception { String name = "foo"; String value = "bar"; SimpleComparison eq = new SimpleComparison(name, numberFieldType, value, SimpleComparison.EQUAL_TO_OPERATION); Not not = new Not(); assertTrue(not.toString().contains("NOT without comparison")); not.setMissingClause(eq); asse... | @Override public String toString() { if (comparison == null) { return "NOT without comparison"; } else { return "NOT comparison " + comparison; } } | Not implements Clause, NeedsFutureClause { @Override public String toString() { if (comparison == null) { return "NOT without comparison"; } else { return "NOT comparison " + comparison; } } } | Not implements Clause, NeedsFutureClause { @Override public String toString() { if (comparison == null) { return "NOT without comparison"; } else { return "NOT comparison " + comparison; } } Not(); Not(Clause clause); } | Not implements Clause, NeedsFutureClause { @Override public String toString() { if (comparison == null) { return "NOT without comparison"; } else { return "NOT comparison " + comparison; } } Not(); Not(Clause clause); @Override void setMissingClause(Clause clause); @Override void appendSql(DatabaseType databaseType, S... | Not implements Clause, NeedsFutureClause { @Override public String toString() { if (comparison == null) { return "NOT without comparison"; } else { return "NOT comparison " + comparison; } } Not(); Not(Clause clause); @Override void setMissingClause(Clause clause); @Override void appendSql(DatabaseType databaseType, S... |
@Test public void testQueryRawColumns() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); Foo foo1 = new Foo(); foo1.val = 1; foo1.equal = 10; assertEquals(1, dao.create(foo1)); Foo foo2 = new Foo(); foo2.val = 10; foo2.equal = 5; assertEquals(1, dao.create(foo2)); QueryBuilder<Foo, Integer> qb = d... | @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } } | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsIm... | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsIm... | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsIm... |
@Test public void testHaving() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); Foo foo = new Foo(); int val1 = 243342; foo.val = val1; assertEquals(1, dao.create(foo)); foo = new Foo(); foo.val = val1; assertEquals(1, dao.create(foo)); foo = new Foo(); int val2 = 6543; foo.val = val2; assertEqual... | @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } } | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsIm... | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsIm... | RawResultsImpl implements GenericRawResults<T> { @Override public List<T> getResults() throws SQLException { List<T> results = new ArrayList<T>(); try { while (iterator.hasNext()) { results.add(iterator.next()); } return results; } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsIm... |
@Test public void testGetFirstResult() throws Exception { Dao<Foo, Integer> dao = createDao(Foo.class, true); Foo foo1 = new Foo(); foo1.val = 342; assertEquals(1, dao.create(foo1)); Foo foo2 = new Foo(); foo2.val = 9045342; assertEquals(1, dao.create(foo2)); QueryBuilder<Foo, Integer> qb = dao.queryBuilder(); qb.selec... | @Override public T getFirstResult() throws SQLException { try { if (iterator.hasNextThrow()) { return iterator.nextThrow(); } else { return null; } } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } | RawResultsImpl implements GenericRawResults<T> { @Override public T getFirstResult() throws SQLException { try { if (iterator.hasNextThrow()) { return iterator.nextThrow(); } else { return null; } } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } } | RawResultsImpl implements GenericRawResults<T> { @Override public T getFirstResult() throws SQLException { try { if (iterator.hasNextThrow()) { return iterator.nextThrow(); } else { return null; } } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsImpl(ConnectionSource connectionSou... | RawResultsImpl implements GenericRawResults<T> { @Override public T getFirstResult() throws SQLException { try { if (iterator.hasNextThrow()) { return iterator.nextThrow(); } else { return null; } } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsImpl(ConnectionSource connectionSou... | RawResultsImpl implements GenericRawResults<T> { @Override public T getFirstResult() throws SQLException { try { if (iterator.hasNextThrow()) { return iterator.nextThrow(); } else { return null; } } finally { IOUtils.closeThrowSqlException(this, "raw results iterator"); } } RawResultsImpl(ConnectionSource connectionSou... |
@Test(expected = SQLException.class) public void testNoIdBuildDelete() throws Exception { DatabaseConnection databaseConnection = createMock(DatabaseConnection.class); ConnectionSource connectionSource = createMock(ConnectionSource.class); expect(connectionSource.getDatabaseType()).andReturn(databaseType).anyTimes(); r... | public static <T, ID> int deleteObjects(DatabaseType databaseType, TableInfo<T, ID> tableInfo, DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException { MappedDeleteCollection<T, ID> deleteCollection = MappedDeleteCollection.build(databaseType, tableInfo, datas.size()); ... | MappedDeleteCollection extends BaseMappedStatement<T, ID> { public static <T, ID> int deleteObjects(DatabaseType databaseType, TableInfo<T, ID> tableInfo, DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException { MappedDeleteCollection<T, ID> deleteCollection = MappedDel... | MappedDeleteCollection extends BaseMappedStatement<T, ID> { public static <T, ID> int deleteObjects(DatabaseType databaseType, TableInfo<T, ID> tableInfo, DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException { MappedDeleteCollection<T, ID> deleteCollection = MappedDel... | MappedDeleteCollection extends BaseMappedStatement<T, ID> { public static <T, ID> int deleteObjects(DatabaseType databaseType, TableInfo<T, ID> tableInfo, DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException { MappedDeleteCollection<T, ID> deleteCollection = MappedDel... | MappedDeleteCollection extends BaseMappedStatement<T, ID> { public static <T, ID> int deleteObjects(DatabaseType databaseType, TableInfo<T, ID> tableInfo, DatabaseConnection databaseConnection, Collection<T> datas, ObjectCache objectCache) throws SQLException { MappedDeleteCollection<T, ID> deleteCollection = MappedDel... |
@Test public void testMappedQuery() throws Exception { Field field = Foo.class.getDeclaredField(Foo.ID_COLUMN_NAME); String tableName = "basefoo"; FieldType[] resultFieldTypes = new FieldType[] { FieldType.createFieldType(connectionSource, tableName, field, Foo.class) }; BaseMappedQuery<Foo, Integer> baseMappedQuery = ... | @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache objectCache = results.getObjectCacheForRetrieve(); if (objectCache != null) { Object id ... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... |
@Test public void testMappedQueryCached() throws Exception { Field field = Foo.class.getDeclaredField(Foo.ID_COLUMN_NAME); String tableName = "basefoo"; FieldType[] resultFieldTypes = new FieldType[] { FieldType.createFieldType(connectionSource, tableName, field, Foo.class) }; BaseMappedQuery<Foo, Integer> baseMappedQu... | @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache objectCache = results.getObjectCacheForRetrieve(); if (objectCache != null) { Object id ... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... | BaseMappedQuery extends BaseMappedStatement<T, ID> implements GenericRowMapper<T> { @Override public T mapRow(DatabaseResults results) throws SQLException { Map<String, Integer> colPosMap; if (columnPositions == null) { colPosMap = new HashMap<String, Integer>(); } else { colPosMap = columnPositions; } ObjectCache obje... |
@Test public void testGeneratedId() throws Exception { TableInfo<GeneratedId, Integer> tableInfo = new TableInfo<GeneratedId, Integer>(connectionSource, null, GeneratedId.class); StatementExecutor<GeneratedId, Integer> se = new StatementExecutor<GeneratedId, Integer>(databaseType, tableInfo, null); DatabaseConnection d... | public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFieldValueDefault(data)) { assignId = false; } else ... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... |
@Test public void testGeneratedIdSequence() throws Exception { DatabaseType databaseType = new NeedsSequenceDatabaseType(); connectionSource.setDatabaseType(databaseType); TableInfo<GeneratedId, Integer> tableInfo = new TableInfo<GeneratedId, Integer>(connectionSource, null, GeneratedId.class); StatementExecutor<Genera... | public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFieldValueDefault(data)) { assignId = false; } else ... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... |
@Test public void hasText() { Document doc = Jsoup.parse("<div><p>Hello</p></div><div><p></p></div>"); Elements divs = doc.select("div"); assertTrue(divs.hasText()); assertFalse(doc.select("div + div").hasText()); } | public boolean hasText() { for (Element element: this) { if (element.hasText()) return true; } return false; } | Elements extends ArrayList<Element> { public boolean hasText() { for (Element element: this) { if (element.hasText()) return true; } return false; } } | Elements extends ArrayList<Element> { public boolean hasText() { for (Element element: this) { if (element.hasText()) return true; } return false; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Elements(Element... elements); } | Elements extends ArrayList<Element> { public boolean hasText() { for (Element element: this) { if (element.hasText()) return true; } return false; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Elements(Element... elements); @Override Elements ... | Elements extends ArrayList<Element> { public boolean hasText() { for (Element element: this) { if (element.hasText()) return true; } return false; } Elements(); Elements(int initialCapacity); Elements(Collection<Element> elements); Elements(List<Element> elements); Elements(Element... elements); @Override Elements ... |
@Test public void testGeneratedIdSequenceLong() throws Exception { DatabaseType databaseType = new NeedsSequenceDatabaseType(); connectionSource.setDatabaseType(databaseType); StatementExecutor<GeneratedIdLong, Long> se = new StatementExecutor<GeneratedIdLong, Long>(databaseType, new TableInfo<GeneratedIdLong, Long>( c... | public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFieldValueDefault(data)) { assignId = false; } else ... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... | MappedCreate extends BaseMappedStatement<T, ID> { public int insert(DatabaseType databaseType, DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { KeyHolder keyHolder = null; if (idField != null) { boolean assignId; if (idField.isAllowGeneratedIdInsert() && !idField.isObjectsFi... |
@Test public void testNoCreateSequence() throws Exception { MappedCreate.build(databaseType, new TableInfo<GeneratedId, Integer>(connectionSource, null, GeneratedId.class)); } | public static <T, ID> MappedCreate<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) { StringBuilder sb = new StringBuilder(128); appendTableName(databaseType, sb, "INSERT INTO ", tableInfo.getTableName()); int argFieldC = 0; int versionFieldTypeIndex = -1; for (FieldType fieldType : tableInfo.getFiel... | MappedCreate extends BaseMappedStatement<T, ID> { public static <T, ID> MappedCreate<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) { StringBuilder sb = new StringBuilder(128); appendTableName(databaseType, sb, "INSERT INTO ", tableInfo.getTableName()); int argFieldC = 0; int versionFieldTypeIndex ... | MappedCreate extends BaseMappedStatement<T, ID> { public static <T, ID> MappedCreate<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) { StringBuilder sb = new StringBuilder(128); appendTableName(databaseType, sb, "INSERT INTO ", tableInfo.getTableName()); int argFieldC = 0; int versionFieldTypeIndex ... | MappedCreate extends BaseMappedStatement<T, ID> { public static <T, ID> MappedCreate<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) { StringBuilder sb = new StringBuilder(128); appendTableName(databaseType, sb, "INSERT INTO ", tableInfo.getTableName()); int argFieldC = 0; int versionFieldTypeIndex ... | MappedCreate extends BaseMappedStatement<T, ID> { public static <T, ID> MappedCreate<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) { StringBuilder sb = new StringBuilder(128); appendTableName(databaseType, sb, "INSERT INTO ", tableInfo.getTableName()); int argFieldC = 0; int versionFieldTypeIndex ... |
@Test(expected = SQLException.class) public void testUpdateIdNoId() throws Exception { MappedUpdateId.build(databaseType, new TableInfo<NoId, Void>(connectionSource, null, NoId.class)); } | public static <T, ID> MappedUpdateId<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot update-id in " + tableInfo.getDataClass() + " because it doesn't have an id field"); } StringBu... | MappedUpdateId extends BaseMappedStatement<T, ID> { public static <T, ID> MappedUpdateId<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot update-id in " + tableInfo.getDataClass() +... | MappedUpdateId extends BaseMappedStatement<T, ID> { public static <T, ID> MappedUpdateId<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot update-id in " + tableInfo.getDataClass() +... | MappedUpdateId extends BaseMappedStatement<T, ID> { public static <T, ID> MappedUpdateId<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot update-id in " + tableInfo.getDataClass() +... | MappedUpdateId extends BaseMappedStatement<T, ID> { public static <T, ID> MappedUpdateId<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot update-id in " + tableInfo.getDataClass() +... |
@Test(expected = SQLException.class) public void testDeleteNoId() throws Exception { StatementExecutor<NoId, Void> se = new StatementExecutor<NoId, Void>(databaseType, new TableInfo<NoId, Void>(connectionSource, null, NoId.class), null); NoId noId = new NoId(); noId.stuff = "1"; ConnectionSource connectionSource = crea... | public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { Object[] args = getFieldObjects(data); int rowC = databaseConnection.delete(statement, args, argFieldTypes); logger.debug("delete data with statement '{}' and {} args, changed {} rows", statement, args.... | MappedDelete extends BaseMappedStatement<T, ID> { public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { Object[] args = getFieldObjects(data); int rowC = databaseConnection.delete(statement, args, argFieldTypes); logger.debug("delete data with statement '{... | MappedDelete extends BaseMappedStatement<T, ID> { public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { Object[] args = getFieldObjects(data); int rowC = databaseConnection.delete(statement, args, argFieldTypes); logger.debug("delete data with statement '{... | MappedDelete extends BaseMappedStatement<T, ID> { public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { Object[] args = getFieldObjects(data); int rowC = databaseConnection.delete(statement, args, argFieldTypes); logger.debug("delete data with statement '{... | MappedDelete extends BaseMappedStatement<T, ID> { public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException { try { Object[] args = getFieldObjects(data); int rowC = databaseConnection.delete(statement, args, argFieldTypes); logger.debug("delete data with statement '{... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.