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

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


  //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();
    IndiceToVirtual virtKeys = new IndiceToVirtual(metaDbo, new ListWrappingCursor<byte[]>(keys));
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, false, true, null);
    String name = getClass().getSimpleName();
    if (log.isInfoEnabled())
      log.info(name+":just loaded rows for keylist(next convert to proxies)="+keys.size()+" for field="+field);
    int counter = 0;
    while(true) {
      com.alvazan.orm.api.z8spi.iter.AbstractCursor.Holder<KeyValue<Row>> holder = rows.nextImpl();
      if(holder == null)
        break;
      KeyValue<Row> kv = holder.getValue();
      Row row = kv.getValue();
      if(row != null || metaDbo.isEmbeddable()) {
        Holder<T> h = (Holder) originalHolders.get(counter);
        T value = h.getValue();
        if(value instanceof NoSqlProxy) {
          //inject the row into the proxy object here to load it's fields
          metaClass.fillInInstance(row, session, value);
View Full Code Here


    if(this.currentCacheLoaded)
      return;
   
    currentCacheLoaded = true;
   
    DboTableMeta metaDbo = proxyMeta.getMetaDbo();
    IndiceToVirtual virtKeys = new IndiceToVirtual(metaDbo, new ListWrappingCursor<byte[]>(keyList));
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, true, false, 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();
    IndiceToVirtual virtKeys = new IndiceToVirtual(metaDbo, new ListWrappingCursor<byte[]>(keys));
    AbstractCursor<KeyValue<Row>> rows = session.find(metaDbo, virtKeys, false, true, null);
    String name = getClass().getSimpleName();
   
    if (log.isInfoEnabled())
View Full Code Here

  @Inject
  private DboDatabaseMeta databaseInfo;
 
  public void addClassForQueries(Class<?> clazz) {
    MetaClassSingle classMeta = (MetaClassSingle)metaInfo.findOrCreate(clazz);
    DboTableMeta metaDbo = classMeta.getMetaDbo();
    scanForAnnotations(classMeta);
    scanSingle(classMeta, metaDbo);
    metaInfo.addTableNameLookup(classMeta);
    databaseInfo.addMetaClassDbo(classMeta.getMetaDbo());
  }
View Full Code Here

    //of MetaClass that will be filled in here when Account gets scanned(if it gets scanned
    //after Activity that is).  You can open call heirarchy on findOrCreateMetaClass ;).
    MetaAbstractClass classMeta = metaInfo.findOrCreate(clazz);
   
    NoSqlInheritance annotation = clazz.getAnnotation(NoSqlInheritance.class);
    DboTableMeta metaDbo = classMeta.getMetaDbo();

    if(classMeta instanceof MetaClassInheritance) {
      MetaClassInheritance classMeta2 = (MetaClassInheritance) classMeta;
      scanMultipleClasses(annotation, classMeta2);
    } else {
      MetaClassSingle classMeta2 = (MetaClassSingle)classMeta;
      scanForAnnotations(classMeta2);
      scanSingle(classMeta2, metaDbo);
    }
   
    if(classMeta.getIdField() == null && !metaDbo.isEmbeddable() && clazz.getSuperclass() != java.lang.Object.class)
      throw new IllegalArgumentException("Entity="+classMeta.getMetaClass()+" has no field annotated with @NoSqlId and that is required");
   
    metaInfo.addTableNameLookup(classMeta);
    databaseInfo.addMetaClassDbo(classMeta.getMetaDbo());
  }
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

    //BEFORE Timer, let's get setup first
    Map<String, Object> props = new HashMap<String, Object>();
    props.put(Bootstrap.AUTO_CREATE_KEY, "create");
    Bootstrap.createAndAddBestCassandraConfiguration(props, clusterName, "PlayOrmPerfTest", host);
    NoSqlEntityManagerFactory factory = Bootstrap.create(DbTypeEnum.CASSANDRA, props, null, null);
    DboTableMeta table = setupMetaData(numColumns, factory);
   
    timer.schedule(new StopTask(), timeInMinutes*1000);
   
    for(int i = 0; i < NUM_THREADS; i++) {
      Runnable r = new SlamDataIn(factory, table, i);
View Full Code Here

    DboDatabaseMeta meta = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
    if(meta != null) {
      meta = new DboDatabaseMeta();
    }

    DboTableMeta table = new DboTableMeta();
    table.setup(null, "testWrites", false);
   
    DboColumnIdMeta idMeta = new DboColumnIdMeta();
    idMeta.setup(table, "id", String.class, false);
   
    for(int i = 0; i < numColumns; i++) {
View Full Code Here

    QueryResult rResult = s2.createQueryCursor("select * from Owner", 50);
    Assert.assertFalse(rResult.getCursor().next());
  }

  private void setupModel() {
    DboTableMeta fkToTable = new DboTableMeta();
    fkToTable.setup("Owner", "ourstuff", false, false);
    DboColumnIdMeta id = new DboColumnIdMeta();
    id.setup(fkToTable, "id", String.class, true);
    DboColumnCommonMeta col1 = new DboColumnCommonMeta();
    col1.setup(fkToTable, "name", String.class, false, false);
   
    mgr.put(fkToTable);
    mgr.put(id);
    mgr.put(col1);
   
    DboTableMeta meta = new DboTableMeta();
    meta.setup("MyRaceCar", "ourstuff", false, false);
    DboColumnIdMeta idMeta = new DboColumnIdMeta();
    idMeta.setup(meta, "id", String.class, true);
    DboColumnToOneMeta toOne = new DboColumnToOneMeta();
    toOne.setup(meta, "carOwner", fkToTable, false, false);
   
View Full Code Here

      session.flush();
    }
  }

  private DboTableMeta addMetaClassDboTest(DboDatabaseMeta metaDb, String name,String idFieldName, String ... columnField) {
    DboTableMeta meta=null;
    for(int j=1;j<20;j++){
    meta= new DboTableMeta();
    meta.setup(null, name, false, false);
    metaDb.addMetaClassDbo(meta);
       
    DboColumnIdMeta idMeta = new DboColumnIdMeta();
    idMeta.setup(meta,name+idFieldName, String.class, true);
    mgr.put(idMeta);
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.