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

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


    return new ExpressionNode(nodeType);
  }
 
  @Override
  public DboTableMeta getColumnFamily(String tableName) {
    DboTableMeta metaClass = metaInfo.getMeta(tableName);
    if(metaClass == null && mgr != null)
      metaClass = mgr.find(DboTableMeta.class, tableName);
    return metaClass;
  }
View Full Code Here


 
  //optional but logging won't work without it
  private DboColumnMeta columnName;

  public static ScanInfo createScanInfo(DboColumnMeta colMeta, String partitionBy, String partitionId) {
    DboTableMeta realColFamily = colMeta.getOwner();
    String columnFamily = colMeta.getIndexTableName();
    String indexRowKey = colMeta.getIndexRowKey(partitionBy, partitionId);
    byte[] rowKey = StandardConverters.convertToBytes(indexRowKey);
    ScanInfo scanInfo = new ScanInfo(realColFamily, colMeta, columnFamily, rowKey);
    return scanInfo;
View Full Code Here

    if(classMeta instanceof MetaClassInheritance) {
      MetaClassInheritance classMeta2 = (MetaClassInheritance) classMeta;
      scanMultipleClasses(annotation, classMeta2);
    } else {
      MetaClassSingle classMeta2 = (MetaClassSingle)classMeta;
      DboTableMeta metaDbo = classMeta2.getMetaDbo();
      scanForAnnotations(classMeta2);
      scanSingle(classMeta2, metaDbo);
    }
   
    if(classMeta.getIdField() == null)
View Full Code Here

    if(log.isDebugEnabled())
      log.debug("Scanning class heirarchy for class="+mainClass);
   
    scanForAnnotations(metaClass);

    DboTableMeta metaDbo = metaClass.getMetaDbo();
    List<Field> fields = findAllFields(mainClass);
    for(Field field : fields) {
      processIdFieldWorks(metaClass, metaDbo, field);
    }
   
    String virtualCf = metaDbo.getRealVirtual();
    String cf = metaDbo.getRealColumnFamily();
   
    String discColumn = annotation.discriminatorColumnName();
    metaClass.setDiscriminatorColumnName(discColumn);
   
    for(Class clazz : annotation.subclassesToScan()) {
View Full Code Here

          log.info("NEVER MIND, someone beat us to loading it into memory, it is now there="+virtCf+"(realcf="+cfName+")");
          return cfNameToCassandra.get(cfName);
        }
      }

      DboTableMeta table = loadFromInMemoryOrDb(virtCf, lookup);
     
      String realCf = table.getRealColumnFamily();

      String realCfLower = realCf.toLowerCase();
      Info info = cfNameToCassandra.get(realCfLower);
      if(info != null) {
        log.info("Virt CF="+virtCf+" already exists and real colfamily="+realCf+" already exists so return it");
View Full Code Here

    }
  }

  private DboTableMeta loadFromInMemoryOrDb(String virtCf, MetaLookup lookup) {
    log.info("looking up meta="+virtCf+" so we can add table to memory(one time operation)");
    DboTableMeta meta = dbMetaFromOrmOnly.getMeta(virtCf);
    if(meta != null) {
      log.info("found meta="+virtCf+" locally");
      return meta;
    }
   
    DboTableMeta table = lookup.find(DboTableMeta.class, virtCf);
    if(table == null)
      throw new IllegalArgumentException("We can't load the meta for virtual or real CF="+virtCf+" because there is not meta found in DboTableMeta table");
    log.info("found meta="+virtCf+" in database");
    return table;
  }
View Full Code Here

      return;

    String keysp = keyspace.getKeyspaceName();
    log.info("CREATING column family="+virtualCf+" in cassandra keyspace="+keysp);
   
    DboTableMeta meta = loadFromInMemoryOrDb(virtualCf, ormSession);
    log.info("CREATING REAL cf="+meta.getRealColumnFamily()+" (virtual CF="+meta.getRealVirtual()+")");

    createColFamilyInCassandra(meta);
  }
View Full Code Here

    return session;
  }

  @Override
  public void put(String colFamily, TypedRow typedRow) {
    DboTableMeta metaClass = cachedMeta.getMeta(colFamily);
    if(metaClass == null)
      throw new IllegalArgumentException("DboTableMeta for colFamily="+colFamily+" was not found");

    RowToPersist row = metaClass.translateToRow(typedRow);
   
    //This is if we need to be removing columns from the row that represents the entity in a oneToMany or ManyToMany
    //as the entity.accounts may have removed one of the accounts!!!
    if(row.hasRemoves())
      session.remove(metaClass, row.getKey(), row.getColumnNamesToRemove());
View Full Code Here

  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();
   
    IndexColumn col = new IndexColumn();
    col.setIndexedValue(pt.getRawIndexedValue());
    col.setPrimaryKey(pt.getRawKey());
    session.removeFromIndex(cf, indColFamily, rowKey, col);
View Full Code Here

  public void addIndexPoint(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();
   
    IndexColumn col = new IndexColumn();
    col.setIndexedValue(pt.getRawIndexedValue());
    col.setPrimaryKey(pt.getRawKey());
    session.persistIndex(cf, indColFamily, rowKey, col);
View Full Code Here

TOP

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

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.