aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
diff options
context:
space:
mode:
authorSean Dague2008-05-14 15:43:19 +0000
committerSean Dague2008-05-14 15:43:19 +0000
commitb1327dda017716ac70836e3d272a15811337c75b (patch)
treeda309929b32c507884ad183b790c93b4df1ff56c /OpenSim/Data/NHibernate/NHibernateInventoryData.cs
parentFrom: Kurt Taylor <krtaylor@us.ibm.com> (diff)
downloadopensim-SC_OLD-b1327dda017716ac70836e3d272a15811337c75b.zip
opensim-SC_OLD-b1327dda017716ac70836e3d272a15811337c75b.tar.gz
opensim-SC_OLD-b1327dda017716ac70836e3d272a15811337c75b.tar.bz2
opensim-SC_OLD-b1327dda017716ac70836e3d272a15811337c75b.tar.xz
fix for a change in inventory that meant I was returning a lot
of empty inventory folders
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateInventoryData.cs')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateInventoryData.cs45
1 files changed, 16 insertions, 29 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
index 8305646..fa75588 100644
--- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
@@ -392,22 +392,15 @@ namespace OpenSim.Data.NHibernate
392 { 392 {
393 using (ISession session = factory.OpenSession()) 393 using (ISession session = factory.OpenSession())
394 { 394 {
395 // try 395 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
396 // { 396 criteria.Add(Expression.Eq("ParentID", LLUUID.Zero));
397 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); 397 criteria.Add(Expression.Eq("Owner", user));
398 criteria.Add(Expression.Eq("ParentID", LLUUID.Zero)); 398 foreach (InventoryFolderBase folder in criteria.List())
399 criteria.Add(Expression.Eq("Owner", user)); 399 {
400 foreach (InventoryFolderBase folder in criteria.List()) 400 return folder;
401 { 401 }
402 return folder; 402 m_log.ErrorFormat("No Inventory Root Folder Found for: {0}", user);
403 } 403 return null;
404 m_log.ErrorFormat("No Inventory Root Folder Found for: {0}", user);
405 return new InventoryFolderBase();
406// }
407// catch
408// {
409// return new InventoryFolderBase();
410// }
411 } 404 }
412 } 405 }
413 406
@@ -420,19 +413,13 @@ namespace OpenSim.Data.NHibernate
420 { 413 {
421 using (ISession session = factory.OpenSession()) 414 using (ISession session = factory.OpenSession())
422 { 415 {
423 // try 416
424// { 417 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
425 ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase)); 418 criteria.Add(Expression.Eq("ParentID", parentID));
426 criteria.Add(Expression.Eq("ParentID", parentID)); 419 foreach (InventoryFolderBase item in criteria.List())
427 foreach (InventoryFolderBase item in criteria.List()) 420 {
428 { 421 folders.Add(item);
429 folders.Add(item); 422 }
430 }
431 // }
432 // catch
433 // {
434 // m_log.ErrorFormat("Can't run getInventoryFolders for Folder ID: {0}", parentID);
435 // }
436 } 423 }
437 } 424 }
438 425