Populate partial row for embedded column.

@param row
the row
@param embeddable
the embeddable
@param EmbEntity
the emb entity
@param metaModel
the meta model
762375
private void populatePartialRowForEmbeddedColumn(PartialRow row, EmbeddableType embeddable, Object EmbEntity,
            MetamodelImpl metaModel)
    {
        Set<Attribute> attributes = embeddable.getAttributes();
        Iterator<Attribute> iterator = attributes.iterator();
        iterateAndPopulateRow(row, EmbEntity, metaModel, iterator);
    }
894066
public static void populateCompoundKey(DBObject dbObj, EntityMetadata m, MetamodelImpl metaModel, Object id)
    {
        EmbeddableType compoundKey = metaModel.embeddable(m.getIdAttribute().getBindableJavaType());
        // Iterator<Attribute> iter = compoundKey.getAttributes().iterator();
        BasicDBObject compoundKeyObj = new BasicDBObject();

        compoundKeyObj = getCompoundKeyColumns(m, id, compoundKey, metaModel);

        dbObj.put("_id", compoundKeyObj);
    }
740628
protected void addEntityFieldsToDocument(EntityMetadata metadata, Object entity, Document document,
        MetamodelImpl metaModel) {
        String indexName = metadata.getIndexName();
        Map<String, PropertyIndex> indexProperties = metadata.getIndexProperties();
        for (String columnName : indexProperties.keySet()) {
            PropertyIndex index = indexProperties.get(columnName);
            java.lang.reflect.Field property = index.getProperty();
            String propertyName = index.getName();
            addFieldToDocument(entity, document, property, propertyName, indexName);
        }

        if (metaModel.isEmbeddable(metadata.getIdAttribute().getBindableJavaType())) {
            Object id = PropertyAccessorHelper.getId(entity, metadata);
            EmbeddableType embeddableId = metaModel.embeddable(metadata.getIdAttribute().getBindableJavaType());
            Set<Attribute> embeddedAttributes = embeddableId.getAttributes();
            indexCompositeKey(embeddedAttributes, metadata, id, document, metaModel);
        }
    }
278368
public Object populateEmbeddedRecursive(ByteBuffer value, List<AbstractType<?>> types, List<FieldIdentifier> fieldNames,
            Object entity, MetamodelImpl metaModel)
    {
        ByteBuffer input = value.duplicate();
        EmbeddableType emb = metaModel.embeddable(entity.getClass());

        for (int i = 0; i < types.size(); i++)
        {

            if (!input.hasRemaining())
                return entity;

            AbstractType<?> type = types.get(i);
            String name = fieldNames.get(i).toString(); 		 // JPA name,
                                                                 // convert to
                                                                 // column name

            Field fieldToSet = null;
            AbstractAttribute attribute = null;
            // change this if possible
            for (Object attr : emb.getAttributes())
            {
                if (((AbstractAttribute) attr).getJPAColumnName().equals(name))
                {
                    attribute = (AbstractAttribute) attr;
                    break;
                }
            }
            fieldToSet = (Field) attribute.getJavaMember();
            Class embeddedClass = attribute.getBindableJavaType();

            int size = input.getInt();
            if (size < 0)
            {
                continue;
            }

            ByteBuffer field = ByteBufferUtil.readBytes(input, size);

            if (type.getClass().getSimpleName().equals("UserType"))
            {
                List<FieldIdentifier> subFieldNames = ((UserType) type).fieldNames();// ok
                List<AbstractType<?>> subfieldTypes = ((UserType) type).fieldTypes();

                // create entity with type_name and populate fields, set entity
                // in parent object after exit
                Object embeddedObjectChild = KunderaCoreUtils.createNewInstance(embeddedClass);

                Object processedEntity = populateEmbeddedRecursive(field, subfieldTypes, subFieldNames,
                        embeddedObjectChild, metaModel);
                PropertyAccessorHelper.set(entity, fieldToSet, processedEntity);
            }
            else
            {
                boolean flag = true;

                if (type.getClass().getSimpleName().equals("MapType"))
                {
                    if (((MapType) type).getValuesType().getClass().getSimpleName().equals("UserType"))
                    {
                        flag = false;
                        // create instance of embedded object (UserType)
                        setElementCollectionMap((MapType) type, field, entity, fieldToSet, metaModel, embeddedClass,
                                false);
                    }
                }
                else if (type.getClass().getSimpleName().equals("ListType"))
                {
                    if (((ListType) type).getElementsType().getClass().getSimpleName().equals("UserType"))
                    {
                        flag = false;
                        setElementCollectionList((ListType) type, field, entity, fieldToSet, metaModel, embeddedClass,
                                false);
                    }
                }
                else if (type.getClass().getSimpleName().equals("SetType"))
                {
                    if (((SetType) type).getElementsType().getClass().getSimpleName().equals("UserType"))
                    {
                        flag = false;
                        setElementCollectionSet((SetType) type, field, entity, fieldToSet, metaModel, embeddedClass,
                                false);
                    }
                }
                if (flag)
                {
                    TypeSerializer serializer = type.getSerializer();
                    serializer.validate(field);

                    Object finalValue = serializer.deserialize(field);
                    if (type.getClass().getSimpleName().equals("UTF8Type"))
                    {
                        PropertyAccessorHelper.set(entity, fieldToSet, ((String) finalValue).getBytes());
                    }
                    else
                    {
                        PropertyAccessorHelper.set(entity, fieldToSet, finalValue);
                    }
                }

            }

        }
        return entity;
    }
