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 ) ; } } } }
Creates the cells and add to row .