Package com.alvazan.orm.api.z8spi.meta

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


  }

  private boolean processColumn(NoSqlTypedSession s, ColFamilyData data,TypedRow typedRow,
      IndexPoint pt) {
    String colName = data.getColumn();
    TypedColumn column = typedRow.getColumn(colName);
    if (column == null) {
      //It means column was deleted by user. Doing nothing as of now
      return false;
    }
    else {
      Object value = column.getValue();
      DboColumnMeta colMeta = data.getColumnMeta();
      if (value == null && colMeta instanceof DboColumnToOneMeta) {
        DboColumnToOneMeta one = (DboColumnToOneMeta) colMeta;
        value = one.convertFromStorage2(column.getCompositeSubName());
      }
      if(!valuesEqual(pt.getIndexedValue(), value)) {
        System.out.println("Entity with rowkey="+pt.getKeyAsString()+" has extra incorrect index point with value="+pt.getIndexedValueAsString()+" correct value should be= "+value);
        s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionId());
        IndexColumn col = new IndexColumn();
View Full Code Here


    TypedRow result3 = s.find(cf, row3.getRowKey());
    TypedRow result4 = s.find(cf, row4.getRowKey());
    TypedRow result5 = s.find(cf, row5.getRowKey());
    TypedRow result6 = s.find(cf, row6.getRowKey());
   
    TypedColumn column1 = result1.getColumn("temp");
    Assert.assertNotNull(column1);
    Object val = column1.getValue();
    Assert.assertEquals(new BigDecimal(0), val);
   
    TypedColumn column2 = result2.getColumn("temp");
    Assert.assertNotNull(column2);   
    Object val2 = column2.getValue();
    Assert.assertNull(val2);
   
    TypedColumn column3 = result3.getColumn("temp");
    Assert.assertNull(column3);

    TypedColumn column4 = result4.getColumn(name);
    Assert.assertNotNull(column4);   
    byte[] valueRaw = column4.getValueRaw();
    Assert.assertNull(valueRaw);
   
    TypedColumn column5 = result5.getColumn("other");
    Assert.assertNotNull(column5);
    String value = (String) column5.getValue(String.class);
    Assert.assertEquals(null, value);
   
    TypedColumn column6 = result6.getColumn("other");
    Assert.assertNotNull(column6);
    int value6 = (Integer) column6.getValue(Integer.class);
    Assert.assertEquals(0, value6);
   
    TypedColumn column6b = result6.getColumn("nullInt");
    Integer val6b = column6b.getValue(Integer.class);
    Assert.assertNull(val6b);
  }
View Full Code Here

    s.put(cf, row1);
   
    s.flush();
   
    TypedRow result1 = s.find(cf, row1.getRowKey());
    TypedColumn col = result1.getColumn("temp");
    Assert.assertEquals(new BigDecimal(667), col.getValue());
   
    TypedColumn col2 = result1.getColumn("notInSchema");
    String value = col2.getValue(String.class);
    Assert.assertEquals("hithere", value);
   
    result1.removeColumn("temp");
    result1.removeColumn("notInSchema");
   
    s.put(cf, result1);
    s.flush();
   
    TypedRow result2 = s.find(cf, row1.getRowKey());
   
    TypedColumn col4 = result2.getColumn("notInSchema");
    Assert.assertNull(col4);
   
    TypedColumn col3 = result2.getColumn("temp");
    Assert.assertNull(col3);
  }
View Full Code Here

        // value is only relevant if it is *ToOne or *ToMany
        String withQuotes = childrenList.get(1).getText().trim();
        String withoutQuotes = withQuotes.substring(1, withQuotes.length()-1);
        value = StandardConverters.convertToBytes(withoutQuotes);
      }
      TypedColumn columnforDelete = new TypedColumn(columnTypeInfo.getColumnInfo(), columnTypeInfo.getColumnInfo().getColumnNameAsBytes(), value, null);
      deleteList.add(columnforDelete);
    }
    wiring.setUpdateList(deleteList);
  }
View Full Code Here

    for (CommonTree child : childrenList) {
      ExpressionNode node = new ExpressionNode(child);
      compileExpression(node, wiring, facade);
      TypeInfo columnTypeInfo = processSide(node.getChild(ChildSide.LEFT), wiring, null, facade);
      byte[] value = retrieveValue(columnTypeInfo.getColumnInfo(), node.getChild(ChildSide.RIGHT));
      TypedColumn columnforUpdate = new TypedColumn(columnTypeInfo.getColumnInfo(), columnTypeInfo.getColumnInfo().getColumnNameAsBytes(), value, null);
      updateList.add(columnforUpdate);
    }
    wiring.setUpdateList(updateList);
  }