761150
public HBaseRow createHbaseRow(EntityMetadata m, Object entity, Object rowId, List<RelationHolder> relations)
            throws IOException
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                m.getPersistenceUnit());
        EntityType entityType = metaModel.entity(m.getEntityClazz());
        Set<Attribute> attributes = entityType.getAttributes();
        if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType()))
        {
            rowId = KunderaCoreUtils.prepareCompositeKey(m, rowId);
        }
        HBaseRow hbaseRow = new HBaseRow(rowId, new ArrayList<HBaseCell>());
        // handle attributes and embeddables
        createCellsAndAddToRow(entity, metaModel, attributes, hbaseRow, m, -1, "");
        // handle relations
        if (relations != null && !relations.isEmpty())
        {
            hbaseRow.addCells(getRelationCell(m, rowId, relations));
        }
        // handle inheritence
        String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn();
        String discrValue = ((AbstractManagedType) entityType).getDiscriminatorValue();
        if (discrColumn != null && discrValue != null)
        {
            hbaseRow.addCell(new HBaseCell(m.getTableName(), discrColumn, discrValue));
        }
        return hbaseRow;
    }
1313635
private List<Object> populate(Class<?> clazz, EntityMetadata metadata, Object rowId, List<String> relationNames,
        MetamodelImpl metaModel) {
        List<Object> result;
        if (isCql3Enabled(metadata)) {
            result = cqlClient.find(metaModel, metadata, rowId, relationNames);
        } else {
            result = (List<Object>) find(clazz, relationNames, relationNames != null, metadata, rowId);
        }
        return result;
    }
1345235
public void assignEmbeddables(Map<Class<?>, ManagedType<?>> embeddables)
    {
        if (this.embeddables == null)
        {
            this.embeddables = embeddables;
        }
        else
        {
            this.embeddables.putAll(embeddables);
        }
    }
