Package com.alvazan.orm.api.base

Examples of com.alvazan.orm.api.base.NoSqlEntityManagerFactory


    Object factoryObj = properties.get(CronServiceFactory.NOSQL_MGR_FACTORY);
    if(factoryObj == null)
      throw new IllegalArgumentException("NOSQL_MGR_FACTORY is required and must be set");
    else if(!(factoryObj instanceof NoSqlEntityManagerFactory))
      throw new IllegalArgumentException("NOSQL_MGR_FACTORY is not an instance of NoSqlEntityManagerFactory");
    NoSqlEntityManagerFactory factory = (NoSqlEntityManagerFactory) factoryObj;
    impl.setFactory(factory);
    return impl;
  }
View Full Code Here


    else if (storeType == DbTypeEnum.MONGODB) {
      Bootstrap.createAndAddBestMongoDbConfiguration(properties ,"", bean.getKeyspace(), bean.getSeeds());
    }
    properties.put(Bootstrap.AUTO_CREATE_KEY, "create");

    NoSqlEntityManagerFactory factory = Bootstrap.create(storeType, properties);
    new PlayOrm(factory).start();
  }
View Full Code Here

  private static NoSqlEntityManager mgr;
 
  public static void main(String[] args) {
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(Bootstrap.AUTO_CREATE_KEY, "create");
    NoSqlEntityManagerFactory factory = Bootstrap.create(DbTypeEnum.IN_MEMORY, properties,null,null);
    mgr = factory.createEntityManager();
    createTestData();
    processSQL(args);
  }
View Full Code Here

    if(spiImpl != null && spiImpl instanceof NoSqlRawSession) {
      temp = (NoSqlRawSession) spiImpl;
    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
View Full Code Here

    logEveryN = logEveryNRows;
    //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++) {
View Full Code Here

              break;
    default:
      throw new UnsupportedOperationException("not supported yet, server type="+config.getServerType());
    }

    NoSqlEntityManagerFactory factory = Bootstrap.create(config.getServerType(), props, null, null);
    return factory;
  }
View Full Code Here

    if(spiImpl != null && spiImpl instanceof NoSqlRawSession) {
      temp = (NoSqlRawSession) spiImpl;
    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
View Full Code Here

    return row;
  }

  @Test
  public void testOrmLayerMetaSaved() {
    NoSqlEntityManagerFactory factory = FactorySingleton.createFactoryOnce();
    NoSqlEntityManager mgr = factory.createEntityManager();

    DboDatabaseMeta database = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
    DboTableMeta table = database.getMeta("Activity");
    DboColumnMeta columnMeta = table.getColumnMeta("account");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
View Full Code Here

  public void onApplicationStart() {
        List<Class> classes = Play.classloader.getAnnotatedClasses(NoSqlEntity.class);
        if (classes.isEmpty())
            return;
        else if (NoSql.getEntityManagerFactory() != null) {
          NoSqlEntityManagerFactory factory = NoSql.getEntityManagerFactory();
          factory.rescan(classes, Play.classloader);
          return;
        }
       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Bootstrap.LIST_OF_EXTRA_CLASSES_TO_SCAN_KEY, classes);
        props.put(Bootstrap.AUTO_CREATE_KEY, "create");
       
        for(java.util.Map.Entry<Object, Object> entry : Play.configuration.entrySet()) {
          props.put((String) entry.getKey(), entry.getValue());
        }
       
        if (log.isInfoEnabled())
      log.info("Initializing PlayORM...");

        NoSqlEntityManagerFactory factory = Bootstrap.create(props, Play.classloader);
        NoSql.setEntityManagerFactory(factory);
        CassandraAppender.setFactory(factory);
  }
View Full Code Here

    if(spiImpl != null && spiImpl instanceof NoSqlRawSession) {
      temp = (NoSqlRawSession) spiImpl;
    }
   
    Injector injector = Guice.createInjector(new ProductionBindings(type, temp));
    NoSqlEntityManagerFactory factory = injector.getInstance(NoSqlEntityManagerFactory.class);

    Named named = Names.named("logger");
    Key<NoSqlRawSession> key = Key.get(NoSqlRawSession.class, named);
    NoSqlRawSession inst = injector.getInstance(key);
    inst.start(properties);
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.base.NoSqlEntityManagerFactory

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.