Package org.openbravo.dal.core

Examples of org.openbravo.dal.core.OBContext


    final OBCriteria<Category> obCriteria = OBDal.getInstance().createCriteria(Category.class);
    obCriteria.add(Expression.eq(Category.PROPERTY_NAME, "testname"));
    final List<Category> bpgs = obCriteria.list();
    assertEquals(1, bpgs.size());
    final Category bpg = bpgs.get(0);
    final OBContext obContext = OBContext.getOBContext();
    assertEquals(obContext.getUser().getId(), bpg.getCreatedBy().getId());
    assertEquals(obContext.getUser().getId(), bpg.getUpdatedBy().getId());
    // update and create have occured less than one second ago
    // note that if the delete fails for other reasons that you will have a
    // Category in the database which has for sure a created/updated time
    // longer in the past, You need to manually delete the currency record
    if (false) {
View Full Code Here


        OBContext.setOBContext(u.getId());
      } catch (OBSecurityException e) {
        // handle some non-configured unimportant users
        continue;
      }
      final OBContext obContext = OBContext.getOBContext();
      EntityAccessChecker eac = obContext.getEntityAccessChecker();
      System.err.println("++++++++++++ user " + u.getId() + " ++++++++++++++");
      eac.dump();
    }
  }
View Full Code Here

    final OBCriteria<Category> obc = OBDal.getInstance().createCriteria(Category.class);
    obc.add(Expression.eq(Category.PROPERTY_NAME, "hello world"));
    final List<Category> bpgs = obc.list();
    assertEquals(1, bpgs.size());
    final Category bog = bpgs.get(0);
    final OBContext obContext = OBContext.getOBContext();
    assertEquals(obContext.getUser().getId(), bog.getCreatedBy().getId());
    assertEquals(obContext.getUser().getId(), bog.getUpdatedBy().getId());
    // update and create have occured less than one second ago
    // note that if the delete fails for other reasons that you will have a
    // currency in the database which has for sure a created/updated time
    // longer in the past, You need to manually delete the currency record
    // NOTE: disabled for now as it is to sensitive if there is time between a
View Full Code Here

    final OBQuery<Category> obQuery = OBDal.getInstance().createQuery(Category.class,
        Category.PROPERTY_NAME + "='testname' or " + Category.PROPERTY_SEARCHKEY + "='testvalue'");
    final List<Category> bpgs = obQuery.list();
    assertEquals(1, bpgs.size());
    final Category bpg = bpgs.get(0);
    final OBContext obContext = OBContext.getOBContext();
    assertEquals(obContext.getUser().getId(), bpg.getCreatedBy().getId());
    assertEquals(obContext.getUser().getId(), bpg.getUpdatedBy().getId());
    // update and create have occured less than one second ago
    // note that if the delete fails for other reasons that you will have a
    // currency in the database which has for sure a created/updated time
    // longer in the past, You need to manually delete the currency record
    if (false) {
View Full Code Here

TOP

Related Classes of org.openbravo.dal.core.OBContext

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.