* Check in another patch from http://opensimulator.org/mantis/view.php?id=2710
* This allows removal of the old NHiberate.Mapping.Attributes.dll * Also add in the files I forgot about last time. Doh!0.6.1-post-fixes
parent
b4db3a550a
commit
bdee86563c
|
@ -33,7 +33,6 @@ using System.Text.RegularExpressions;
|
|||
using OpenMetaverse;
|
||||
using log4net;
|
||||
using NHibernate;
|
||||
using NHibernate.Mapping.Attributes;
|
||||
using OpenSim.Framework;
|
||||
using Environment=NHibernate.Cfg.Environment;
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ using System.IO;
|
|||
using log4net;
|
||||
using NHibernate;
|
||||
using NHibernate.Cfg;
|
||||
using NHibernate.Mapping.Attributes;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
using OpenMetaverse;
|
||||
using Environment = NHibernate.Cfg.Environment;
|
||||
|
@ -77,11 +76,6 @@ namespace OpenSim.Data.NHibernate
|
|||
//exp.SetOutputFile("nameofthefile.sql");
|
||||
//exp.Create(false, true);
|
||||
|
||||
HbmSerializer.Default.Validate = true;
|
||||
using (MemoryStream stream =
|
||||
HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
|
||||
cfg.AddInputStream(stream);
|
||||
|
||||
factory = cfg.BuildSessionFactory();
|
||||
session = factory.OpenSession();
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
CREATE TABLE `regions` (
|
||||
`Uuid` varchar(36) NOT NULL,
|
||||
`RegionHandle` bigint(20) unsigned NOT NULL,
|
||||
`RegionName` varchar(32) default NULL,
|
||||
`RegionRecvKey` varchar(128) default NULL,
|
||||
`RegionSendKey` varchar(128) default NULL,
|
||||
`RegionSecret` varchar(128) default NULL,
|
||||
`RegionDataURI` varchar(255) default NULL,
|
||||
`ServerIP` varchar(64) default NULL,
|
||||
`ServerPort` int(10) unsigned default NULL,
|
||||
`ServerURI` varchar(255) default NULL,
|
||||
`RegionLocX` int(10) unsigned default NULL,
|
||||
`RegionLocY` int(10) unsigned default NULL,
|
||||
`RegionLocZ` int(10) unsigned default NULL,
|
||||
`EastOverrideHandle` bigint(20) unsigned default NULL,
|
||||
`WestOverrideHandle` bigint(20) unsigned default NULL,
|
||||
`SouthOverrideHandle` bigint(20) unsigned default NULL,
|
||||
`NorthOverrideHandle` bigint(20) unsigned default NULL,
|
||||
`RegionAssetURI` varchar(255) default NULL,
|
||||
`RegionAssetRecvKey` varchar(128) default NULL,
|
||||
`RegionAssetSendKey` varchar(128) default NULL,
|
||||
`RegionUserURI` varchar(255) default NULL,
|
||||
`RegionUserRecvKey` varchar(128) default NULL,
|
||||
`RegionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL,
|
||||
`ServerHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL,
|
||||
`Owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null,
|
||||
`OriginUUID` varchar(36),
|
||||
PRIMARY KEY (`uuid`),
|
||||
KEY `region_name` (`RegionName`),
|
||||
KEY `region_handle` (`RegionHandle`),
|
||||
KEY `overrideHandles` (`EastOverrideHandle`,`WestOverrideHandle`,`SouthOverrideHandle`,`NorthOverrideHandle`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 3';
|
|
@ -0,0 +1,23 @@
|
|||
<Addin id="OpenSim.Data.NHibernate" version="0.1">
|
||||
<Runtime>
|
||||
<Import assembly="OpenSim.Data.NHibernate.dll"/>
|
||||
</Runtime>
|
||||
<Dependencies>
|
||||
<Addin id="OpenSim.Data" version="0.5" />
|
||||
</Dependencies>
|
||||
<Extension path = "/OpenSim/GridData">
|
||||
<Plugin id="NHibernateGridData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateGridData" />
|
||||
</Extension>
|
||||
<!-- <Extension path = "/OpenSim/LogData">
|
||||
<Plugin id="MySQLLogData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLLogData" />
|
||||
</Extension> -->
|
||||
<Extension path = "/OpenSim/AssetData">
|
||||
<Plugin id="NHibernateAssetData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateAssetData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/InventoryData">
|
||||
<Plugin id="NHibernateInventoryData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateInventoryData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/UserData">
|
||||
<Plugin id="NHibernateUserData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateUserData" />
|
||||
</Extension>
|
||||
</Addin>
|
|
@ -0,0 +1,38 @@
|
|||
BEGIN TRANSACTION;
|
||||
|
||||
create table Regions (
|
||||
Uuid NVARCHAR(255) not null,
|
||||
RegionHandle BIGINT null,
|
||||
RegionName NVARCHAR(32) null,
|
||||
RegionRecvKey NVARCHAR(128) null,
|
||||
RegionSendKey NVARCHAR(128) null,
|
||||
RegionSecret NVARCHAR(128) null,
|
||||
RegionDataURI NVARCHAR(255) null,
|
||||
ServerIP NVARCHAR(64) null,
|
||||
ServerPort INT null,
|
||||
ServerURI NVARCHAR(255) null,
|
||||
RegionLocX INT null,
|
||||
RegionLocY INT null,
|
||||
RegionLocZ INT null,
|
||||
EastOverrideHandle BIGINT null,
|
||||
WestOverrideHandle BIGINT null,
|
||||
SouthOverrideHandle BIGINT null,
|
||||
NorthOverrideHandle BIGINT null,
|
||||
RegionAssetURI NVARCHAR(255) null,
|
||||
RegionAssetRecvKey NVARCHAR(128) null,
|
||||
RegionAssetSendKey NVARCHAR(128) null,
|
||||
RegionUserURI NVARCHAR(255) null,
|
||||
RegionUserRecvKey NVARCHAR(128) null,
|
||||
RegionUserSendKey NVARCHAR(128) null,
|
||||
ServerHttpPort INT null,
|
||||
ServerRemotingPort INT null,
|
||||
RegionMapTextureID NVARCHAR(255) null,
|
||||
Owner_uuid NVARCHAR(255) null,
|
||||
OriginUUID NVARCHAR(255) null,
|
||||
primary key (Uuid)
|
||||
);
|
||||
|
||||
create index region_handle on Regions (RegionHandle);
|
||||
create index region_name on Regions (RegionName);
|
||||
|
||||
COMMIT;
|
|
@ -0,0 +1,102 @@
|
|||
BEGIN TRANSACTION;
|
||||
|
||||
create table Prims (
|
||||
UUID TEXT not null,
|
||||
ParentID INTEGER,
|
||||
ParentUUID TEXT,
|
||||
RegionID TEXT,
|
||||
CreationDate INTEGER,
|
||||
Name TEXT,
|
||||
Text TEXT,
|
||||
Description TEXT,
|
||||
SitName TEXT,
|
||||
TouchName TEXT,
|
||||
ObjectFlags INTEGER,
|
||||
CreatorID TEXT,
|
||||
OwnerID TEXT,
|
||||
GroupID TEXT,
|
||||
LastOwnerID TEXT,
|
||||
OwnerMask INTEGER,
|
||||
NextOwnerMask INTEGER,
|
||||
GroupMask INTEGER,
|
||||
EveryoneMask INTEGER,
|
||||
BaseMask INTEGER,
|
||||
PositionX NUMERIC,
|
||||
PositionY NUMERIC,
|
||||
PositionZ NUMERIC,
|
||||
GroupPositionX NUMERIC,
|
||||
GroupPositionY NUMERIC,
|
||||
GroupPositionZ NUMERIC,
|
||||
VelocityX NUMERIC,
|
||||
VelocityY NUMERIC,
|
||||
VelocityZ NUMERIC,
|
||||
AngularVelocityX NUMERIC,
|
||||
AngularVelocityY NUMERIC,
|
||||
AngularVelocityZ NUMERIC,
|
||||
AccelerationX NUMERIC,
|
||||
AccelerationY NUMERIC,
|
||||
AccelerationZ NUMERIC,
|
||||
SitTargetOffsetX NUMERIC,
|
||||
SitTargetOffsetY NUMERIC,
|
||||
SitTargetOffsetZ NUMERIC,
|
||||
RotationX NUMERIC,
|
||||
RotationY NUMERIC,
|
||||
RotationZ NUMERIC,
|
||||
RotationW NUMERIC,
|
||||
SitTargetOrientX NUMERIC,
|
||||
SitTargetOrientY NUMERIC,
|
||||
SitTargetOrientZ NUMERIC,
|
||||
SitTargetOrientW NUMERIC,
|
||||
ScaleX NUMERIC,
|
||||
ScaleY NUMERIC,
|
||||
ScaleZ NUMERIC,
|
||||
PCode INTEGER,
|
||||
PathBegin INTEGER,
|
||||
PathEnd INTEGER,
|
||||
PathScaleX INTEGER,
|
||||
PathScaleY INTEGER,
|
||||
PathShearX INTEGER,
|
||||
PathShearY INTEGER,
|
||||
PathSkew INTEGER,
|
||||
PathCurve INTEGER,
|
||||
PathRadiusOffset INTEGER,
|
||||
PathRevolutions INTEGER,
|
||||
PathTaperX INTEGER,
|
||||
PathTwist INTEGER,
|
||||
ProfileBegin INTEGER,
|
||||
ProfileEnd INTEGER,
|
||||
ProfileCurve INTEGER,
|
||||
ProfileHollow INTEGER,
|
||||
Texture BLOB,
|
||||
ExtraParams BLOB,
|
||||
State INTEGER,
|
||||
primary key (UUID)
|
||||
);
|
||||
create table Terrain (
|
||||
RegionID TEXT not null,
|
||||
MapData BLOB,
|
||||
primary key (RegionID)
|
||||
);
|
||||
create table PrimItems (
|
||||
ItemID TEXT not null,
|
||||
PrimID TEXT,
|
||||
AssetID TEXT,
|
||||
ParentFolderID TEXT,
|
||||
CreatorID TEXT,
|
||||
OwnerID TEXT,
|
||||
GroupID TEXT,
|
||||
LastOwnerID TEXT,
|
||||
CurrentPermissions INTEGER,
|
||||
BasePermissions INTEGER,
|
||||
EveryonePermissions INTEGER,
|
||||
GroupPermissions INTEGER,
|
||||
NextPermissions INTEGER,
|
||||
Name TEXT,
|
||||
Description TEXT,
|
||||
CreationDate INTEGER,
|
||||
Flags INTEGER,
|
||||
InvType INTEGER,
|
||||
primary key (ItemID)
|
||||
);
|
||||
|
||||
COMMIT;
|
|
@ -0,0 +1,79 @@
|
|||
BEGIN TRANSACTION;
|
||||
|
||||
create table UserAgents (
|
||||
ProfileID TEXT not null,
|
||||
AgentIP TEXT,
|
||||
AgentPort INTEGER,
|
||||
AgentOnline INTEGER,
|
||||
SessionID TEXT,
|
||||
SecureSessionID TEXT,
|
||||
InitialRegion TEXT,
|
||||
Region TEXT,
|
||||
LoginTime INTEGER,
|
||||
LogoutTime INTEGER,
|
||||
Handle INTEGER,
|
||||
primary key (ProfileID)
|
||||
);
|
||||
create table UserProfiles (
|
||||
ID TEXT not null,
|
||||
FirstName TEXT,
|
||||
SurName TEXT,
|
||||
PasswordHash TEXT,
|
||||
PasswordSalt TEXT,
|
||||
WebLoginKey TEXT,
|
||||
HomeRegionX INTEGER,
|
||||
HomeRegionY INTEGER,
|
||||
HomeLocationX NUMERIC,
|
||||
HomeLocationY NUMERIC,
|
||||
HomeLocationZ NUMERIC,
|
||||
HomeLookAtX NUMERIC,
|
||||
HomeLookAtY NUMERIC,
|
||||
HomeLookAtZ NUMERIC,
|
||||
Created INTEGER,
|
||||
LastLogin INTEGER,
|
||||
RootInventoryFolderID TEXT,
|
||||
UserInventoryURI TEXT,
|
||||
UserAssetURI TEXT,
|
||||
Image TEXT,
|
||||
FirstLifeImage TEXT,
|
||||
AboutText TEXT,
|
||||
FirstLifeAboutText TEXT,
|
||||
primary key (ID)
|
||||
);
|
||||
create table UserAppearances (
|
||||
Owner TEXT not null,
|
||||
BodyItem TEXT,
|
||||
BodyAsset TEXT,
|
||||
SkinItem TEXT,
|
||||
SkinAsset TEXT,
|
||||
HairItem TEXT,
|
||||
HairAsset TEXT,
|
||||
EyesItem TEXT,
|
||||
EyesAsset TEXT,
|
||||
ShirtItem TEXT,
|
||||
ShirtAsset TEXT,
|
||||
PantsItem TEXT,
|
||||
PantsAsset TEXT,
|
||||
ShoesItem TEXT,
|
||||
ShoesAsset TEXT,
|
||||
SocksItem TEXT,
|
||||
SocksAsset TEXT,
|
||||
JacketItem TEXT,
|
||||
JacketAsset TEXT,
|
||||
GlovesItem TEXT,
|
||||
GlovesAsset TEXT,
|
||||
UnderShirtItem TEXT,
|
||||
UnderShirtAsset TEXT,
|
||||
UnderPantsItem TEXT,
|
||||
UnderPantsAsset TEXT,
|
||||
SkirtItem TEXT,
|
||||
SkirtAsset TEXT,
|
||||
Texture BLOB,
|
||||
VisualParams BLOB,
|
||||
Serial INTEGER,
|
||||
primary key (Owner)
|
||||
);
|
||||
create index user_firstname on UserProfiles (FirstName);
|
||||
create index user_surname on UserProfiles (SurName);
|
||||
|
||||
COMMIT;
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using NHibernate;
|
||||
using NHibernate.SqlTypes;
|
||||
using NHibernate.UserTypes;
|
||||
|
||||
namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
[Serializable]
|
||||
public class SByteType: IUserType
|
||||
{
|
||||
public object Assemble(object cached, object owner)
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
bool IUserType.Equals(object sbyte1, object sbyte2)
|
||||
{
|
||||
return sbyte1.Equals(sbyte2);
|
||||
}
|
||||
|
||||
public object DeepCopy(object sbyte1)
|
||||
{
|
||||
return sbyte1;
|
||||
}
|
||||
|
||||
public object Disassemble(object sbyte1)
|
||||
{
|
||||
return sbyte1;
|
||||
}
|
||||
|
||||
public int GetHashCode(object sbyte1)
|
||||
{
|
||||
return (sbyte1 == null) ? 0 : sbyte1.GetHashCode();
|
||||
}
|
||||
|
||||
public bool IsMutable
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public object NullSafeGet(IDataReader rs, string[] names, object owner)
|
||||
{
|
||||
object sbyte1 = null;
|
||||
|
||||
int ord = rs.GetOrdinal(names[0]);
|
||||
if (!rs.IsDBNull(ord))
|
||||
{
|
||||
sbyte1 = Convert.ToSByte(rs.GetInt16(ord));
|
||||
}
|
||||
return sbyte1;
|
||||
}
|
||||
|
||||
public void NullSafeSet(IDbCommand cmd, object obj, int index)
|
||||
{
|
||||
sbyte b = (sbyte)obj;
|
||||
((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt16(b);
|
||||
}
|
||||
|
||||
public object Replace(object original, object target, object owner)
|
||||
{
|
||||
return original;
|
||||
}
|
||||
|
||||
public Type ReturnedType
|
||||
{
|
||||
get { return typeof(sbyte); }
|
||||
}
|
||||
|
||||
public SqlType[] SqlTypes
|
||||
{
|
||||
get { return new SqlType [] { NHibernateUtil.Byte.SqlType }; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using NHibernate;
|
||||
using NHibernate.SqlTypes;
|
||||
using NHibernate.UserTypes;
|
||||
|
||||
namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
[Serializable]
|
||||
public class UInt16Type : IUserType
|
||||
{
|
||||
public object Assemble(object cached, object owner)
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
bool IUserType.Equals(object uint1, object uint2)
|
||||
{
|
||||
return uint1.Equals(uint2);
|
||||
}
|
||||
|
||||
public object DeepCopy(object uint1)
|
||||
{
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public object Disassemble(object uint1)
|
||||
{
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public int GetHashCode(object uint1)
|
||||
{
|
||||
return (uint1 == null) ? 0 : uint1.GetHashCode();
|
||||
}
|
||||
|
||||
public bool IsMutable
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public object NullSafeGet(IDataReader rs, string[] names, object owner)
|
||||
{
|
||||
object uint1 = null;
|
||||
|
||||
int ord = rs.GetOrdinal(names[0]);
|
||||
if (!rs.IsDBNull(ord))
|
||||
{
|
||||
uint1 = (UInt16)rs.GetInt16(ord);
|
||||
}
|
||||
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public void NullSafeSet(IDbCommand cmd, object obj, int index)
|
||||
{
|
||||
UInt16 uint1 = (UInt16)obj;
|
||||
((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt16(uint1);
|
||||
}
|
||||
|
||||
public object Replace(object original, object target, object owner)
|
||||
{
|
||||
return original;
|
||||
}
|
||||
|
||||
public Type ReturnedType
|
||||
{
|
||||
get { return typeof(UInt16); }
|
||||
}
|
||||
|
||||
public SqlType[] SqlTypes
|
||||
{
|
||||
get { return new SqlType [] { NHibernateUtil.Int16.SqlType }; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using NHibernate;
|
||||
using NHibernate.SqlTypes;
|
||||
using NHibernate.UserTypes;
|
||||
|
||||
namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
[Serializable]
|
||||
public class UInt32Type : IUserType
|
||||
{
|
||||
public object Assemble(object cached, object owner)
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
bool IUserType.Equals(object uint1, object uint2)
|
||||
{
|
||||
return uint1.Equals(uint2);
|
||||
}
|
||||
|
||||
public object DeepCopy(object uint1)
|
||||
{
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public object Disassemble(object uint1)
|
||||
{
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public int GetHashCode(object uint1)
|
||||
{
|
||||
return (uint1 == null) ? 0 : uint1.GetHashCode();
|
||||
}
|
||||
|
||||
public bool IsMutable
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public object NullSafeGet(IDataReader rs, string[] names, object owner)
|
||||
{
|
||||
object uint1 = null;
|
||||
|
||||
int ord = rs.GetOrdinal(names[0]);
|
||||
if (!rs.IsDBNull(ord))
|
||||
{
|
||||
uint1 = (UInt32)rs.GetInt32(ord);
|
||||
}
|
||||
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public void NullSafeSet(IDbCommand cmd, object obj, int index)
|
||||
{
|
||||
UInt32 uint1 = (UInt32)obj;
|
||||
((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt32(uint1);
|
||||
}
|
||||
|
||||
public object Replace(object original, object target, object owner)
|
||||
{
|
||||
return original;
|
||||
}
|
||||
|
||||
public Type ReturnedType
|
||||
{
|
||||
get { return typeof(UInt32); }
|
||||
}
|
||||
|
||||
public SqlType[] SqlTypes
|
||||
{
|
||||
get { return new SqlType [] { NHibernateUtil.Int32.SqlType }; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSim Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using NHibernate;
|
||||
using NHibernate.SqlTypes;
|
||||
using NHibernate.UserTypes;
|
||||
|
||||
namespace OpenSim.Data.NHibernate
|
||||
{
|
||||
[Serializable]
|
||||
public class UInt64Type : IUserType
|
||||
{
|
||||
public object Assemble(object cached, object owner)
|
||||
{
|
||||
return cached;
|
||||
}
|
||||
|
||||
bool IUserType.Equals(object uint1, object uint2)
|
||||
{
|
||||
return uint1.Equals(uint2);
|
||||
}
|
||||
|
||||
public object DeepCopy(object uint1)
|
||||
{
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public object Disassemble(object uint1)
|
||||
{
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public int GetHashCode(object uint1)
|
||||
{
|
||||
return (uint1 == null) ? 0 : uint1.GetHashCode();
|
||||
}
|
||||
|
||||
public bool IsMutable
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public object NullSafeGet(IDataReader rs, string[] names, object owner)
|
||||
{
|
||||
object uint1 = null;
|
||||
|
||||
int ord = rs.GetOrdinal(names[0]);
|
||||
if (!rs.IsDBNull(ord))
|
||||
{
|
||||
uint1 = (UInt64)rs.GetInt64(ord);
|
||||
}
|
||||
|
||||
return uint1;
|
||||
}
|
||||
|
||||
public void NullSafeSet(IDbCommand cmd, object obj, int index)
|
||||
{
|
||||
UInt64 uint1 = (UInt64)obj;
|
||||
((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt64(uint1);
|
||||
}
|
||||
|
||||
public object Replace(object original, object target, object owner)
|
||||
{
|
||||
return original;
|
||||
}
|
||||
|
||||
public Type ReturnedType
|
||||
{
|
||||
get { return typeof(UInt64); }
|
||||
}
|
||||
|
||||
public SqlType[] SqlTypes
|
||||
{
|
||||
get { return new SqlType [] { NHibernateUtil.Int64.SqlType }; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1861,7 +1861,6 @@
|
|||
<Reference name="OpenMetaverseTypes.dll"/>
|
||||
<Reference name="OpenMetaverse.dll"/>
|
||||
<Reference name="NHibernate.dll"/>
|
||||
<Reference name="NHibernate.Mapping.Attributes.dll"/>
|
||||
<Reference name="log4net.dll"/>
|
||||
|
||||
<Files>
|
||||
|
|
Loading…
Reference in New Issue