Package com.alvazan.orm.api.base

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


      return NoSqlModel.edit(rootParamNode, name, o, annotations);
    }

  @Override
    public Object bindBean(RootParamNode rootParamNode, String name, Object bean) {
      NoSqlEntityManager mgr = NoSql.em();
      MetaLayer meta = mgr.getMeta();
      if(meta.isManagedEntity(bean.getClass())) {
            return NoSqlModel.edit(rootParamNode, name, bean, null);
        }
        return null;
    }
View Full Code Here


    @Override
    public void beforeInvocation() {
        if (!NoSql.isEnabled())
            return;

        NoSqlEntityManager manager = NoSql.getEntityManagerFactory().createEntityManager();
        NoSql.createContext(manager);
    }
View Full Code Here

          println(e.getMessage());
      }
    }
  }
  private void processCommand(String cmd) {
    NoSqlEntityManager mgr = factory.createEntityManager();
   
    if("help".equals(cmd)) {
      println("Getting around");
      println("help;            Display this help");
      println("help <command>   Display command-specific help.");
View Full Code Here

    if (log.isInfoEnabled())
      log.info("done calling shutdown");
  }

  private DboTableMeta setupMetaData(int numColumns, NoSqlEntityManagerFactory factory) {
    NoSqlEntityManager mgr = factory.createEntityManager();
   
    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, false);
   
    DboColumnIdMeta idMeta = new DboColumnIdMeta();
    idMeta.setup(table, "id", String.class, false);
   
    for(int i = 0; i < numColumns; i++) {
      DboColumnCommonMeta col = new DboColumnCommonMeta();
      col.setup(table, "col"+i, long.class, false, false);
     
      mgr.put(col);
    }
   
    meta.addMetaClassDbo(table);
   
    mgr.put(idMeta);
    mgr.put(table);
    mgr.put(meta);
    mgr.flush();
   
    return table;
  }
View Full Code Here

    @Override
    public void run() {
      long count = 0;
     
      NoSqlEntityManager mgr = mgrFactory.createEntityManager();
      NoSqlSession session = mgr.getSession();
     
      while(shouldRun) {
       
        //let's write  rows for every flush we do..
        for(int i = 0; i < 1; i++) {
View Full Code Here

          println(e.getMessage());
      }
    }
  }
  private void processCommand(String cmd) {
    NoSqlEntityManager mgr = factory.createEntityManager();
   
    if("help".equals(cmd)) {
      println("Getting around");
      println("help;            Display this help");
      println("help <command>   Display command-specific help.");
View Full Code Here

  private static final Logger log = LoggerFactory.getLogger(NoSqlPlugin.class);
 
    @SuppressWarnings({ "unchecked", "rawtypes" })
  @Override
    public Object bind(RootParamNode rootParamNode, String name, Class clazz, java.lang.reflect.Type type, Annotation[] annotations) {
        NoSqlEntityManager em = NoSql.em();
        MetaLayer metaLayer = em.getMeta();
        if(!metaLayer.isManagedEntity(clazz))
          return null;
       
        ParamNode paramNode = rootParamNode.getChild(name, true);

        String keyFieldName = metaLayer.getKeyFieldName(clazz);
        ParamNode id = paramNode.getChild(keyFieldName);

        String idStr = NoSqlModel.retrieveValue(id);
        if(idStr == null)
          return NoSqlModel.create(rootParamNode, name, clazz, annotations);

        Object theId = metaLayer.convertIdFromString(clazz, idStr);
       
        //Read the entity in so that this entity is used instead...
      Object o = em.find(clazz, theId);
      if(o == null)
        throw new RowNotFoundException("Row with rowkey="+theId+" was not found, but your page posted this id to lookup the row of class type="+clazz.getSimpleName());
      return NoSqlModel.edit(rootParamNode, name, o, annotations);
    }
View Full Code Here

      return NoSqlModel.edit(rootParamNode, name, o, annotations);
    }

  @Override
    public Object bindBean(RootParamNode rootParamNode, String name, Object bean) {
      NoSqlEntityManager mgr = NoSql.em();
      MetaLayer meta = mgr.getMeta();
      if(meta.isManagedEntity(bean.getClass())) {
            return NoSqlModel.edit(rootParamNode, name, bean, null);
        }
        return null;
    }
View Full Code Here

    @Override
    public void beforeInvocation() {
        if (!NoSql.isEnabled())
            return;

        NoSqlEntityManager manager = NoSql.getEntityManagerFactory().createEntityManager();
        NoSql.createContext(manager);
    }
View Full Code Here

          println(e.getMessage());
      }
    }
  }
  private void processCommand(String cmd) {
    NoSqlEntityManager mgr = factory.createEntityManager();
   
    if("help".equals(cmd)) {
      println("Getting around");
      println("help;            Display this help");
      println("help <command>   Display command-specific help.");
View Full Code Here

TOP

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

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.