1273528
private void createCellsAndAddToRow(Object entity, MetamodelImpl metaModel, Set<Attribute> attributes,
            HBaseRow hbaseRow, EntityMetadata m, int count, String prefix)
    {
        AbstractAttribute idCol = (AbstractAttribute) m.getIdAttribute();
        for (Attribute attribute : attributes)
        {
            AbstractAttribute absAttrib = (AbstractAttribute) attribute;
            Class clazz = absAttrib.getBindableJavaType();
            if (metaModel.isEmbeddable(clazz))
            {
                Set<Attribute> attribEmbeddables = metaModel.embeddable(absAttrib.getBindableJavaType())
                        .getAttributes();
                Object embeddedField = PropertyAccessorHelper.getObject(entity, (Field) attribute.getJavaMember());
                if (attribute.isCollection() && embeddedField != null)
                {
                    int newCount = count + 1;
                    String newPrefix = prefix != "" ? prefix + absAttrib.getJPAColumnName() + HBaseUtils.DELIM
                            : absAttrib.getJPAColumnName() + HBaseUtils.DELIM;
                    List listOfEmbeddables = (List) embeddedField;
                    addColumnForCollectionSize(hbaseRow, listOfEmbeddables.size(), newPrefix, m.getTableName());
                    for (Object obj : listOfEmbeddables)
                    {
                        createCellsAndAddToRow(obj, metaModel, attribEmbeddables, hbaseRow, m, newCount++, newPrefix);
                    }
                }
                else if (embeddedField != null)
                {
                    String newPrefix = prefix != "" ? prefix + absAttrib.getJPAColumnName() + HBaseUtils.DOT
                            : absAttrib.getJPAColumnName() + HBaseUtils.DOT;
                    createCellsAndAddToRow(embeddedField, metaModel, attribEmbeddables, hbaseRow, m, count, newPrefix);
                }
            }
            else if (!attribute.isCollection() && !attribute.isAssociation())
            {
                String columnFamily = absAttrib.getTableName() != null ? absAttrib.getTableName() : m.getTableName();
                String columnName = absAttrib.getJPAColumnName();
                columnName = count != -1 ? prefix + columnName + HBaseUtils.DELIM + count : prefix + columnName;
                Object value = PropertyAccessorHelper.getObject(entity, (Field) attribute.getJavaMember());
                HBaseCell hbaseCell = new HBaseCell(columnFamily, columnName, value);
                if (!idCol.getName().equals(attribute.getName()) && value != null)
                {
                    hbaseRow.addCell(hbaseCell);
                }
            }
        }
    }
177836
private Object populateEmbeddedObject(SuperColumn sc, EntityMetadata m) throws Exception
    {
        Field embeddedCollectionField = null;
        Object embeddedObject = null;
        String scName = PropertyAccessorFactory.STRING.fromBytes(String.class, sc.getName());
        String scNamePrefix = null;

        // Get a name->field map for super-columns
        Map<String, Field> columnNameToFieldMap = new HashMap<String, Field>();
        Map<String, Field> superColumnNameToFieldMap = new HashMap<String, Field>();
        MetadataUtils.populateColumnAndSuperColumnMaps(m, columnNameToFieldMap, superColumnNameToFieldMap,
                kunderaMetadata);

        // If this super column is variable in number (name#sequence format)
        if (scName.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) != -1)
        {
            StringTokenizer st = new StringTokenizer(scName, Constants.EMBEDDED_COLUMN_NAME_DELIMITER);
            if (st.hasMoreTokens())
            {
                scNamePrefix = st.nextToken();
            }

            embeddedCollectionField = superColumnNameToFieldMap.get(scNamePrefix);
            Class<?> embeddedClass = PropertyAccessorHelper.getGenericClass(embeddedCollectionField);

            // must have a default no-argument constructor
            try
            {
                embeddedClass.getConstructor();
            }
            catch (NoSuchMethodException nsme)
            {
                throw new PersistenceException(embeddedClass.getName()
                        + " is @Embeddable and must have a default no-argument constructor.");
            }
            embeddedObject = embeddedClass.newInstance();

            for (Column column : sc.getColumns())
            {
                String name = PropertyAccessorFactory.STRING.fromBytes(String.class, column.getName());
                byte[] value = column.getValue();
                if (value == null)
                {
                    continue;
                }
                Field columnField = columnNameToFieldMap.get(name);
                PropertyAccessorHelper.set(embeddedObject, columnField, value);
            }
        }
        else
        {
            Field superColumnField = superColumnNameToFieldMap.get(scName);
            Class superColumnClass = superColumnField.getType();
            embeddedObject = superColumnClass.newInstance();

            for (Column column : sc.getColumns())
            {
                String name = PropertyAccessorFactory.STRING.fromBytes(String.class, column.getName());
                byte[] value = column.getValue();

                if (value == null)
                {
                    continue;
                }
                // set value of the field in the bean
                Field columnField = columnNameToFieldMap.get(name);
                PropertyAccessorHelper.set(embeddedObject, columnField, value);
            }
        }
        return embeddedObject;
    }
