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

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


      throw new IllegalArgumentException("parameter='" + name
          + "' is not found in the query="+meta.getQuery());
    } else if(typeInfo.getConstantType() != null)
      throw new UnsupportedOperationException("not done here yet, need to validate constant type");

    DboColumnMeta metaFieldDbo = typeInfo.getColumnInfo();
    String colFamily = metaFieldDbo.getOwner().getColumnFamily();
    String columnName = metaFieldDbo.getColumnName();
    MetaClass metaClass = metaInfo.getMetaClass(colFamily);
    MetaField metaField = metaClass.getMetaFieldByCol(targetSubclass, columnName);
   
    Field field = metaField.getField();
    Class fieldType = field.getType();
View Full Code Here


    ExpressionNode root = spiMeta.getASTTree();
    if(root == null) {
      ViewInfoImpl tableInfo = (ViewInfoImpl) spiMeta.getTargetViews().get(0);
      DboTableMeta tableMeta = tableInfo.getTableMeta();
      PartitionMeta partitionMeta = tableInfo.getPartition();
      DboColumnMeta partColMeta = null;
      if (partitionMeta != null)
        partColMeta = partitionMeta.getPartitionColumn();
      DboColumnMeta metaCol = tableMeta.getAnyIndex(indexedColumn, partColMeta);

      ScanInfo scanInfo = createScanInfo(tableInfo, metaCol);

      alreadyJoinedViews.add(tableInfo);
      AbstractCursor<IndexColumn> scan = session.scanIndex(scanInfo, null, null, batchSize);
View Full Code Here

  private ScanInfo createScanInfo(ViewInfoImpl tableInfo, DboColumnMeta metaCol) {
    PartitionMeta partitionMeta = tableInfo.getPartition();
    String partitionBy = null;
    String partitionId = null;
    if(partitionMeta != null) {
      DboColumnMeta colMeta = partitionMeta.getPartitionColumn();
      partitionBy = colMeta.getColumnName();
      byte[] partId = retrieveValue(colMeta, (ExpressionNode) partitionMeta.getNode());
      Object partIdObj = colMeta.convertFromStorage2(partId);
      partitionId = colMeta.convertTypeToString(partIdObj);
    }

    ScanInfo scanInfo = ScanInfo.createScanInfo(metaCol, partitionBy, partitionId);
    return scanInfo;
  }
View Full Code Here

    if(joinType == JoinType.INNER || joinType == JoinType.LEFT_OUTER) {
      //We need to proxy the right results to translate to the same primary key as the
      //left results and our And and Or Cursor can then take care of the rest
      JoinInfo joinInfo = root.getJoinMeta().getPrimaryJoinInfo();
      ViewInfoImpl newView = joinInfo.getPrimaryTable();
      DboColumnMeta col = joinInfo.getPrimaryCol();
      ScanInfo scanInfo = createScanInfo(newView, col);
      //FROM an ORM perspective, we join to smaller tables in general as we don't want to blow out memory so do the
      //join first(ie. we process left sides first in and and or cursors)
      CursorForJoin temp = new CursorForJoin(newView, leftView, leftResults, joinType);
      temp.setColMeta(col);
View Full Code Here

      attr = (StateAttribute) grandChild.getState();
    } else {
      attr = (StateAttribute) root.getChild(ChildSide.LEFT).getState();
    }
   
    DboColumnMeta info = attr.getColumnInfo();
    ViewInfoImpl viewInfo = attr.getViewInfo();   
    ScanInfo scanInfo = createScanInfo(viewInfo, info);
    alreadyJoinedViews.add(viewInfo);
   
    if(info.isIndexed()) {
      //its an indexed column
      return processIndexColumn(root, scanInfo, viewInfo, info);
    } else if (info.getOwner().getIdColumnMeta().getColumnName().equals(info.getColumnName())) {
      //its a non-indexed primary key
      return  processPrimaryKey(root, scanInfo, viewInfo, info);
    } else
      throw new IllegalArgumentException("You cannot have '"+info.getColumnName() + "' in your sql query since "+info.getColumnName()+" is neither a Primary Key nor a column with @Index annotation on the field in the entity");     
  }
View Full Code Here

    String id = data.getPartitionId();
    Cursor<IndexPoint> indexView = s.indexView(cf, field, by, id);
    Cursor<IndexPoint> indexView2 = s.indexView(cf, field, by, id);
   
    DboTableMeta meta = data.getTableMeta();
    DboColumnMeta colMeta = data.getColumnMeta();
    System.out.println("indexed value type="+colMeta.getStorageType());
    System.out.println("row key type="+meta.getIdColumnMeta().getStorageType());
    System.out.println("It is safe to kill this process at any time since it only removes duplicates");
    System.out.println("Beginning re-index");

    int totalChanges = 0;
View Full Code Here

      //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)) {
View Full Code Here

    String id = data.getPartitionId();

    Cursor<IndexPoint> indexView = s.indexView(cf, field, by, id);

    DboTableMeta meta = data.getTableMeta();
    DboColumnMeta colMeta = data.getColumnMeta();
    System.out.println("indexed value type="+colMeta.getStorageType());
    System.out.println("row key type="+meta.getIdColumnMeta().getStorageType());
    System.out.println("<indexed value>.<row key>");

    int count = 0;
    while(indexView.next()) {
View Full Code Here

      }
      System.out.println("");
      throw new InvalidCommand("Column family meta not found for " + cf);
    }
   
    DboColumnMeta colMeta = meta.getColumnMeta(field);
    if(colMeta == null) {
      colMeta = meta.getIdColumnMeta();
      if(!(colMeta != null && colMeta.getColumnName().equals(field))) {
        System.out.println("Column= "+field+" not found on table "+cf);
        System.out.println("You can view index for following columns:");
        for(DboColumnMeta colMetaOther : meta.getIndexedColumns()) {
          System.out.println(colMetaOther.getColumnName());
        }
View Full Code Here

    session.put(metaClass, virtualKey, cols);
  }
 
  @Override
  public void removeIndexPoint(IndexPoint pt, String partitionBy, String partitionId) {
    DboColumnMeta colMeta = pt.getColumnMeta();
    ScanInfo info = ScanInfo.createScanInfo(colMeta, partitionBy, partitionId);
    byte[] rowKey = info.getRowKey();
    String indColFamily = info.getIndexColFamily();
    DboTableMeta cf = info.getEntityColFamily();
   
View Full Code Here

TOP

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

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.