public HashMap<TranslationType, Map<String, StringBuilder>> prepareColumnOrColumnValues(final Object record,
            final EntityMetadata entityMetadata, TranslationType type, Map<String, Object> externalProperties,
            final KunderaMetadata kunderaMetadata)
    {
        HashMap<TranslationType, Map<String, StringBuilder>> parsedColumnOrColumnValue = new HashMap<CQLTranslator.TranslationType, Map<String, StringBuilder>>();
        if (type == null)
        {
            throw new TranslationException("Please specify TranslationType: either COLUMN or VALUE");
        }
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());
        Class entityClazz = entityMetadata.getEntityClazz();
        EntityType entityType = metaModel.entity(entityClazz);

        Map<String, StringBuilder> builders = new HashMap<String, StringBuilder>();
        Map<String, StringBuilder> columnBuilders = new HashMap<String, StringBuilder>();

        onTranslation(record, entityMetadata, type, metaModel, entityClazz, entityType, builders, columnBuilders,
                externalProperties, kunderaMetadata);

        for (String tableName : columnBuilders.keySet())
        {
            StringBuilder builder = builders.get(tableName);
            StringBuilder columnBuilder = columnBuilders.get(tableName);

            if (type.equals(TranslationType.ALL) || type.equals(TranslationType.VALUE))
            {
                builder.deleteCharAt(builder.length() - 1);
            }

            if (type.equals(TranslationType.ALL) || type.equals(TranslationType.COLUMN))
            {
                columnBuilder.deleteCharAt(columnBuilder.length() - 1);
            }
        }
        parsedColumnOrColumnValue.put(TranslationType.COLUMN, columnBuilders);

        parsedColumnOrColumnValue.put(TranslationType.VALUE, builders);

        return parsedColumnOrColumnValue;
    }
public HashMap < TranslationType , Map < String , StringBuilder > > prepareColumnOrColumnValues ( final Object record , final EntityMetadata entityMetadata , TranslationType type , Map < String , Object > externalProperties , final KunderaMetadata kunderaMetadata ) { HashMap < TranslationType , Map < String , StringBuilder > > parsedColumnOrColumnValue = new HashMap < CQLTranslator . TranslationType , Map < String , StringBuilder > > ( ) ; if ( type == null ) { throw new TranslationException ( "Please specify TranslationType: either COLUMN or VALUE" ) ; } MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( entityMetadata . getPersistenceUnit ( ) ) ; Class entityClazz = entityMetadata . getEntityClazz ( ) ; EntityType entityType = metaModel . entity ( entityClazz ) ; Map < String , StringBuilder > builders = new HashMap < String , StringBuilder > ( ) ; Map < String , StringBuilder > columnBuilders = new HashMap < String , StringBuilder > ( ) ; onTranslation ( record , entityMetadata , type , metaModel , entityClazz , entityType , builders , columnBuilders , externalProperties , kunderaMetadata ) ; for ( String tableName : columnBuilders . keySet ( ) ) { StringBuilder builder = builders . get ( tableName ) ; StringBuilder columnBuilder = columnBuilders . get ( tableName ) ; if ( type . equals ( TranslationType . ALL ) || type . equals ( TranslationType . VALUE ) ) { builder . deleteCharAt ( builder . length ( ) - 1 ) ; } if ( type . equals ( TranslationType . ALL ) || type . equals ( TranslationType . COLUMN ) ) { columnBuilder . deleteCharAt ( columnBuilder . length ( ) - 1 ) ; } } parsedColumnOrColumnValue . put ( TranslationType . COLUMN , columnBuilders ) ; parsedColumnOrColumnValue . put ( TranslationType . VALUE , builders ) ; return parsedColumnOrColumnValue ; }
Prepares column name or column values.

@param record
entity.
@param entityMetadata
entity meta data
@param type
translation type.
@param externalProperties
the external properties
@param kunderaMetadata
the kundera metadata
@return Map containing translation type as key and string as translated
CQL string.