Beispiel #1
0
        public override RecordAccess_RecordProxy <RECORD, ADDITIONAL> SetRecord(long key, RECORD record, ADDITIONAL additionalData)
        {
            RecordChange <RECORD, ADDITIONAL> recordChange = new RecordChange <RECORD, ADDITIONAL>(_recordChanges, _changeCounter, key, record, _loader, false, additionalData);

            _recordChanges.put(key, recordChange);
            return(recordChange);
        }
Beispiel #2
0
        public override RecordAccess_RecordProxy <RECORD, ADDITIONAL> GetOrLoad(long key, ADDITIONAL additionalData)
        {
            RecordAccess_RecordProxy <RECORD, ADDITIONAL> result = _recordChanges.get(key);

            if (result == null)
            {
                RECORD record = _loader.load(key, additionalData);
                result = new RecordChange <RECORD, ADDITIONAL>(_recordChanges, _changeCounter, key, record, _loader, false, additionalData);
            }
            return(result);
        }
Beispiel #3
0
        public override RecordAccess_RecordProxy <RECORD, ADDITIONAL> Create(long key, ADDITIONAL additionalData)
        {
            if (_recordChanges.containsKey(key))
            {
                throw new System.InvalidOperationException(key + " already exists");
            }

            RECORD record = _loader.newUnused(key, additionalData);
            RecordChange <RECORD, ADDITIONAL> change = new RecordChange <RECORD, ADDITIONAL>(_recordChanges, _changeCounter, key, record, _loader, true, additionalData);

            _recordChanges.put(key, change);
            return(change);
        }