protected String onDeleteQuery ( EntityMetadata metadata , String tableName , MetamodelImpl metaModel , Object keyObject ) { CQLTranslator translator = new CQLTranslator ( ) ; String deleteQuery = CQLTranslator . DELETE_QUERY ; deleteQuery = StringUtils . replace ( deleteQuery , CQLTranslator . COLUMN_FAMILY , translator . ensureCase ( new StringBuilder ( ) , tableName , false ) . toString ( ) ) ; StringBuilder deleteQueryBuilder = new StringBuilder ( deleteQuery ) ; deleteQueryBuilder . append ( CQLTranslator . ADD_WHERE_CLAUSE ) ; onWhereClause ( metadata , keyObject , translator , deleteQueryBuilder , metaModel , metadata . getIdAttribute ( ) ) ; // strip last "AND" clause. deleteQueryBuilder . delete ( deleteQueryBuilder . lastIndexOf ( CQLTranslator . AND_CLAUSE ) , deleteQueryBuilder . length ( ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Returning delete query {}." , deleteQueryBuilder . toString ( ) ) ; } return deleteQueryBuilder . toString ( ) ; }
On delete query .