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

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


  @SuppressWarnings({ "rawtypes", "unchecked" })
  @Override
  public Query<T> setParameter(String name, Object value) {
    //check parameter
   
    TypeInfo typeInfo = meta.getMetaFieldByParameter(name);
    if(typeInfo==null){
      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);
   
View Full Code Here


  @SuppressWarnings({ "rawtypes", "unchecked" })
  @Override
  public Query<T> setParameter(String name, Object value) {
    //check parameter
   
    TypeInfo typeInfo = meta.getMetaFieldByParameter(name);
    if(typeInfo==null){
      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);
   
View Full Code Here

    else {
      partitionColumn = partitionedColumns.get(0);
    }
   
    CommonTree partitionIdNode = (CommonTree) child.getChild(0);
    TypeInfo typeInfo = new TypeInfo(partitionColumn);
    ExpressionNode node = new ExpressionNode(partitionIdNode);
    processSide(node, wiring, typeInfo, facade);

    PartitionMeta p = new PartitionMeta(partitionColumn, node);
    info.setPartition(p);
View Full Code Here

    List<TypedColumn> deleteList = new ArrayList<TypedColumn>();
    List<CommonTree> childrenList = tree.getChildren();
    if (childrenList == null)
      return;
    else {
      TypeInfo columnTypeInfo = processSide(new ExpressionNode(childrenList.get(0)), wiring, null, facade);
      byte[] value = null;
      if (childrenList.size() > 1)
      {
        // 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

    List<TypedColumn> updateList = new ArrayList<TypedColumn>();
    List<CommonTree> childrenList = tree.getChildren();
    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

    ExpressionNode left  = new ExpressionNode(leftSide);
    ExpressionNode right = new ExpressionNode(rightSide);
    node.setChild(ChildSide.LEFT, left);
    node.setChild(ChildSide.RIGHT, right);
   
    TypeInfo typeInfo = processSide(left, wiring, null, facade);
    processSide(right, wiring, typeInfo, facade);
   
    Object state = left.getState();
    if(state instanceof StateAttribute) {
      StateAttribute st = (StateAttribute) state;
View Full Code Here

      CommonTree rightSide = (CommonTree) expression.getChild(1);
      ExpressionNode left  = new ExpressionNode(leftSide);
      ExpressionNode right = new ExpressionNode(rightSide);
      node.setChild(ChildSide.LEFT, left);
      node.setChild(ChildSide.RIGHT, right);
      TypeInfo typeInfo = processSide(left, wiring, null, facade);
      List<ParsedNode> keyList = new ArrayList<ParsedNode>();
      List<CommonTree> keys= rightSide.getChildren();
      for(CommonTree keyNode: keys) {
        ExpressionNode rightNode = new ExpressionNode(keyNode);
        processSide(rightNode, wiring, typeInfo, facade);
View Full Code Here

     
    else
      throw new RuntimeException("bug, not supported type(please fix)="+node.getType());
   
    if(typeInfo == null) //no types to check against so return...
      return new TypeInfo(ourType);

    //we must compare type info so this next stuff is pure validation
    if(typeInfo.getColumnInfo() != null) {
      validateTypes(wiring, ourType, typeInfo);
    } else {
View Full Code Here

    wiring.addEagerlyJoinedView(tableInfo);
    StateAttribute attr = new StateAttribute(tableInfo, colMeta, textInSql);
    attributeNode2.setState(attr, textInSql);
    wiring.incrementAttributesCount(textInSql);
   
    TypeInfo typeInfo = new TypeInfo(colMeta);
   
    if(otherSideType == null)
      return typeInfo;
   
    if(otherSideType.getConstantType() != null) {
View Full Code Here

  @SuppressWarnings({ "rawtypes", "unchecked" })
  @Override
  public void setParameter(String name, Object value) {
    //check parameter
   
    TypeInfo typeInfo = meta.getMetaFieldByParameter(name);
    if(typeInfo==null){
      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(columnName);
   
View Full Code Here

TOP

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

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.