mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
Thank you kindly, TLaukkan (Tommil) for a patch that:
* Created value object for EstateRegionLink for storing the estate region relationship. * Refactored slightly NHibernateManager and NHibernateXXXXData implementations for accesing nhibernate generated ID on insert. ** Changed NHibernateManager.Save method name to Insert as it does Insert. ** Changed NHibernateManager.Save return value object as ID can be both UUID and uint currently. ** Changed NHibernateManager.Load method Id parameter to object as it can be both UUID and uint. * Created NHibernateEstateData implementation. This is the actual estate storage. * Created NHibernate mapping files for both EstateSettings and EstateRegionLink * Created MigrationSyntaxDifferences.txt files to write notes about differences in migration scripts between different databases. * Created estate storage migration scripts for all four databases. * Created estate unit test classes for all four databases. * Updated one missing field to BasicEstateTest.cs * Tested NHibernate unit tests with NUnit GUI. Asset databases fail but that is not related to this patch. * Tested build with both Visual Studio and nant. * Executed build tests with nant succesfully.
This commit is contained in:
@@ -131,25 +131,25 @@ namespace OpenSim.Data.NHibernate
|
||||
RunMigration(dialect, assembly, store);
|
||||
}
|
||||
|
||||
public object Load(Type type, UUID uuid)
|
||||
public object Load(Type type, Object id)
|
||||
{
|
||||
using (IStatelessSession session = sessionFactory.OpenStatelessSession())
|
||||
{
|
||||
object obj = null;
|
||||
try
|
||||
{
|
||||
obj = session.Get(type.FullName, uuid);
|
||||
obj = session.Get(type.FullName, id);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: "+ e.ToString(), type.Name, uuid);
|
||||
m_log.ErrorFormat("[NHIBERNATE] {0} of id {1} loading threw exception: " + e.ToString(), type.Name, id);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool Save(object obj)
|
||||
public object Insert(object obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -157,16 +157,16 @@ namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
using (ITransaction transaction=session.BeginTransaction())
|
||||
{
|
||||
session.Insert(obj);
|
||||
Object identifier=session.Insert(obj);
|
||||
transaction.Commit();
|
||||
return true;
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[NHIBERNATE] issue inserting object ", e);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user