1 56 package org.objectstyle.cayenne.access.trans; 57 58 import org.objectstyle.cayenne.map.DbEntity; 59 import org.objectstyle.cayenne.map.DbRelationship; 60 61 66 public class DeleteTranslator extends QueryAssembler { 67 68 public String aliasForTable(DbEntity dbEnt) { 69 throw new RuntimeException ("aliases not supported"); 70 } 71 72 public void dbRelationshipAdded(DbRelationship dbRel) { 73 throw new RuntimeException ("db relationships not supported"); 74 } 75 76 79 public String createSqlString() throws Exception { 80 StringBuffer queryBuf = new StringBuffer ("DELETE FROM "); 81 82 DbEntity dbEnt = getEntityResolver().lookupDbEntity(query); 84 queryBuf.append(dbEnt.getFullyQualifiedName()); 85 86 String qualifierStr = 88 adapter.getQualifierTranslator(this).doTranslation(); 89 if (qualifierStr != null) 90 queryBuf.append(" WHERE ").append(qualifierStr); 91 92 return queryBuf.toString(); 93 } 94 } 95 | Popular Tags |