aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateRegionData.cs31
1 files changed, 30 insertions, 1 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
index f6c67f5..86a93f2 100644
--- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
@@ -250,6 +250,16 @@ namespace OpenSim.Data.NHibernate
250 { 250 {
251 SOG[p.ParentUUID].AddPart(p); 251 SOG[p.ParentUUID].AddPart(p);
252 } 252 }
253 // get the inventory
254
255 ICriteria InvCriteria = session.CreateCriteria(typeof(TaskInventoryItem));
256 InvCriteria.Add(Expression.Eq("ParentPartID", p.UUID));
257 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
258 foreach (TaskInventoryItem i in InvCriteria.List())
259 {
260 inventory.Add(i);
261 }
262 p.RestoreInventoryItems(inventory);
253 } 263 }
254 foreach (SceneObjectGroup g in SOG.Values) 264 foreach (SceneObjectGroup g in SOG.Values)
255 { 265 {
@@ -385,7 +395,26 @@ namespace OpenSim.Data.NHibernate
385 /// <param name="items"></param> 395 /// <param name="items"></param>
386 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) 396 public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
387 { 397 {
388 398 ICriteria criteria = session.CreateCriteria(typeof(TaskInventoryItem));
399 criteria.Add(Expression.Eq("ParentPartID", primID));
400 try
401 {
402 foreach (TaskInventoryItem i in criteria.List())
403 {
404 session.Delete(i);
405 }
406
407 foreach (TaskInventoryItem i in items)
408 {
409 session.Save(i);
410
411 }
412 session.Flush();
413 }
414 catch (Exception e)
415 {
416 m_log.Error("[NHIBERNATE] StoreInvetory", e);
417 }
389 } 418 }
390 } 419 }
391} 420}