protected String buildDeleteSQL(final TableMetadata metadata, final Class<? extends Object> type,
			final SqlConfig sqlConfig, final boolean addCondition) {
		StringBuilder sql = new StringBuilder("DELETE ").append("/* ")
				.append(sqlConfig.getSqlAgentFactory().getSqlIdKeyName()).append(" */")
				.append(" FROM ").append(metadata.getTableIdentifier()).append("").append(System.lineSeparator());

		if (addCondition) {
			boolean firstFlag = true;
			sql.append("WHERE").append(System.lineSeparator());

			List<? extends Column> cols = !metadata.getKeyColumns().isEmpty() ? metadata.getKeyColumns()
					: Arrays
							.asList(metadata.getColumns().get(0));
			for (TableMetadata.Column col : cols) {
				StringBuilder parts = new StringBuilder().append("\t");
				if (firstFlag) {
					if (col.isNullable()) {
						parts.append("AND ");
					} else {
						parts.append("    ");
					}
					firstFlag = false;
				} else {
					parts.append("AND ");
				}
				parts.append(col.getColumnIdentifier()).append(" = ").append("/*").append(col.getCamelColumnName())
						.append("*/''").append(System.lineSeparator());
				if (col.isNullable()) {
					wrapIfComment(sql, parts, col);
				} else {
					sql.append(parts);
				}
			}
		}
		return sql.toString();
	}
protected String buildDeleteSQL ( final TableMetadata metadata , final Class < ? extends Object > type , final SqlConfig sqlConfig , final boolean addCondition ) { StringBuilder sql = new StringBuilder ( "DELETE " ) . append ( "/* " ) . append ( sqlConfig . getSqlAgentFactory ( ) . getSqlIdKeyName ( ) ) . append ( " */" ) . append ( " FROM " ) . append ( metadata . getTableIdentifier ( ) ) . append ( "" ) . append ( System . lineSeparator ( ) ) ; if ( addCondition ) { boolean firstFlag = true ; sql . append ( "WHERE" ) . append ( System . lineSeparator ( ) ) ; List < ? extends Column > cols = ! metadata . getKeyColumns ( ) . isEmpty ( ) ? metadata . getKeyColumns ( ) : Arrays . asList ( metadata . getColumns ( ) . get ( 0 ) ) ; for ( TableMetadata . Column col : cols ) { StringBuilder parts = new StringBuilder ( ) . append ( "\t" ) ; if ( firstFlag ) { if ( col . isNullable ( ) ) { parts . append ( "AND " ) ; } else { parts . append ( "    " ) ; } firstFlag = false ; } else { parts . append ( "AND " ) ; } parts . append ( col . getColumnIdentifier ( ) ) . append ( " = " ) . append ( "/*" ) . append ( col . getCamelColumnName ( ) ) . append ( "*/''" ) . append ( System . lineSeparator ( ) ) ; if ( col . isNullable ( ) ) { wrapIfComment ( sql , parts , col ) ; } else { sql . append ( parts ) ; } } } return sql . toString ( ) ; }
DELETE SQL生成

@param metadata エンティティメタ情報
@param type エイティティタイプ
@param sqlConfig SQLコンフィグ
@param addCondition 条件を追加するかどうか。追加する場合<code>true</code>
@return DELETE SQL