View Full Code Here

  }

  private boolean processColumn(NoSqlTypedSession s, ColFamilyData data, TypedRow typedRow,
      IndexPoint pt) {
    String colName = data.getColumn();
    TypedColumn column = typedRow.getColumn(colName);
    if (column == null) {
      //It means column was deleted by user. Doing nothing as of now
      return false;
    }
    else {
      Object value = column.getValue();
      DboColumnMeta colMeta = data.getColumnMeta();
      if (value == null && colMeta instanceof DboColumnToOneMeta) {
        DboColumnToOneMeta one = (DboColumnToOneMeta) colMeta;
        value = one.convertFromStorage2(column.getCompositeSubName());
      }
      if(!valuesEqual(pt.getIndexedValue(), value)) {
        System.out.println("Entity with rowkey="+pt.getKeyAsString()+" has extra incorrect index point with value="+pt.getIndexedValueAsString()+" correct value should be= "+value);
        s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionId());
        IndexColumn col = new IndexColumn();
View Full Code Here

    for (CommonTree child : childrenList) {
      ExpressionNode node = new ExpressionNode(child);
      compileExpression(node, wiring, facade);
      TypeInfo columnTypeInfo = processSide(node.getChild(ChildSide.LEFT), wiring, null, facade);
      byte[] value = retrieveValue(columnTypeInfo.getColumnInfo(), node.getChild(ChildSide.RIGHT));
      TypedColumn columnforUpdate = new TypedColumn(columnTypeInfo.getColumnInfo(), columnTypeInfo.getColumnInfo().getColumnNameAsBytes(), value, null);
      updateList.add(columnforUpdate);
    }
    wiring.setUpdateList(updateList);
  }
View Full Code Here

        s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionBy());
        changedCounter++;
      } else {
        TypedRow val = row.getValue();
       
        TypedColumn column = val.getColumn(colName);
        if (column == null) {
          //It means column was deleted by user. Doing nothing as of now
          changedCounter++;
          continue;
        }

        Object value = column.getValue();

        if(!valuesEqual(pt.getIndexedValue(), value)) {
          System.out.println("Entity with rowkey="+pt.getKeyAsString()+" has extra incorrect index point with value="+pt.getIndexedValueAsString()+" correct value should be="+column.getValueAsString());
          s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionId());
         
          IndexColumn col = new IndexColumn();
          col.setColumnName(colName);
          col.setPrimaryKey(pt.getRawKey());
          byte[] indValue = column.getValueRaw();
          col.setIndexedValue(indValue);
          IndexPoint newPoint = new IndexPoint(pt.getRowKeyMeta(), col , data.getColumnMeta());
          s.addIndexPoint(newPoint, data.getPartitionBy(), data.getPartitionId());
          changedCounter++;
        }
View Full Code Here

        // value is only relevant if it is *ToOne or *ToMany
        String withQuotes = childrenList.get(1).getText().trim();
        String withoutQuotes = withQuotes.substring(1, withQuotes.length()-1);
        value = StandardConverters.convertToBytes(withoutQuotes);
      }
      TypedColumn columnforDelete = new TypedColumn(columnTypeInfo.getColumnInfo(), columnTypeInfo.getColumnInfo().getColumnNameAsBytes(), value, null);
      deleteList.add(columnforDelete);
    }
    wiring.setUpdateList(deleteList);
  }
View Full Code Here

    for (CommonTree child : childrenList) {
      ExpressionNode node = new ExpressionNode(child);
      compileExpression(node, wiring, facade);
      TypeInfo columnTypeInfo = processSide(node.getChild(ChildSide.LEFT), wiring, null, facade);
      byte[] value = retrieveValue(columnTypeInfo.getColumnInfo(), node.getChild(ChildSide.RIGHT));
      TypedColumn columnforUpdate = new TypedColumn(columnTypeInfo.getColumnInfo(), columnTypeInfo.getColumnInfo().getColumnNameAsBytes(), value, null);
      updateList.add(columnforUpdate);
    }
    wiring.setUpdateList(updateList);
  }
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.meta.TypedColumn

Copyright © 2018 www.massapicom. 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.