⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 collectioncacheentry.cs

📁 NHibernate NET开发者所需的
💻 CS
字号:
using System;
using NHibernate.Collection;
using NHibernate.Persister.Collection;
using NHibernate.Util;

namespace NHibernate.Cache.Entry
{
	[Serializable]
	public class CollectionCacheEntry
	{
		private readonly object state;

		public CollectionCacheEntry(IPersistentCollection collection, ICollectionPersister persister)
		{
			state = collection.Disassemble(persister);
		}

		internal CollectionCacheEntry(object state)
		{
			this.state = state;
		}

		public virtual object[] State
		{
			get { return (object[])state; }//TODO: assumes all collections disassemble to an array!
		}

		public virtual void Assemble(IPersistentCollection collection, ICollectionPersister persister, object owner)
		{
			collection.InitializeFromCache(persister, state, owner);
			collection.AfterInitialize(persister);
		}

		public override string ToString()
		{
			return "CollectionCacheEntry" + ArrayHelper.ToString(State);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -