Examples of DboColumnEmbedMeta


Examples of com.alvazan.orm.api.z8spi.meta.DboColumnEmbedMeta

      throw new UnsupportedOperationException("There is some problem in creating the proxy");
    }
    DboColumnMeta colMeta = this.getMetaDbo();
    if (classMeta.getIdField() != null && (rowKey!=null)) {
      // first fill the id
      DboColumnEmbedMeta embedMeta = (DboColumnEmbedMeta) colMeta;
            Object idValue = null;
            MetaField<PROXY> metaFieldId = classMeta.getIdField();
            NoSqlConverter customConvId = metaFieldId.getField().getAnnotation(NoSqlConverter.class);
            byte[] idBytes = null;
            if (customConvId != null) {
                idValue = getValue(rowKey, customConvId);
                idBytes = getBytesValue(idValue, customConvId);
            } else {
                idValue = embedMeta.getFkToColumnFamily().getIdColumnMeta().getStorageType().convertFromNoSql(rowKey);
                idBytes = StandardConverters.convertToBytes(idValue);
            }
            if (metaFieldId != null)
                ReflectionUtil.putFieldValue(newproxy, metaFieldId.getField(),idValue);

      // Now extract other columns
      byte[] prefix = StandardConverters.convertToBytes(getColumnName());
      byte[] embedColumn = new byte[prefix.length + idBytes.length];
        System.arraycopy(prefix,0,embedColumn,0         ,prefix.length);
        System.arraycopy(idBytes,0,embedColumn,prefix.length,idBytes.length);
      Collection<Column> columnsInRow = row.columnByPrefix(embedColumn);
      for (Column colInRow : columnsInRow) {
        byte[] fullNameCol = colInRow.getName();
        int colLen = fullNameCol.length - embedColumn.length;
        byte[] fk = new byte[colLen];
        for (int i = embedColumn.length; i < fullNameCol.length; i++) {
          fk[i - embedColumn.length] = fullNameCol[i];
        }

                Object colVal = colMeta.convertFromStorage2(fk);
                String colName = colMeta.convertTypeToString(colVal);

                Object columnValue = null;
                MetaField<PROXY> metaField = classMeta.getMetaFieldByCol(null, colName);
                if(metaField == null)
                  continue; //skip this field sice we don't know this column
                NoSqlConverter customConv = metaField.getField().getAnnotation(NoSqlConverter.class);
                if (customConv != null) {
                    columnValue = getValue(colInRow.getValue(), customConv);
                } else {
                    columnValue = embedMeta.getFkToColumnFamily().getColumnMeta(colName).getStorageType().convertFromNoSql(colInRow.getValue());
                }
                if (metaField != null)
          ReflectionUtil.putFieldValue(newproxy, metaField.getField(), columnValue);
      }
    } else {
View Full Code Here

Examples of com.alvazan.orm.api.z8spi.meta.DboColumnEmbedMeta

                embedColumn[i - colName.length] = fullName[i];
            }
            Object colVal = colMeta.convertFromStorage2(embedColumn);
            String columnName = colMeta.convertTypeToString(colVal);

            DboColumnEmbedMeta embedMeta = (DboColumnEmbedMeta) colMeta;
            if (embedMeta.getFkToColumnFamily().getColumnMeta(columnName) == null)
                continue;
            Object columnValue = null;
            MetaField<PROXY> metaField = classMeta.getMetaFieldByCol(null, columnName);
            NoSqlConverter customConv = metaField.getField().getAnnotation(NoSqlConverter.class);
            if (customConv != null) {
                columnValue = getValue(col.getValue(), customConv);
            } else {
                columnValue = embedMeta.getFkToColumnFamily().getColumnMeta(columnName).getStorageType().convertFromNoSql(col.getValue());
            }
            if (classMeta.getMetaFieldByCol(null, columnName) != null)
                ReflectionUtil.putFieldValue(newproxy, classMeta.getMetaFieldByCol(null, columnName).getField(), columnValue);
        }
    }
