1 21 package oracle.toplink.essentials.internal.expressions; 23 24 import java.io.*; 25 import oracle.toplink.essentials.exceptions.*; 26 import oracle.toplink.essentials.queryframework.*; 27 import oracle.toplink.essentials.internal.databaseaccess.DatabaseCall; 28 import oracle.toplink.essentials.internal.sessions.AbstractSession; 29 30 38 public class SQLDeleteStatement extends SQLModifyStatement { 39 40 43 public DatabaseCall buildCall(AbstractSession session) { 44 SQLCall call = new SQLCall(); 45 call.returnNothing(); 46 47 Writer writer = new CharArrayWriter(100); 48 try { 49 writer.write("DELETE "); 50 writer.write("FROM "); 51 writer.write(getTable().getQualifiedName()); 52 53 if (getWhereClause() != null) { 54 writer.write(" WHERE "); 55 ExpressionSQLPrinter printer = new ExpressionSQLPrinter(session, getTranslationRow(), call, false); 56 printer.setWriter(writer); 57 printer.printExpression(getWhereClause()); 58 } 59 60 call.setSQLString(writer.toString()); 61 } catch (IOException exception) { 62 throw ValidationException.fileError(exception); 63 } 64 return call; 65 } 66 } 67 | Popular Tags |