aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate
diff options
context:
space:
mode:
authorDiva Canto2009-08-19 17:36:34 -0700
committerDiva Canto2009-08-19 17:36:34 -0700
commita3db2936f7b9297815244d39cdb33c26d17c70e2 (patch)
tree6f5c6626f94f878a020412f348dcbc51aadd2312 /OpenSim/Data/NHibernate
parentFixes GetItem and GetFolder for SQLite. Turns out some methods were no-op in ... (diff)
parentFixing a spot I missed in assets. Switching Grid to the new naming schema wit... (diff)
downloadopensim-SC_OLD-a3db2936f7b9297815244d39cdb33c26d17c70e2.zip
opensim-SC_OLD-a3db2936f7b9297815244d39cdb33c26d17c70e2.tar.gz
opensim-SC_OLD-a3db2936f7b9297815244d39cdb33c26d17c70e2.tar.bz2
opensim-SC_OLD-a3db2936f7b9297815244d39cdb33c26d17c70e2.tar.xz
Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Data/NHibernate')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateAssetData.cs24
-rw-r--r--OpenSim/Data/NHibernate/NHibernateGridData.cs14
2 files changed, 10 insertions, 28 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>
diff --git a/OpenSim/Data/NHibernate/NHibernateGridData.cs b/OpenSim/Data/NHibernate/NHibernateGridData.cs
index fe8da59..018af62 100644
--- a/OpenSim/Data/NHibernate/NHibernateGridData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateGridData.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Data.NHibernate
117 throw new NotImplementedException(); 117 throw new NotImplementedException();
118 } 118 }
119 119
120 public override DataResponse AddProfile(RegionProfileData profile) 120 public override DataResponse StoreProfile(RegionProfileData profile)
121 { 121 {
122 if (manager.Get(typeof(RegionProfileData), profile.Uuid) == null) 122 if (manager.Get(typeof(RegionProfileData), profile.Uuid) == null)
123 { 123 {
@@ -126,21 +126,9 @@ namespace OpenSim.Data.NHibernate
126 } 126 }
127 else 127 else
128 { 128 {
129 return DataResponse.RESPONSE_ERROR;
130 }
131 }
132
133 public override DataResponse UpdateProfile(RegionProfileData profile)
134 {
135 if (manager.Get(typeof(RegionProfileData), profile.Uuid) != null)
136 {
137 manager.Update(profile); 129 manager.Update(profile);
138 return DataResponse.RESPONSE_OK; 130 return DataResponse.RESPONSE_OK;
139 } 131 }
140 else
141 {
142 return DataResponse.RESPONSE_ERROR;
143 }
144 } 132 }
145 133
146 public override DataResponse DeleteProfile(string uuid) 134 public override DataResponse DeleteProfile(string uuid)