public String onQueryOverCQL3 ( EntityMetadata m , Client client , MetamodelImpl metaModel , List < String > relations ) { // select column will always be of entity field only! // where clause ordering Class compoundKeyClass = m . getIdAttribute ( ) . getBindableJavaType ( ) ; EmbeddableType compoundKey = null ; String idColumn ; if ( metaModel . isEmbeddable ( compoundKeyClass ) ) { compoundKey = metaModel . embeddable ( compoundKeyClass ) ; idColumn = ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getJPAColumnName ( ) ; } else { idColumn = ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getJPAColumnName ( ) ; } StringBuilder builder = new StringBuilder ( ) ; boolean isPresent = false ; List < String > columns = getColumnList ( m , metaModel , getKunderaQuery ( ) . getResult ( ) , compoundKey ) ; String selectQuery = setSelectQuery ( columns ) ; CQLTranslator translator = new CQLTranslator ( ) ; selectQuery = StringUtils . replace ( selectQuery , CQLTranslator . COLUMN_FAMILY , translator . ensureCase ( new StringBuilder ( ) , m . getTableName ( ) , false ) . toString ( ) ) ; builder = CassandraUtilities . appendColumns ( builder , columns , selectQuery , translator ) ; addWhereClause ( builder ) ; onCondition ( m , metaModel , compoundKey , idColumn , builder , isPresent , translator , true ) ; return builder . toString ( ) ; }
On query over composite columns .