1 19 20 package org.apache.cayenne.access.trans; 21 22 import org.apache.cayenne.map.DbEntity; 23 import org.apache.cayenne.map.DbRelationship; 24 25 30 public class DeleteTranslator extends QueryAssembler { 31 32 public String aliasForTable(DbEntity dbEnt) { 33 throw new RuntimeException ("aliases not supported"); 34 } 35 36 public void dbRelationshipAdded(DbRelationship dbRel) { 37 throw new RuntimeException ("db relationships not supported"); 38 } 39 40 43 public String createSqlString() throws Exception { 44 StringBuffer queryBuf = new StringBuffer ("DELETE FROM "); 45 46 DbEntity dbEnt = getRootDbEntity(); 48 queryBuf.append(dbEnt.getFullyQualifiedName()); 49 50 String qualifierStr = 52 adapter.getQualifierTranslator(this).doTranslation(); 53 if (qualifierStr != null) 54 queryBuf.append(" WHERE ").append(qualifierStr); 55 56 return queryBuf.toString(); 57 } 58 } 59 | Popular Tags |