49680
private void setField(Row row, Table schemaTable, Object embeddedObject, Attribute embeddedAttrib)
    {
        Field field = (Field) embeddedAttrib.getJavaMember();
        FieldDef fieldDef = schemaTable.getField(((AbstractAttribute) embeddedAttrib).getJPAColumnName());

        Object valueObj = PropertyAccessorHelper.getObject(embeddedObject, field);

        if (valueObj != null)
            NoSqlDBUtils.add(fieldDef, row, valueObj, ((AbstractAttribute) embeddedAttrib).getJPAColumnName());

    }
33733
private Collection<ThriftRow> onColumnOrSuperColumnThriftRow(EntityMetadata m, Object e, Object id, long timestamp,
            Object columnTTLs)
    {
        // Iterate through Super columns

        Map<String, ThriftRow> thriftRows = new HashMap<String, ThriftRow>();

        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                m.getPersistenceUnit());

        EntityType entityType = metaModel.entity(m.getEntityClazz());

        Set<Attribute> attributes = entityType.getAttributes();
        for (Attribute attribute : attributes)
        {
            String tableName = ((AbstractAttribute) attribute).getTableName() != null ? ((AbstractAttribute) attribute)
                    .getTableName() : m.getTableName();

            ThriftRow tr = getThriftRow(id, tableName, thriftRows);
            if (!attribute.getName().equals(m.getIdAttribute().getName()) && !attribute.isAssociation())
            {
                Field field = (Field) ((Attribute) attribute).getJavaMember();
                byte[] name = ByteBufferUtil.bytes(((AbstractAttribute) attribute).getJPAColumnName()).array();

                // if attribute is embeddable.
                if (metaModel.isEmbeddable(attribute.isCollection() ? ((PluralAttribute) attribute)
                        .getBindableJavaType() : attribute.getJavaType()))
                {
                    Map<String, Object> thriftSuperColumns = onEmbeddable(timestamp, tr, m, e, id, attribute);
                    if (thriftSuperColumns != null)
                    {
                        for (String columnFamilyName : thriftSuperColumns.keySet())
                        {
                            ThriftRow thriftRow = getThriftRow(id, columnFamilyName, thriftRows);
                            if (m.isCounterColumnType())
                            {
                                thriftRow.addCounterSuperColumn((CounterSuperColumn) thriftSuperColumns
                                        .get(columnFamilyName));
                            }
                            else
                            {
                                thriftRow.addSuperColumn((SuperColumn) thriftSuperColumns.get(columnFamilyName));
                            }
                        }
                    }
                }
                else
                {
                    Object value = getColumnValue(m, e, attribute);

                    if (m.getType().equals(Type.SUPER_COLUMN_FAMILY))
                    {
                        prepareSuperColumn(tr, m, value, name, timestamp);
                    }
                    else
                    {
                        int ttl = getTTLForColumn(columnTTLs, attribute);
                        prepareColumn(tr, m, value, name, timestamp, ttl);
                    }
                }
            }
        }

        // Add discriminator column.
        onDiscriminatorColumn(thriftRows.get(m.getTableName()), timestamp, entityType);
        return thriftRows.values();
    }