View Full Code Here

Examples of com.alvazan.orm.api.z8spi.meta.DboColumnEmbedMeta

      throw new UnsupportedOperationException("There is some problem in creating the proxy");
    }
    DboColumnMeta colMeta = this.getMetaDbo();
    if (classMeta.getIdField() != null && (rowKey!=null)) {
      // first fill the id
      DboColumnEmbedMeta embedMeta = (DboColumnEmbedMeta) colMeta;
            Object idValue = null;
            MetaField<PROXY> metaFieldId = classMeta.getIdField();
            NoSqlConverter customConvId = metaFieldId.getField().getAnnotation(NoSqlConverter.class);
            byte[] idBytes = null;
            if (customConvId != null) {
                idValue = getValue(rowKey, customConvId);
                idBytes = getBytesValue(idValue, customConvId);
            } else {
                idValue = embedMeta.getFkToColumnFamily().getIdColumnMeta().getStorageType().convertFromNoSql(rowKey);
                idBytes = StandardConverters.convertToBytes(idValue);
            }
            if (metaFieldId != null)
                ReflectionUtil.putFieldValue(newproxy, metaFieldId.getField(),idValue);

      // Now extract other columns
      byte[] prefix = StandardConverters.convertToBytes(getColumnName());
      byte[] embedColumn = new byte[prefix.length + idBytes.length];
        System.arraycopy(prefix,0,embedColumn,0         ,prefix.length);
        System.arraycopy(idBytes,0,embedColumn,prefix.length,idBytes.length);
      Collection<Column> columnsInRow = row.columnByPrefix(embedColumn);
      for (Column colInRow : columnsInRow) {
        byte[] fullNameCol = colInRow.getName();
        int colLen = fullNameCol.length - embedColumn.length;
        byte[] fk = new byte[colLen];
        for (int i = embedColumn.length; i < fullNameCol.length; i++) {
          fk[i - embedColumn.length] = fullNameCol[i];
        }

                Object colVal = colMeta.convertFromStorage2(fk);
                String colName = colMeta.convertTypeToString(colVal);

                Object columnValue = null;
                MetaField<PROXY> metaField = classMeta.getMetaFieldByCol(null, colName);
                if(metaField == null)
                  continue; //skip this field sice we don't know this column
                NoSqlConverter customConv = metaField.getField().getAnnotation(NoSqlConverter.class);
                if (customConv != null) {
                    columnValue = getValue(colInRow.getValue(), customConv);
                } else {
                    columnValue = embedMeta.getFkToColumnFamily().getColumnMeta(colName).getStorageType().convertFromNoSql(colInRow.getValue());
                }
                if (metaField != null)
          ReflectionUtil.putFieldValue(newproxy, metaField.getField(), columnValue);
      }
    } else {
View Full Code Here

Examples of com.alvazan.orm.api.z8spi.meta.DboColumnEmbedMeta

                embedColumn[i - colName.length] = fullName[i];
            }
            Object colVal = colMeta.convertFromStorage2(embedColumn);
            String columnName = colMeta.convertTypeToString(colVal);

            DboColumnEmbedMeta embedMeta = (DboColumnEmbedMeta) colMeta;
            if (embedMeta.getFkToColumnFamily().getColumnMeta(columnName) == null)
                continue;
            Object columnValue = null;
            MetaField<PROXY> metaField = classMeta.getMetaFieldByCol(null, columnName);
            NoSqlConverter customConv = metaField.getField().getAnnotation(NoSqlConverter.class);
            if (customConv != null) {
                columnValue = getValue(col.getValue(), customConv);
            } else {
                columnValue = embedMeta.getFkToColumnFamily().getColumnMeta(columnName).getStorageType().convertFromNoSql(col.getValue());
            }
            if (classMeta.getMetaFieldByCol(null, columnName) != null)
                ReflectionUtil.putFieldValue(newproxy, classMeta.getMetaFieldByCol(null, columnName).getField(), columnValue);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.