Exemplo n.º 1
0
  public StatefulBuffer readStatefulBufferById(Transaction trans, int id, boolean lastCommitted) {
    if (id <= 0) {
      throw new IllegalArgumentException("id=" + id);
    }

    Slot slot =
        lastCommitted ? trans.idSystem().committedSlot(id) : trans.idSystem().currentSlot(id);

    if (DTrace.enabled) {
      DTrace.SLOT_READ.logLength(id, slot);
    }

    return readStatefulBufferBySlot(trans, id, slot);
  }
Exemplo n.º 2
0
  private Constraint addEvaluationToAllConstraints(QConEvaluation eval) {

    if (i_constraints.size() == 0) {
      _trans
          .container()
          .classCollection()
          .iterateTopLevelClasses(
              new Visitor4() {
                public void visit(Object obj) {
                  ClassMetadata classMetadata = (ClassMetadata) obj;
                  QConClass qcc = new QConClass(_trans, classMetadata.classReflector());
                  addConstraint(qcc);
                  toConstraint(i_constraints).or(qcc);
                }
              });
    }

    Iterator4 i = iterateConstraints();
    while (i.moveNext()) {
      ((QCon) i.current()).addConstraint(eval);
    }

    // FIXME: should return valid Constraint object
    return null;
  }
Exemplo n.º 3
0
 private ReflectClass reflectClassForClass(Object example) {
   if (example instanceof ReflectClass) {
     return (ReflectClass) example;
   }
   if (example instanceof Class) {
     return _trans.reflector().forClass((Class) example);
   }
   return null;
 }
Exemplo n.º 4
0
  public final boolean delete4(
      Transaction transaction, ObjectReference ref, Object obj, int cascade, boolean userCall) {
    int id = ref.getID();
    StatefulBuffer reader = readStatefulBufferById(transaction, id);
    if (reader != null) {
      if (obj != null) {
        if ((!showInternalClasses()) && Const4.CLASS_INTERNAL.isAssignableFrom(obj.getClass())) {
          return false;
        }
      }
      reader.setCascadeDeletes(cascade);
      transaction.idSystem().notifySlotDeleted(id, SlotChangeFactory.USER_OBJECTS);
      ClassMetadata classMetadata = ref.classMetadata();
      classMetadata.delete(reader, obj);

      return true;
    }
    return false;
  }
Exemplo n.º 5
0
 @Override
 public boolean isDeleted(Transaction trans, int id) {
   return trans.idSystem().isDeleted(id);
 }
Exemplo n.º 6
0
 public final Slot allocateSlotForNewUserObject(Transaction trans, int id, int length) {
   Slot slot = allocateSlot(length);
   trans.idSystem().notifySlotCreated(id, slot, SlotChangeFactory.USER_OBJECTS);
   return slot;
 }
Exemplo n.º 7
0
 public final void rollback1(Transaction trans) {
   trans.rollback();
 }
Exemplo n.º 8
0
 public final int idForNewUserObject(Transaction trans) {
   return trans.idSystem().newId(SlotChangeFactory.USER_OBJECTS);
 }
Exemplo n.º 9
0
 public void commit1(Transaction trans) {
   trans.commit();
 }
 private ReflectClass reflectorFor(Transaction trans, final Object obj) {
   return trans.container().reflector().forObject(obj);
 }
Exemplo n.º 11
0
 public void captureQueryResultConfig() {
   final Config4Impl config = _trans.container().config();
   _evaluationMode = config.evaluationMode();
   _prefetchDepth = config.prefetchDepth();
   _prefetchCount = config.prefetchObjectCount();
 }
Exemplo n.º 12
0
 protected ObjectContainerBase stream() {
   return _trans.container();
 }