Esempio n. 1
0
 public void SetSerializationMetaData(SerializationMetaData metaData)
 {
     this._persistent          = metaData._persistent;
     this._navigated           = metaData._navigated;
     this._readerPosition      = metaData._readerPosition;
     this._navigationQuery     = metaData._navigationQuery;
     this._navigatedAttributes = metaData._navigatedAttributes;
 }
 public void SetSerializationMetaData(SerializationMetaData metaData)
 {
     this._persistent = metaData._persistent;
     this._navigated = metaData._navigated;
     this._readerPosition = metaData._readerPosition;
     this._navigationQuery = metaData._navigationQuery;
     this._navigatedAttributes = metaData._navigatedAttributes;
 }
        public static SerializationQueryStrategy CreateStrategy(ISerializableObject data, SerializationMetaData metaData)
        {
            switch (data.SerializationStrategy)
            {
                case DEFAULT:
                    return new UpdateIfDeserializedSerializationQueryStrategy(data, metaData);
                case UPDATE_BY_PRIMARYKEY:
                    return new UpdateByPrimaryKeySerializationQueryStrategy(data);
                case INSERT:
                    return new InsertSerializationQueryStrategy(data);
                case REMOVE:
                    return new RemoveSerializationQueryStrategy(data);
            }

            throw new StrategyNotFoundException("Serialization strategy \""+data.SerializationStrategy+"\" not found");
        }
        internal SerializationMetaData GetSerializationMetaData(ISerializableObject obj)
        {
            //hole den Schlüssel für die Metadaten
            WeakReference         key = GetManagedMetaDataKey(obj);
            SerializationMetaData res;

            //Wenn es bereits Metadaten gibt, dann gebe diese zurück
            if (_managedMetaData.TryGetValue(key, out res))
            {
                return(res);
            }
            //Ansonsten neue Metadaten anlegen und zurückgeben
            else
            {
                res = new SerializationMetaData();
                _managedMetaData.Add(key, res);
                return(res);
            }
        }
        internal SerializationMetaData GetSerializationMetaData(ISerializableObject obj)
        {
            //hole den Schlüssel für die Metadaten
            WeakReference key = GetManagedMetaDataKey(obj);
            SerializationMetaData res;

            //Wenn es bereits Metadaten gibt, dann gebe diese zurück
            if (_managedMetaData.TryGetValue(key, out res))
            {
                return res;
            }
            //Ansonsten neue Metadaten anlegen und zurückgeben
            else
            {
                res = new SerializationMetaData();
                _managedMetaData.Add(key, res);
                return res;
            }
        }
 public UpdateIfDeserializedSerializationQueryStrategy(ISerializableObject data, SerializationMetaData metaData)
     : base(data)
 {
     this._metaData = metaData;
 }