668868
public static void addToRow(PartialRow row, String jpaColumnName, Object value, Type type)
    {
        if (value == null)
        {
            row.setNull(jpaColumnName);
        }
        else
        {
            switch (type)
            {
            case BINARY:
                row.addBinary(jpaColumnName, (byte[]) value);
                break;
            case BOOL:
                row.addBoolean(jpaColumnName, (Boolean) value);
                break;
            case DOUBLE:
                row.addDouble(jpaColumnName, (Double) value);
                break;
            case FLOAT:
                row.addFloat(jpaColumnName, (Float) value);
                break;
            case INT16:
                row.addShort(jpaColumnName, (Short) value);
                break;
            case INT32:
                row.addInt(jpaColumnName, (Integer) value);
                break;
            case INT64:
                row.addLong(jpaColumnName, (Long) value);
                break;
            case INT8:
                row.addByte(jpaColumnName, (Byte) value);
                break;
            case STRING:
                row.addString(jpaColumnName, (String) value);
                break;
            case UNIXTIME_MICROS:
            default:
                logger.error(type + " type is not supported by Kudu");
                throw new KunderaException(type + " type is not supported by Kudu");
            }
        }
    }
258668
private List<Object> populateEmbeddedIdUsingLucene(EntityMetadata m, Client client, List<Object> result,
            Map<String, Object> searchFilter, MetamodelImpl metaModel)
    {
        List<Object> compositeIds = new ArrayList<Object>();

        for (String compositeIdName : searchFilter.keySet())
        {
            Object compositeId = null;
            Map<String, String> uniquePKs = (Map<String, String>) searchFilter.get(compositeIdName);
            compositeId = KunderaCoreUtils.initialize(m.getIdAttribute().getBindableJavaType(), compositeId);

            prepareCompositeIdObject(m.getIdAttribute(), compositeId, uniquePKs, metaModel);
            compositeIds.add(compositeId);
        }
        return findUsingLucene(m, client, compositeIds.toArray());
    }
721508
private void setRowIndexRowStatePreserved(int rowIndex) {
        if (rowIndex < -1) {
            throw new IllegalArgumentException("rowIndex is less than -1");
        }

        if (getRowIndex() == rowIndex) {
            return;
        }

        FacesContext facesContext = getFacesContext();

        if (_initialDescendantFullComponentState != null) {
            //Just save the row
            Map<String, Object> sm = saveFullDescendantComponentStates(facesContext, null, getChildren().iterator(), false);
            if (sm != null && !sm.isEmpty()) {
                _rowDeltaStates.put(getContainerClientId(facesContext), sm);
            }

            if (getRowIndex() != -1) {
                _rowTransientStates.put(getContainerClientId(facesContext),
                               saveTransientDescendantComponentStates(facesContext, null, getChildren().iterator(), false));
            }
        }

        // Update to the new row index
        //this.rowIndex = rowIndex;
        getStateHelper().put(PropertyKeys.rowIndex, rowIndex);
        DataModel localModel = getDataModel();
        localModel.setRowIndex(rowIndex);

        // if rowIndex is -1, clear the cache
        if (rowIndex == -1) {
            setDataModel(null);
        }

        // Clear or expose the current row data as a request scope attribute
        String var = getVar();
        if (var != null) {
            Map<String, Object> requestMap
                    = getFacesContext().getExternalContext().getRequestMap();
            if (rowIndex == -1) {
                oldVar = requestMap.remove(var);
            }
            else if (isRowAvailable()) {
                requestMap.put(var, getRowData());
            }
            else {
                requestMap.remove(var);
                if (null != oldVar) {
                    requestMap.put(var, oldVar);
                    oldVar = null;
                }
            }
        }

        if (_initialDescendantFullComponentState != null) {
            Object rowState = _rowDeltaStates.get(getContainerClientId(facesContext));
            if (rowState == null) {
                //Restore as original
                restoreFullDescendantComponentStates(facesContext, getChildren().iterator(), _initialDescendantFullComponentState, false);
            }
            else {
                //Restore first original and then delta
                restoreFullDescendantComponentDeltaStates(facesContext, getChildren().iterator(), rowState, _initialDescendantFullComponentState, false);
            }
            if (getRowIndex() == -1) {
                restoreTransientDescendantComponentStates(facesContext, getChildren().iterator(), null, false);
            }
            else {
                rowState = _rowTransientStates.get(getContainerClientId(facesContext));
                if (rowState == null) {
                    restoreTransientDescendantComponentStates(facesContext, getChildren().iterator(), null, false);
                }
                else {
                    restoreTransientDescendantComponentStates(facesContext, getChildren().iterator(), (Map<String, Object>) rowState, false);
                }
            }
        }
    }
