more futzing around here. None of this works yet because

bloody LLUUID isn't serializable, which is really annoying.
0.6.0-stable
Sean Dague 2008-04-09 16:01:57 +00:00
parent 8bd1f1c7c3
commit 4cc3aad2f9
2 changed files with 9 additions and 8 deletions

View File

@ -31,6 +31,7 @@ using System.Reflection;
using System.Collections.Generic;
using libsecondlife;
using NHibernate;
using NHibernate.Expression;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using NHibernate.Mapping.Attributes;
@ -298,10 +299,10 @@ namespace OpenSim.Data.NHibernate
{
using(ISession session = factory.OpenSession()) {
try {
IQuery query = session.CreateQuery("from InventoryItems i where i.Folder = :folder");
query.SetString("folder", folderID.ToString());
ICriteria criteria = session.CreateCriteria(typeof(InventoryItemBase));
criteria.Add(Expression.Eq("Folder", folderID) );
List<InventoryItemBase> list = new List<InventoryItemBase>();
foreach (InventoryItemBase item in query.List())
foreach (InventoryItemBase item in criteria.List())
{
list.Add(item);
}
@ -322,10 +323,10 @@ namespace OpenSim.Data.NHibernate
{
using(ISession session = factory.OpenSession()) {
try {
IQuery query = session.CreateQuery("from InventoryFolders i where i.ParentID = :parent and i.Owner = :owner");
query.SetParameter("parent", LLUUID.Zero, NHibernateUtil.Custom(typeof(LLUUIDUserType)));
query.SetParameter("owner", user, NHibernateUtil.Custom(typeof(LLUUIDUserType)));
foreach (InventoryFolderBase folder in query.List())
ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
criteria.Add(Expression.Eq("ParentID", LLUUID.Zero) );
criteria.Add(Expression.Eq("Owner", user) );
foreach (InventoryFolderBase folder in criteria.List())
{
return folder;
}

View File

@ -67,7 +67,7 @@ namespace OpenSim.Data.NHibernate
public Type ReturnedType
{
get { return typeof(Guid); }
get { return typeof(LLUUID); }
}
public SqlType[] SqlTypes