private void buildEntityFromCursor(Object entity, HashMap obj, EntityType entityType)
    {
        Iterator<Attribute> iter = entityType.getAttributes().iterator();
        while (iter.hasNext())
        {
            Attribute attribute = iter.next();
            Field field = (Field) attribute.getJavaMember();
            if (field.isAnnotationPresent(Id.class))
            {
                PropertyAccessorHelper.set(entity, field, obj.get(ID));
            }
            else
            {
                PropertyAccessorHelper.set(entity, field, obj.get(((AbstractAttribute) attribute).getJPAColumnName()));
            }

        }
    }
private void buildEntityFromCursor ( Object entity , HashMap obj , EntityType entityType ) { Iterator < Attribute > iter = entityType . getAttributes ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Attribute attribute = iter . next ( ) ; Field field = ( Field ) attribute . getJavaMember ( ) ; if ( field . isAnnotationPresent ( Id . class ) ) { PropertyAccessorHelper . set ( entity , field , obj . get ( ID ) ) ; } else { PropertyAccessorHelper . set ( entity , field , obj . get ( ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ) ) ; } } }
Builds the entity from cursor.

@param entity
the entity
@param obj
the obj
@param entityType
the entity type
@return the object