aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateRegionData.cs
diff options
context:
space:
mode:
authorJeff Ames2008-08-18 00:39:10 +0000
committerJeff Ames2008-08-18 00:39:10 +0000
commit6ef9d4da901a346c232458317cca6268da888e2e (patch)
treedd1d935b10f34f261839da9f9879c02322e8ede7 /OpenSim/Data/NHibernate/NHibernateRegionData.cs
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.zip
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.gz
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.bz2
opensim-SC_OLD-6ef9d4da901a346c232458317cca6268da888e2e.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateRegionData.cs')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateRegionData.cs36
1 files changed, 18 insertions, 18 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
index 52db32d..9682d87 100644
--- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
@@ -89,10 +89,10 @@ namespace OpenSim.Data.NHibernate
89 using (MemoryStream stream = 89 using (MemoryStream stream =
90 HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) 90 HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
91 cfg.AddInputStream(stream); 91 cfg.AddInputStream(stream);
92 92
93 factory = cfg.BuildSessionFactory(); 93 factory = cfg.BuildSessionFactory();
94 session = factory.OpenSession(); 94 session = factory.OpenSession();
95 95
96 // This actually does the roll forward assembly stuff 96 // This actually does the roll forward assembly stuff
97 Assembly assem = GetType().Assembly; 97 Assembly assem = GetType().Assembly;
98 Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore"); 98 Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "RegionStore");
@@ -113,7 +113,7 @@ namespace OpenSim.Data.NHibernate
113 { 113 {
114 return null; 114 return null;
115 } 115 }
116 116
117 // This looks inefficient, but it turns out that it isn't 117 // This looks inefficient, but it turns out that it isn't
118 // based on trial runs with nhibernate 1.2 118 // based on trial runs with nhibernate 1.2
119 private void SaveOrUpdate(SceneObjectPart p) 119 private void SaveOrUpdate(SceneObjectPart p)
@@ -164,7 +164,7 @@ namespace OpenSim.Data.NHibernate
164 /// <param name="regionUUID">the region UUID</param> 164 /// <param name="regionUUID">the region UUID</param>
165 public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) 165 public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
166 { 166 {
167 try 167 try
168 { 168 {
169 foreach (SceneObjectPart part in obj.Children.Values) 169 foreach (SceneObjectPart part in obj.Children.Values)
170 { 170 {
@@ -173,7 +173,7 @@ namespace OpenSim.Data.NHibernate
173 } 173 }
174 session.Flush(); 174 session.Flush();
175 } 175 }
176 catch (Exception e) 176 catch (Exception e)
177 { 177 {
178 m_log.Error("Can't save: ", e); 178 m_log.Error("Can't save: ", e);
179 } 179 }
@@ -196,7 +196,7 @@ namespace OpenSim.Data.NHibernate
196 group.AddPart(p); 196 group.AddPart(p);
197 group.RootPart = p; 197 group.RootPart = p;
198 } 198 }
199 else 199 else
200 { 200 {
201 group.AddPart(p); 201 group.AddPart(p);
202 } 202 }
@@ -232,7 +232,7 @@ namespace OpenSim.Data.NHibernate
232 { 232 {
233 Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>(); 233 Dictionary<LLUUID, SceneObjectGroup> SOG = new Dictionary<LLUUID, SceneObjectGroup>();
234 List<SceneObjectGroup> ret = new List<SceneObjectGroup>(); 234 List<SceneObjectGroup> ret = new List<SceneObjectGroup>();
235 235
236 ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); 236 ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart));
237 criteria.Add(Expression.Eq("RegionID", regionUUID)); 237 criteria.Add(Expression.Eq("RegionID", regionUUID));
238 criteria.AddOrder( Order.Asc("ParentID") ); 238 criteria.AddOrder( Order.Asc("ParentID") );
@@ -246,12 +246,12 @@ namespace OpenSim.Data.NHibernate
246 group.RootPart = p; 246 group.RootPart = p;
247 SOG.Add(p.ParentUUID, group); 247 SOG.Add(p.ParentUUID, group);
248 } 248 }
249 else 249 else
250 { 250 {
251 SOG[p.ParentUUID].AddPart(p); 251 SOG[p.ParentUUID].AddPart(p);
252 } 252 }
253 // get the inventory 253 // get the inventory
254 254
255 ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem)); 255 ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem));
256 InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID)); 256 InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID));
257 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); 257 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
@@ -263,7 +263,7 @@ namespace OpenSim.Data.NHibernate
263 if (inventory.Count > 0) 263 if (inventory.Count > 0)
264 p.RestoreInventoryItems(inventory); 264 p.RestoreInventoryItems(inventory);
265 } 265 }
266 foreach (SceneObjectGroup g in SOG.Values) 266 foreach (SceneObjectGroup g in SOG.Values)
267 { 267 {
268 ret.Add(g); 268 ret.Add(g);
269 } 269 }
@@ -304,7 +304,7 @@ namespace OpenSim.Data.NHibernate
304 } 304 }
305 305
306 /// <summary> 306 /// <summary>
307 /// 307 ///
308 /// </summary> 308 /// </summary>
309 /// <param name="globalID"></param> 309 /// <param name="globalID"></param>
310 public void RemoveLandObject(LLUUID globalID) 310 public void RemoveLandObject(LLUUID globalID)
@@ -313,7 +313,7 @@ namespace OpenSim.Data.NHibernate
313 } 313 }
314 314
315 /// <summary> 315 /// <summary>
316 /// 316 ///
317 /// </summary> 317 /// </summary>
318 /// <param name="parcel"></param> 318 /// <param name="parcel"></param>
319 public void StoreLandObject(ILandObject parcel) 319 public void StoreLandObject(ILandObject parcel)
@@ -322,7 +322,7 @@ namespace OpenSim.Data.NHibernate
322 } 322 }
323 323
324 /// <summary> 324 /// <summary>
325 /// 325 ///
326 /// </summary> 326 /// </summary>
327 /// <param name="regionUUID"></param> 327 /// <param name="regionUUID"></param>
328 /// <returns></returns> 328 /// <returns></returns>
@@ -341,7 +341,7 @@ namespace OpenSim.Data.NHibernate
341 { 341 {
342 session.Flush(); 342 session.Flush();
343 } 343 }
344 344
345 /// <summary> 345 /// <summary>
346 /// Load a region banlist 346 /// Load a region banlist
347 /// </summary> 347 /// </summary>
@@ -373,7 +373,7 @@ namespace OpenSim.Data.NHibernate
373 } 373 }
374 374
375 /// <summary> 375 /// <summary>
376 /// 376 ///
377 /// </summary> 377 /// </summary>
378 /// <param name="val"></param> 378 /// <param name="val"></param>
379 /// <returns></returns> 379 /// <returns></returns>
@@ -399,17 +399,17 @@ namespace OpenSim.Data.NHibernate
399 { 399 {
400 ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem)); 400 ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem));
401 criteria.Add(Expression.Eq("ParentPartID", primID)); 401 criteria.Add(Expression.Eq("ParentPartID", primID));
402 try 402 try
403 { 403 {
404 foreach (TaskInventoryItem i in criteria.List()) 404 foreach (TaskInventoryItem i in criteria.List())
405 { 405 {
406 session.Delete(i); 406 session.Delete(i);
407 } 407 }
408 408
409 foreach (TaskInventoryItem i in items) 409 foreach (TaskInventoryItem i in items)
410 { 410 {
411 session.Save(i); 411 session.Save(i);
412 412
413 } 413 }
414 session.Flush(); 414 session.Flush();
415 } 415 }