235652
public static BasicDBObject getCompoundKeyColumns(EntityMetadata m, Object id, EmbeddableType compoundKey,
            MetamodelImpl metaModel)
    {
        BasicDBObject compoundKeyObj = new BasicDBObject();

        Set<Attribute> attribs = compoundKey.getDeclaredAttributes();

        Field[] fields = m.getIdAttribute().getBindableJavaType().getDeclaredFields();

        // To ensure order.
        for (Attribute attr : attribs)
        {
            Field f = (Field) attr.getJavaMember();
            if (!ReflectUtils.isTransientOrStatic(f))
            {
                if (f.getAnnotation(Embedded.class) != null)
                {
                    EmbeddableType emb = metaModel.embeddable(f.getType());
                    Object val = PropertyAccessorHelper.getObject(id, f);
                    BasicDBObject dbVal = getCompoundKeyColumns(m, val, emb, metaModel);
                    compoundKeyObj.put(((AbstractAttribute) attr).getJPAColumnName(), dbVal);
                }
                else
                {
                    compoundKeyObj.put(
                            ((AbstractAttribute) attr).getJPAColumnName(),
                            populateValue(PropertyAccessorHelper.getObject(id, (Field) attr.getJavaMember()),
                                    ((AbstractAttribute) attr).getBindableJavaType()));

                }
            }
        }
        return compoundKeyObj;
    }
1178052
private void processEmbeddable(Object entity, HBaseDataWrapper hbaseData, EntityMetadata m,
            MetamodelImpl metaModel, int count, String prefix, Attribute attribute, Class javaType)
    {
        Set<Attribute> attribEmbeddables = metaModel.embeddable(javaType).getAttributes();
        Object embeddedField = KunderaCoreUtils.createNewInstance(javaType);
        if (!attribute.isCollection())
        {
            String newPrefix = prefix != "" ? prefix + ((AbstractAttribute) attribute).getJPAColumnName()
                    + HBaseUtils.DOT : ((AbstractAttribute) attribute).getJPAColumnName() + HBaseUtils.DOT;
            writeValuesToEntity(embeddedField, hbaseData, m, metaModel, attribEmbeddables, null, null, count, newPrefix);
            PropertyAccessorHelper.set(entity, (Field) attribute.getJavaMember(), embeddedField);
        }
        else
        {
            int newCount = count + 1;
            String newPrefix = prefix != "" ? prefix + ((AbstractAttribute) attribute).getJPAColumnName()
                    + HBaseUtils.DELIM : ((AbstractAttribute) attribute).getJPAColumnName() + HBaseUtils.DELIM;
            List embeddedCollection = new ArrayList();
            byte[] columnValue = hbaseData.getColumnValue(HBaseUtils.getColumnDataKey(m.getTableName(), newPrefix
                    + HBaseUtils.SIZE));
            int size = 0;
            if (columnValue != null)
            {
                size = Bytes.toInt(columnValue);
            }
            while (size != newCount)
            {
                embeddedField = KunderaCoreUtils.createNewInstance(javaType);
                writeValuesToEntity(embeddedField, hbaseData, m, metaModel, attribEmbeddables, null, null, newCount++,
                        newPrefix);
                embeddedCollection.add(embeddedField);
            }
            PropertyAccessorHelper.set(entity, (Field) attribute.getJavaMember(), embeddedCollection);
        }
    }
