diff options
Diffstat (limited to 'OpenSim/Data/NHibernate')
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateAssetData.cs | 24 |
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> |