diff options
author | Sean Dague | 2008-07-23 22:14:34 +0000 |
---|---|---|
committer | Sean Dague | 2008-07-23 22:14:34 +0000 |
commit | 30a77b5b9f08c5bcea3e22bfaf8641379fac0232 (patch) | |
tree | 0515963eb2ca78739b0289ec3f21ee00865facb1 /OpenSim/Data | |
parent | fix column mapping (diff) | |
download | opensim-SC-30a77b5b9f08c5bcea3e22bfaf8641379fac0232.zip opensim-SC-30a77b5b9f08c5bcea3e22bfaf8641379fac0232.tar.gz opensim-SC-30a77b5b9f08c5bcea3e22bfaf8641379fac0232.tar.bz2 opensim-SC-30a77b5b9f08c5bcea3e22bfaf8641379fac0232.tar.xz |
implemented prim inventories for nhibernate
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateRegionData.cs | 31 |
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 | } |