Ejemplo n.º 1
0
 protected void makeDecrChange(String method, Object[] args) {
   String field = methodToField(method, 4);
   Attribute attr = _dao._allAttributes.get(field);
   assert (attr != null && attr.isUpdatable())
       : "Updating an attribute that's not updatable: " + field;
   decr(attr, args == null || args.length == 0 ? 1 : args[0]);
 }
Ejemplo n.º 2
0
  protected Attribute makeChange(String field, Object value) {
    Attribute attr = _dao._allAttributes.get(field);

    assert (attr == null || attr.isUpdatable())
        : "Updating an attribute that's not updatable: " + field;
    if (attr != null) {
      if (attr.attache == null) {
        _changes.put(field, new Ternary<Attribute, Boolean, Object>(attr, null, value));
      } else {
        if (_collectionChanges == null) {
          _collectionChanges = new HashMap<Attribute, Object>();
        }
        _collectionChanges.put(attr, value);
      }
    }
    return attr;
  }