aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate
diff options
context:
space:
mode:
authorKunnis2009-08-16 18:54:20 -0500
committerMelanie2009-08-19 23:45:22 +0100
commitf1287cc7af7da26910c5cba456a8c35b6454d815 (patch)
treec02fccc67728d57b5097a3ba643bb8ed6987ee8c /OpenSim/Data/NHibernate
parentFixes GetRootFolder for normal standalone, which was being incorrectly redire... (diff)
downloadopensim-SC-f1287cc7af7da26910c5cba456a8c35b6454d815.zip
opensim-SC-f1287cc7af7da26910c5cba456a8c35b6454d815.tar.gz
opensim-SC-f1287cc7af7da26910c5cba456a8c35b6454d815.tar.bz2
opensim-SC-f1287cc7af7da26910c5cba456a8c35b6454d815.tar.xz
* Switching IAssetData to follow the new naming schema, removing the separate insert and update methods.
Diffstat (limited to 'OpenSim/Data/NHibernate')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateAssetData.cs24
1 files changed, 9 insertions, 15 deletions
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
65 65
66 } 66 }
67 67
68 override protected AssetBase FetchStoredAsset(UUID uuid) 68 override public AssetBase GetAsset(UUID uuid)
69 { 69 {
70 return (AssetBase)manager.Get(typeof(AssetBase), uuid); 70 return (AssetBase)manager.Get(typeof(AssetBase), uuid);
71 } 71 }
72 72
73 private void Save(AssetBase asset) 73 override public void StoreAsset(AssetBase asset)
74 { 74 {
75 AssetBase temp = (AssetBase)manager.Get(typeof(AssetBase), asset.FullID); 75 AssetBase temp = (AssetBase)manager.Get(typeof(AssetBase), asset.FullID);
76 if (temp == null) 76 if (temp == null)
77 { 77 {
78 m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.FullID);
78 manager.Insert(asset); 79 manager.Insert(asset);
79 } 80 }
80 } 81 else
81 82 {
82 override public void CreateAsset(AssetBase asset) 83 m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID);
83 { 84 manager.Update(asset);
84 m_log.InfoFormat("[NHIBERNATE] inserting asset {0}", asset.FullID); 85 }
85 Save(asset);
86 }
87
88 override public void UpdateAsset(AssetBase asset)
89 {
90 m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID);
91 manager.Update(asset);
92 } 86 }
93 87
94 // private void LogAssetLoad(AssetBase asset) 88 // private void LogAssetLoad(AssetBase asset)
@@ -107,7 +101,7 @@ namespace OpenSim.Data.NHibernate
107 override public bool ExistsAsset(UUID uuid) 101 override public bool ExistsAsset(UUID uuid)
108 { 102 {
109 m_log.InfoFormat("[NHIBERNATE] ExistsAsset: {0}", uuid); 103 m_log.InfoFormat("[NHIBERNATE] ExistsAsset: {0}", uuid);
110 return (FetchAsset(uuid) != null); 104 return (GetAsset(uuid) != null);
111 } 105 }
112 106
113 /// <summary> 107 /// <summary>