protected List populateEntitiesFromKeySlices ( EntityMetadata m , boolean isWrapReq , List < String > relations , List < KeySlice > keys , CassandraDataHandler dataHandler ) throws Exception { List results ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; Set < String > superColumnAttribs = metaModel . getEmbeddables ( m . getEntityClazz ( ) ) . keySet ( ) ; results = new ArrayList ( keys . size ( ) ) ; ThriftDataResultHelper dataGenerator = new ThriftDataResultHelper ( ) ; for ( KeySlice key : keys ) { List < ColumnOrSuperColumn > columns = key . getColumns ( ) ; byte [ ] rowKey = key . getKey ( ) ; Object id = PropertyAccessorHelper . getObject ( m . getIdAttribute ( ) . getJavaType ( ) , rowKey ) ; Object e = null ; Map < ByteBuffer , List < ColumnOrSuperColumn > > data = new HashMap < ByteBuffer , List < ColumnOrSuperColumn > > ( 1 ) ; data . put ( ByteBuffer . wrap ( rowKey ) , columns ) ; ThriftRow tr = new ThriftRow ( ) ; tr . setId ( id ) ; tr . setColumnFamilyName ( m . getTableName ( ) ) ; tr = dataGenerator . translateToThriftRow ( data , m . isCounterColumnType ( ) , m . getType ( ) , tr ) ; e = dataHandler . populateEntity ( tr , m , KunderaCoreUtils . getEntity ( e ) , relations , isWrapReq ) ; if ( e != null ) { results . add ( e ) ; } } return results ; }
Populate entities from key slices .