437265
private void createTypeforEmbeddables(List compositeEmbeddables)
    {
        if (!createdPuEmbeddables.contains(puMetadata.getPersistenceUnitName()))
        {
            CQLTranslator translator = new CQLTranslator();

            Map<String, String> embNametoUDTQuery = new HashMap<String, String>();
            Map<String, List<String>> embNametoDependentList = new HashMap<String, List<String>>();

            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                    puMetadata.getPersistenceUnitName());

            Iterator iter = metaModel.getEmbeddables().iterator();
            while (iter.hasNext())
            {
                List<String> childEmb = new ArrayList<String>();

                String typeQuery = CQLTranslator.CREATE_TYPE;
                EmbeddableType embeddedColumn = (EmbeddableType) iter.next();
                if (!embeddedColumn.getPersistenceType().equals(PersistenceType.EMBEDDABLE)
                        || compositeEmbeddables.contains(embeddedColumn.getJavaType().getSimpleName()))
                {
                    continue;
                }

                typeQuery = StringUtils.replace(typeQuery, CQLTranslator.TYPE,
                        translator.ensureCase(new StringBuilder(), embeddedColumn.getJavaType().getSimpleName(), false)
                                .toString());

                StringBuilder typeQueryBuilder = new StringBuilder();

                for (Object column : embeddedColumn.getAttributes())
                {

                    Attribute columnAttribute = (Attribute) column;
                    Field f = (Field) columnAttribute.getJavaMember();

                    if (columnAttribute.getJavaType().isAnnotationPresent(Embeddable.class))
                    {
                        // handle embeddable
                        String cqlType = CQLTranslator.FROZEN + Constants.STR_LT + Constants.ESCAPE_QUOTE
                                + columnAttribute.getJavaType().getSimpleName() + Constants.ESCAPE_QUOTE
                                + Constants.STR_GT;
                        translator.appendColumnName(typeQueryBuilder, columnAttribute.getName(), cqlType);
                        typeQueryBuilder.append(Constants.SPACE_COMMA);
                        childEmb.add(columnAttribute.getJavaType().getSimpleName());
                    }
                    else if (columnAttribute.isCollection())
                    {
                        // handle element collection with embeddables
                        handleElementCollectionAttribute(translator, columnAttribute, typeQueryBuilder);
                        if (!MetadataUtils.isBasicElementCollectionField((Field) columnAttribute.getJavaMember()))
                        {
                            childEmb.add(((AbstractAttribute) columnAttribute).getBindableJavaType().getSimpleName());
                        }

                    }
                    else
                    {
                        String cqlType = null;
                        String dataType = CassandraValidationClassMapper.getValidationClass(f.getType(), true);
                        cqlType = translator.getCQLType(dataType);
                        // check for JPA names
                        translator.appendColumnName(typeQueryBuilder,
                                ((AbstractAttribute) columnAttribute).getJPAColumnName(), cqlType);
                        typeQueryBuilder.append(Constants.SPACE_COMMA);

                    }

                }
                typeQueryBuilder = replaceColumnsAndStripLastChar(typeQuery, typeQueryBuilder);
                typeQueryBuilder.append(CQLTranslator.CLOSE_BRACKET);
                embNametoUDTQuery.put(embeddedColumn.getJavaType().getSimpleName(), typeQueryBuilder.toString());
                embNametoDependentList.put(embeddedColumn.getJavaType().getSimpleName(), childEmb);
                // run query final

            }
            postProcessEmbedded(embNametoUDTQuery, embNametoDependentList);
            createdPuEmbeddables.add(puMetadata.getPersistenceUnitName());
        }
    }