From f1287cc7af7da26910c5cba456a8c35b6454d815 Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sun, 16 Aug 2009 18:54:20 -0500 Subject: * Switching IAssetData to follow the new naming schema, removing the separate insert and update methods. --- OpenSim/Data/NHibernate/NHibernateAssetData.cs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'OpenSim/Data/NHibernate') diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 9d8cec5..aaba15c 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs @@ -65,30 +65,24 @@ namespace OpenSim.Data.NHibernate } - override protected AssetBase FetchStoredAsset(UUID uuid) + override public AssetBase GetAsset(UUID uuid) { return (AssetBase)manager.Get(typeof(AssetBase), uuid); } - private void Save(AssetBase asset) + override public void StoreAsset(AssetBase asset) { AssetBase temp = (AssetBase)manager.Get(typeof(AssetBase), asset.FullID); if (temp == null) { + m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.FullID); manager.Insert(asset); } - } - - override public void CreateAsset(AssetBase asset) - { - m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.FullID); - Save(asset); - } - - override public void UpdateAsset(AssetBase asset) - { - m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID); - manager.Update(asset); + else + { + m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID); + manager.Update(asset); + } } // private void LogAssetLoad(AssetBase asset) @@ -107,7 +101,7 @@ namespace OpenSim.Data.NHibernate override public bool ExistsAsset(UUID uuid) { m_log.InfoFormat("[NHIBERNATE] ExistsAsset: {0}", uuid); - return (FetchAsset(uuid) != null); + return (GetAsset(uuid) != null); } /// -- cgit v1.1