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

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


    session.persistIndex(cf, indColFamily, rowKey, col);
  }
 
  @Override
  public void remove(String colFamily, TypedRow row) {
    DboTableMeta metaDbo = cachedMeta.getMeta(colFamily);
    if(metaDbo == null)
      throw new IllegalArgumentException("DboTableMeta for colFamily="+colFamily+" was not found");
   
    TypedRow proxy = row;
    Object rowKey = row.getRowKey();
    DboColumnIdMeta idMeta = metaDbo.getIdColumnMeta();
    byte[] byteKey = idMeta.convertToStorage2(rowKey);
    byte[] virtualKey = idMeta.formVirtRowKey(byteKey);
    if(!metaDbo.hasIndexedField()) {
      session.remove(metaDbo, virtualKey);
      return;
    } else if(!(row instanceof NoSqlTypedRowProxy)) {
      //then we don't have the database information for indexes so we need to read from the database
      proxy = find(metaDbo.getColumnFamily(), rowKey);
    }
   
    List<IndexData> indexToRemove = metaDbo.findIndexRemoves((NoSqlTypedRowProxy)proxy, byteKey);
   
    //REMOVE EVERYTHING HERE, we are probably removing extra and could optimize this later
    for(IndexData ind : indexToRemove) {
      session.removeFromIndex(metaDbo, ind.getColumnFamilyName(), ind.getRowKeyBytes(), ind.getIndexColumn());
    }
View Full Code Here


 
  @Override
  public Cursor<KeyValue<TypedRow>> createFindCursor(String colFamily, Iterable<Object> keys, int batchSize) {
    if(keys == null)
      throw new IllegalArgumentException("keys list cannot be null");
    DboTableMeta meta = cachedMeta.getMeta(colFamily);
    if(meta == null)
      throw new IllegalArgumentException("Meta for columnfamily="+colFamily+" was not found");
    DboColumnMeta idMeta = meta.getIdColumnMeta();
    Iterable<byte[]> noSqlKeys = new IterableTypedProxy<Object>(idMeta, keys);
    return findAllImpl2(meta, keys, noSqlKeys, null, batchSize);
  }
View Full Code Here

  //on a hit of getXXXXX (except for getId which doesn't need to go to database)
  public void loadCacheIfNeeded() {
    if(cacheLoaded)
      return;
   
    DboTableMeta metaDbo = metaClass.getMetaDbo();
    DboColumnIdMeta idMeta = metaDbo.getIdColumnMeta();
    Iterable<byte[]> virtKeys = new IterToVirtual(metaDbo, keys);
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, false, true, null);
    String name = getClass().getSimpleName();
    log.info(name+":just loaded rows for keylist(next convert to proxies)="+keys.size()+" for field="+field);
    int counter = 0;
View Full Code Here

  private void fillInThisOneInstance(T self) {
    MetaIdField<T> idField = classMeta.getIdField();
    Converter converter = idField.getConverter();
    byte[] nonVirtKey = converter.convertToNoSql(entityId);
    DboTableMeta metaDbo = classMeta.getMetaDbo();
    DboColumnIdMeta idMeta = metaDbo.getIdColumnMeta();
    byte[] virtKey = idMeta.formVirtRowKey(nonVirtKey);
   
    List<byte[]> rowKeys = new ArrayList<byte[]>();
    rowKeys.add(virtKey);
View Full Code Here

    }
    return byteVal;
  }

  public void setup(DboTableMeta tableMeta, Field field, String colName, MetaAbstractClass<PROXY> classMeta, Field fieldForKey) {
    DboTableMeta fkToTable = classMeta.getMetaDbo();
    metaDbo.setup(tableMeta, colName, fkToTable, false);
    super.setup(field, colName);
    this.classMeta = classMeta;
    this.fieldForKey = fieldForKey;
  }
View Full Code Here

    if(this.currentCacheLoaded)
      return;
   
    currentCacheLoaded = true;
   
    DboTableMeta metaDbo = proxyMeta.getMetaDbo();
    Iterable<byte[]> virtKeys = new IterToVirtual(metaDbo, keyList);
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, true, true, batchSize);
   
    int counter = 0;
    while(true) {
View Full Code Here

  @SuppressWarnings("unchecked")
  public void loadCacheIfNeeded() {
    if(cacheLoaded)
      return;

    DboTableMeta metaDbo = classMeta.getMetaDbo();
    DboColumnIdMeta idMeta = metaDbo.getIdColumnMeta();
    Iterable<byte[]> virtKeys = new IterToVirtual(metaDbo, keys);
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, false, true, null);
    String name = getClass().getSimpleName();
   
    log.info(name+":just loaded rows for keylist(next convert to proxies)="+keys.size()+" for field="+field);
View Full Code Here

    return data;
  }

  public void setup(DboTableMeta tableMeta, Field field, String colName,
      MetaAbstractClass<OWNER> ownerMeta, MetaAbstractClass<PROXY> classMeta) {
    DboTableMeta fkToTable = classMeta.getMetaDbo();
    metaDbo.setup(tableMeta, colName, fkToTable, true);
    super.setup(field, colName);
    this.classMeta = classMeta;
    this.ownerMeta = ownerMeta;
  }
View Full Code Here

  //on a hit of getXXXXX (except for getId which doesn't need to go to database)
  public void loadCacheIfNeeded() {
    if(cacheLoaded)
      return;
   
    DboTableMeta metaDbo = metaClass.getMetaDbo();
    DboColumnIdMeta idMeta = metaDbo.getIdColumnMeta();
    Iterable<byte[]> virtKeys = new IterToVirtual(metaDbo, keys);
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, false, null);
    int counter = 0;
    while(true) {
      com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<KeyValue<Row>> holder = rows.nextImpl();
View Full Code Here

    if(this.currentCacheLoaded)
      return;
   
    currentCacheLoaded = true;
   
    DboTableMeta metaDbo = proxyMeta.getMetaDbo();
    Iterable<byte[]> virtKeys = new IterToVirtual(metaDbo, keyList);
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, true, batchSize);
   
    int counter = 0;
    while(true) {
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.