@Test(expected = SQLException.class) public void testNoIdBuildDelete() throws Exception { MappedDelete.build(databaseType, new TableInfo<NoId, Void>(connectionSource, null, NoId.class)); }
public static <T, ID> MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot delete from " + tableInfo.getDataClass() + " because it doesn't have an id field"); } StringBuilder sb = new StringBuilder(64); appendTableName(databaseType, sb, "DELETE FROM ", tableInfo.getTableName()); appendWhereFieldEq(databaseType, idField, sb, null); return new MappedDelete<T, ID>(tableInfo, sb.toString(), new FieldType[] { idField }); }
MappedDelete extends BaseMappedStatement<T, ID> { public static <T, ID> MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot delete from " + tableInfo.getDataClass() + " because it doesn't have an id field"); } StringBuilder sb = new StringBuilder(64); appendTableName(databaseType, sb, "DELETE FROM ", tableInfo.getTableName()); appendWhereFieldEq(databaseType, idField, sb, null); return new MappedDelete<T, ID>(tableInfo, sb.toString(), new FieldType[] { idField }); } }
MappedDelete extends BaseMappedStatement<T, ID> { public static <T, ID> MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot delete from " + tableInfo.getDataClass() + " because it doesn't have an id field"); } StringBuilder sb = new StringBuilder(64); appendTableName(databaseType, sb, "DELETE FROM ", tableInfo.getTableName()); appendWhereFieldEq(databaseType, idField, sb, null); return new MappedDelete<T, ID>(tableInfo, sb.toString(), new FieldType[] { idField }); } private  MappedDelete(TableInfo<T, ID> tableInfo, String statement, FieldType[] argFieldTypes); }
MappedDelete extends BaseMappedStatement<T, ID> { public static <T, ID> MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot delete from " + tableInfo.getDataClass() + " because it doesn't have an id field"); } StringBuilder sb = new StringBuilder(64); appendTableName(databaseType, sb, "DELETE FROM ", tableInfo.getTableName()); appendWhereFieldEq(databaseType, idField, sb, null); return new MappedDelete<T, ID>(tableInfo, sb.toString(), new FieldType[] { idField }); } private  MappedDelete(TableInfo<T, ID> tableInfo, String statement, FieldType[] argFieldTypes); static MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo); int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache); int deleteById(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache); }
MappedDelete extends BaseMappedStatement<T, ID> { public static <T, ID> MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo) throws SQLException { FieldType idField = tableInfo.getIdField(); if (idField == null) { throw new SQLException("Cannot delete from " + tableInfo.getDataClass() + " because it doesn't have an id field"); } StringBuilder sb = new StringBuilder(64); appendTableName(databaseType, sb, "DELETE FROM ", tableInfo.getTableName()); appendWhereFieldEq(databaseType, idField, sb, null); return new MappedDelete<T, ID>(tableInfo, sb.toString(), new FieldType[] { idField }); } private  MappedDelete(TableInfo<T, ID> tableInfo, String statement, FieldType[] argFieldTypes); static MappedDelete<T, ID> build(DatabaseType databaseType, TableInfo<T, ID> tableInfo); int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache); int deleteById(DatabaseConnection databaseConnection, ID id, ObjectCache objectCache);  }