private List onRead(String tableName, Class clazz, EntityMetadata m, List output, HTableInterface hTable,
            Object entity, List<String> relationNames, List<HBaseData> results) throws IOException
    {
        try
        {
            // Populate raw data from HBase into entity

            if (results != null)
            {
                Map<Object, Object> entityListMap = new HashMap<Object, Object>();

                for (HBaseData data : results)
                {
                    entity = KunderaCoreUtils.createNewInstance(clazz);
                    /* Set Row Key */

                    MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                            m.getPersistenceUnit());
                    Object rowKeyValue = HBaseUtils.fromBytes(m, metaModel, data.getRowKey());
                    if (!metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType()))
                    {
                        PropertyAccessorHelper.setId(entity, m, rowKeyValue);
                    }

                    if (entityListMap.get(rowKeyValue) != null)
                    {

                        entity = entityListMap.get(rowKeyValue);

                    }
                    entity = populateEntityFromHbaseData(entity, data, m, null, relationNames);
                    if (output == null)
                    {
                        output = new ArrayList();
                    }
                    if (entity != null)
                    {
                        entityListMap.put(rowKeyValue, entity);

                    }
                }
                for (Object obj : entityListMap.values())
                {
                    output.add(obj);
                }
            }
        }
        catch (Exception e)
        {
            log.error("Error while creating an instance of {}, Caused by: .", clazz, e);
            throw new PersistenceException(e);
        }
        finally
        {
            if (hTable != null)
            {
                puthTable(hTable);
            }
        }

        return output;
    }
private List onRead ( String tableName , Class clazz , EntityMetadata m , List output , HTableInterface hTable , Object entity , List < String > relationNames , List < HBaseData > results ) throws IOException { try { if ( results != null ) { Map < Object , Object > entityListMap = new HashMap < Object , Object > ( ) ; for ( HBaseData data : results ) { entity = KunderaCoreUtils . createNewInstance ( clazz ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; Object rowKeyValue = HBaseUtils . fromBytes ( m , metaModel , data . getRowKey ( ) ) ; if ( ! metaModel . isEmbeddable ( m . getIdAttribute ( ) . getBindableJavaType ( ) ) ) { PropertyAccessorHelper . setId ( entity , m , rowKeyValue ) ; } if ( entityListMap . get ( rowKeyValue ) != null ) { entity = entityListMap . get ( rowKeyValue ) ; } entity = populateEntityFromHbaseData ( entity , data , m , null , relationNames ) ; if ( output == null ) { output = new ArrayList ( ) ; } if ( entity != null ) { entityListMap . put ( rowKeyValue , entity ) ; } } for ( Object obj : entityListMap . values ( ) ) { output . add ( obj ) ; } } } catch ( Exception e ) { log . error ( "Error while creating an instance of {}, Caused by: ." , clazz , e ) ; throw new PersistenceException ( e ) ; } finally { if ( hTable != null ) { puthTable ( hTable ) ; } } return output ; }
@param tableName
@param clazz
@param m
@param startRow
@param endRow
@param output
@param hTable
@param entity
@param relationNames
@param results
@return
@throws IOException