diff options
author | Justin Clarke Casey | 2008-12-04 20:48:08 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-12-04 20:48:08 +0000 |
commit | bdee86563cfce5211f182b78e64503a05fc7ffa1 (patch) | |
tree | 9b1e7e941e787d36f2248ff4b57f101a779351a6 /OpenSim/Data/NHibernate | |
parent | * Apply http://opensimulator.org/mantis/view.php?id=2750 with a small tweak. (diff) | |
download | opensim-SC_OLD-bdee86563cfce5211f182b78e64503a05fc7ffa1.zip opensim-SC_OLD-bdee86563cfce5211f182b78e64503a05fc7ffa1.tar.gz opensim-SC_OLD-bdee86563cfce5211f182b78e64503a05fc7ffa1.tar.bz2 opensim-SC_OLD-bdee86563cfce5211f182b78e64503a05fc7ffa1.tar.xz |
* 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!
Diffstat (limited to 'OpenSim/Data/NHibernate')
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateAssetData.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateManager.cs | 6 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/Resources/MySQLDialect/001_GridStore.sql | 32 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/Resources/OpenSim.Data.NHibernate.addin.xml | 23 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql | 38 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql | 102 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql | 79 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/SByteType.cs | 104 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/UInt16Type.cs | 105 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/UInt32Type.cs | 105 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/UInt64Type.cs | 105 |
11 files changed, 693 insertions, 7 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index 90d41e3..e1d074f 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs | |||
@@ -33,7 +33,6 @@ using System.Text.RegularExpressions; | |||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using log4net; | 34 | using log4net; |
35 | using NHibernate; | 35 | using NHibernate; |
36 | using NHibernate.Mapping.Attributes; | ||
37 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
38 | using Environment=NHibernate.Cfg.Environment; | 37 | using Environment=NHibernate.Cfg.Environment; |
39 | 38 | ||
diff --git a/OpenSim/Data/NHibernate/NHibernateManager.cs b/OpenSim/Data/NHibernate/NHibernateManager.cs index 36d84e2..46840ac 100644 --- a/OpenSim/Data/NHibernate/NHibernateManager.cs +++ b/OpenSim/Data/NHibernate/NHibernateManager.cs | |||
@@ -31,7 +31,6 @@ using System.IO; | |||
31 | using log4net; | 31 | using log4net; |
32 | using NHibernate; | 32 | using NHibernate; |
33 | using NHibernate.Cfg; | 33 | using NHibernate.Cfg; |
34 | using NHibernate.Mapping.Attributes; | ||
35 | using NHibernate.Tool.hbm2ddl; | 34 | using NHibernate.Tool.hbm2ddl; |
36 | using OpenMetaverse; | 35 | using OpenMetaverse; |
37 | using Environment = NHibernate.Cfg.Environment; | 36 | using Environment = NHibernate.Cfg.Environment; |
@@ -77,11 +76,6 @@ namespace OpenSim.Data.NHibernate | |||
77 | //exp.SetOutputFile("nameofthefile.sql"); | 76 | //exp.SetOutputFile("nameofthefile.sql"); |
78 | //exp.Create(false, true); | 77 | //exp.Create(false, true); |
79 | 78 | ||
80 | HbmSerializer.Default.Validate = true; | ||
81 | using (MemoryStream stream = | ||
82 | HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) | ||
83 | cfg.AddInputStream(stream); | ||
84 | |||
85 | factory = cfg.BuildSessionFactory(); | 79 | factory = cfg.BuildSessionFactory(); |
86 | session = factory.OpenSession(); | 80 | session = factory.OpenSession(); |
87 | 81 | ||
diff --git a/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_GridStore.sql b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_GridStore.sql new file mode 100644 index 0000000..df09603 --- /dev/null +++ b/OpenSim/Data/NHibernate/Resources/MySQLDialect/001_GridStore.sql | |||
@@ -0,0 +1,32 @@ | |||
1 | CREATE TABLE `regions` ( | ||
2 | `Uuid` varchar(36) NOT NULL, | ||
3 | `RegionHandle` bigint(20) unsigned NOT NULL, | ||
4 | `RegionName` varchar(32) default NULL, | ||
5 | `RegionRecvKey` varchar(128) default NULL, | ||
6 | `RegionSendKey` varchar(128) default NULL, | ||
7 | `RegionSecret` varchar(128) default NULL, | ||
8 | `RegionDataURI` varchar(255) default NULL, | ||
9 | `ServerIP` varchar(64) default NULL, | ||
10 | `ServerPort` int(10) unsigned default NULL, | ||
11 | `ServerURI` varchar(255) default NULL, | ||
12 | `RegionLocX` int(10) unsigned default NULL, | ||
13 | `RegionLocY` int(10) unsigned default NULL, | ||
14 | `RegionLocZ` int(10) unsigned default NULL, | ||
15 | `EastOverrideHandle` bigint(20) unsigned default NULL, | ||
16 | `WestOverrideHandle` bigint(20) unsigned default NULL, | ||
17 | `SouthOverrideHandle` bigint(20) unsigned default NULL, | ||
18 | `NorthOverrideHandle` bigint(20) unsigned default NULL, | ||
19 | `RegionAssetURI` varchar(255) default NULL, | ||
20 | `RegionAssetRecvKey` varchar(128) default NULL, | ||
21 | `RegionAssetSendKey` varchar(128) default NULL, | ||
22 | `RegionUserURI` varchar(255) default NULL, | ||
23 | `RegionUserRecvKey` varchar(128) default NULL, | ||
24 | `RegionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, | ||
25 | `ServerHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL, | ||
26 | `Owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null, | ||
27 | `OriginUUID` varchar(36), | ||
28 | PRIMARY KEY (`uuid`), | ||
29 | KEY `region_name` (`RegionName`), | ||
30 | KEY `region_handle` (`RegionHandle`), | ||
31 | KEY `overrideHandles` (`EastOverrideHandle`,`WestOverrideHandle`,`SouthOverrideHandle`,`NorthOverrideHandle`) | ||
32 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 3'; \ No newline at end of file | ||
diff --git a/OpenSim/Data/NHibernate/Resources/OpenSim.Data.NHibernate.addin.xml b/OpenSim/Data/NHibernate/Resources/OpenSim.Data.NHibernate.addin.xml new file mode 100644 index 0000000..37b23cb --- /dev/null +++ b/OpenSim/Data/NHibernate/Resources/OpenSim.Data.NHibernate.addin.xml | |||
@@ -0,0 +1,23 @@ | |||
1 | <Addin id="OpenSim.Data.NHibernate" version="0.1"> | ||
2 | <Runtime> | ||
3 | <Import assembly="OpenSim.Data.NHibernate.dll"/> | ||
4 | </Runtime> | ||
5 | <Dependencies> | ||
6 | <Addin id="OpenSim.Data" version="0.5" /> | ||
7 | </Dependencies> | ||
8 | <Extension path = "/OpenSim/GridData"> | ||
9 | <Plugin id="NHibernateGridData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateGridData" /> | ||
10 | </Extension> | ||
11 | <!-- <Extension path = "/OpenSim/LogData"> | ||
12 | <Plugin id="MySQLLogData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLLogData" /> | ||
13 | </Extension> --> | ||
14 | <Extension path = "/OpenSim/AssetData"> | ||
15 | <Plugin id="NHibernateAssetData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateAssetData" /> | ||
16 | </Extension> | ||
17 | <Extension path = "/OpenSim/InventoryData"> | ||
18 | <Plugin id="NHibernateInventoryData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateInventoryData" /> | ||
19 | </Extension> | ||
20 | <Extension path = "/OpenSim/UserData"> | ||
21 | <Plugin id="NHibernateUserData" provider="OpenSim.Data.NHibernate.dll" type="OpenSim.Data.NHibernate.NHibernateUserData" /> | ||
22 | </Extension> | ||
23 | </Addin> | ||
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql new file mode 100644 index 0000000..1cb18e3 --- /dev/null +++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql | |||
@@ -0,0 +1,38 @@ | |||
1 | BEGIN TRANSACTION; | ||
2 | |||
3 | create table Regions ( | ||
4 | Uuid NVARCHAR(255) not null, | ||
5 | RegionHandle BIGINT null, | ||
6 | RegionName NVARCHAR(32) null, | ||
7 | RegionRecvKey NVARCHAR(128) null, | ||
8 | RegionSendKey NVARCHAR(128) null, | ||
9 | RegionSecret NVARCHAR(128) null, | ||
10 | RegionDataURI NVARCHAR(255) null, | ||
11 | ServerIP NVARCHAR(64) null, | ||
12 | ServerPort INT null, | ||
13 | ServerURI NVARCHAR(255) null, | ||
14 | RegionLocX INT null, | ||
15 | RegionLocY INT null, | ||
16 | RegionLocZ INT null, | ||
17 | EastOverrideHandle BIGINT null, | ||
18 | WestOverrideHandle BIGINT null, | ||
19 | SouthOverrideHandle BIGINT null, | ||
20 | NorthOverrideHandle BIGINT null, | ||
21 | RegionAssetURI NVARCHAR(255) null, | ||
22 | RegionAssetRecvKey NVARCHAR(128) null, | ||
23 | RegionAssetSendKey NVARCHAR(128) null, | ||
24 | RegionUserURI NVARCHAR(255) null, | ||
25 | RegionUserRecvKey NVARCHAR(128) null, | ||
26 | RegionUserSendKey NVARCHAR(128) null, | ||
27 | ServerHttpPort INT null, | ||
28 | ServerRemotingPort INT null, | ||
29 | RegionMapTextureID NVARCHAR(255) null, | ||
30 | Owner_uuid NVARCHAR(255) null, | ||
31 | OriginUUID NVARCHAR(255) null, | ||
32 | primary key (Uuid) | ||
33 | ); | ||
34 | |||
35 | create index region_handle on Regions (RegionHandle); | ||
36 | create index region_name on Regions (RegionName); | ||
37 | |||
38 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql new file mode 100644 index 0000000..d557b9a --- /dev/null +++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_RegionStore.sql | |||
@@ -0,0 +1,102 @@ | |||
1 | BEGIN TRANSACTION; | ||
2 | |||
3 | create table Prims ( | ||
4 | UUID TEXT not null, | ||
5 | ParentID INTEGER, | ||
6 | ParentUUID TEXT, | ||
7 | RegionID TEXT, | ||
8 | CreationDate INTEGER, | ||
9 | Name TEXT, | ||
10 | Text TEXT, | ||
11 | Description TEXT, | ||
12 | SitName TEXT, | ||
13 | TouchName TEXT, | ||
14 | ObjectFlags INTEGER, | ||
15 | CreatorID TEXT, | ||
16 | OwnerID TEXT, | ||
17 | GroupID TEXT, | ||
18 | LastOwnerID TEXT, | ||
19 | OwnerMask INTEGER, | ||
20 | NextOwnerMask INTEGER, | ||
21 | GroupMask INTEGER, | ||
22 | EveryoneMask INTEGER, | ||
23 | BaseMask INTEGER, | ||
24 | PositionX NUMERIC, | ||
25 | PositionY NUMERIC, | ||
26 | PositionZ NUMERIC, | ||
27 | GroupPositionX NUMERIC, | ||
28 | GroupPositionY NUMERIC, | ||
29 | GroupPositionZ NUMERIC, | ||
30 | VelocityX NUMERIC, | ||
31 | VelocityY NUMERIC, | ||
32 | VelocityZ NUMERIC, | ||
33 | AngularVelocityX NUMERIC, | ||
34 | AngularVelocityY NUMERIC, | ||
35 | AngularVelocityZ NUMERIC, | ||
36 | AccelerationX NUMERIC, | ||
37 | AccelerationY NUMERIC, | ||
38 | AccelerationZ NUMERIC, | ||
39 | SitTargetOffsetX NUMERIC, | ||
40 | SitTargetOffsetY NUMERIC, | ||
41 | SitTargetOffsetZ NUMERIC, | ||
42 | RotationX NUMERIC, | ||
43 | RotationY NUMERIC, | ||
44 | RotationZ NUMERIC, | ||
45 | RotationW NUMERIC, | ||
46 | SitTargetOrientX NUMERIC, | ||
47 | SitTargetOrientY NUMERIC, | ||
48 | SitTargetOrientZ NUMERIC, | ||
49 | SitTargetOrientW NUMERIC, | ||
50 | ScaleX NUMERIC, | ||
51 | ScaleY NUMERIC, | ||
52 | ScaleZ NUMERIC, | ||
53 | PCode INTEGER, | ||
54 | PathBegin INTEGER, | ||
55 | PathEnd INTEGER, | ||
56 | PathScaleX INTEGER, | ||
57 | PathScaleY INTEGER, | ||
58 | PathShearX INTEGER, | ||
59 | PathShearY INTEGER, | ||
60 | PathSkew INTEGER, | ||
61 | PathCurve INTEGER, | ||
62 | PathRadiusOffset INTEGER, | ||
63 | PathRevolutions INTEGER, | ||
64 | PathTaperX INTEGER, | ||
65 | PathTwist INTEGER, | ||
66 | ProfileBegin INTEGER, | ||
67 | ProfileEnd INTEGER, | ||
68 | ProfileCurve INTEGER, | ||
69 | ProfileHollow INTEGER, | ||
70 | Texture BLOB, | ||
71 | ExtraParams BLOB, | ||
72 | State INTEGER, | ||
73 | primary key (UUID) | ||
74 | ); | ||
75 | create table Terrain ( | ||
76 | RegionID TEXT not null, | ||
77 | MapData BLOB, | ||
78 | primary key (RegionID) | ||
79 | ); | ||
80 | create table PrimItems ( | ||
81 | ItemID TEXT not null, | ||
82 | PrimID TEXT, | ||
83 | AssetID TEXT, | ||
84 | ParentFolderID TEXT, | ||
85 | CreatorID TEXT, | ||
86 | OwnerID TEXT, | ||
87 | GroupID TEXT, | ||
88 | LastOwnerID TEXT, | ||
89 | CurrentPermissions INTEGER, | ||
90 | BasePermissions INTEGER, | ||
91 | EveryonePermissions INTEGER, | ||
92 | GroupPermissions INTEGER, | ||
93 | NextPermissions INTEGER, | ||
94 | Name TEXT, | ||
95 | Description TEXT, | ||
96 | CreationDate INTEGER, | ||
97 | Flags INTEGER, | ||
98 | InvType INTEGER, | ||
99 | primary key (ItemID) | ||
100 | ); | ||
101 | |||
102 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql new file mode 100644 index 0000000..8d1ba5c --- /dev/null +++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_UserStore.sql | |||
@@ -0,0 +1,79 @@ | |||
1 | BEGIN TRANSACTION; | ||
2 | |||
3 | create table UserAgents ( | ||
4 | ProfileID TEXT not null, | ||
5 | AgentIP TEXT, | ||
6 | AgentPort INTEGER, | ||
7 | AgentOnline INTEGER, | ||
8 | SessionID TEXT, | ||
9 | SecureSessionID TEXT, | ||
10 | InitialRegion TEXT, | ||
11 | Region TEXT, | ||
12 | LoginTime INTEGER, | ||
13 | LogoutTime INTEGER, | ||
14 | Handle INTEGER, | ||
15 | primary key (ProfileID) | ||
16 | ); | ||
17 | create table UserProfiles ( | ||
18 | ID TEXT not null, | ||
19 | FirstName TEXT, | ||
20 | SurName TEXT, | ||
21 | PasswordHash TEXT, | ||
22 | PasswordSalt TEXT, | ||
23 | WebLoginKey TEXT, | ||
24 | HomeRegionX INTEGER, | ||
25 | HomeRegionY INTEGER, | ||
26 | HomeLocationX NUMERIC, | ||
27 | HomeLocationY NUMERIC, | ||
28 | HomeLocationZ NUMERIC, | ||
29 | HomeLookAtX NUMERIC, | ||
30 | HomeLookAtY NUMERIC, | ||
31 | HomeLookAtZ NUMERIC, | ||
32 | Created INTEGER, | ||
33 | LastLogin INTEGER, | ||
34 | RootInventoryFolderID TEXT, | ||
35 | UserInventoryURI TEXT, | ||
36 | UserAssetURI TEXT, | ||
37 | Image TEXT, | ||
38 | FirstLifeImage TEXT, | ||
39 | AboutText TEXT, | ||
40 | FirstLifeAboutText TEXT, | ||
41 | primary key (ID) | ||
42 | ); | ||
43 | create table UserAppearances ( | ||
44 | Owner TEXT not null, | ||
45 | BodyItem TEXT, | ||
46 | BodyAsset TEXT, | ||
47 | SkinItem TEXT, | ||
48 | SkinAsset TEXT, | ||
49 | HairItem TEXT, | ||
50 | HairAsset TEXT, | ||
51 | EyesItem TEXT, | ||
52 | EyesAsset TEXT, | ||
53 | ShirtItem TEXT, | ||
54 | ShirtAsset TEXT, | ||
55 | PantsItem TEXT, | ||
56 | PantsAsset TEXT, | ||
57 | ShoesItem TEXT, | ||
58 | ShoesAsset TEXT, | ||
59 | SocksItem TEXT, | ||
60 | SocksAsset TEXT, | ||
61 | JacketItem TEXT, | ||
62 | JacketAsset TEXT, | ||
63 | GlovesItem TEXT, | ||
64 | GlovesAsset TEXT, | ||
65 | UnderShirtItem TEXT, | ||
66 | UnderShirtAsset TEXT, | ||
67 | UnderPantsItem TEXT, | ||
68 | UnderPantsAsset TEXT, | ||
69 | SkirtItem TEXT, | ||
70 | SkirtAsset TEXT, | ||
71 | Texture BLOB, | ||
72 | VisualParams BLOB, | ||
73 | Serial INTEGER, | ||
74 | primary key (Owner) | ||
75 | ); | ||
76 | create index user_firstname on UserProfiles (FirstName); | ||
77 | create index user_surname on UserProfiles (SurName); | ||
78 | |||
79 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/NHibernate/SByteType.cs b/OpenSim/Data/NHibernate/SByteType.cs new file mode 100644 index 0000000..0d8431d --- /dev/null +++ b/OpenSim/Data/NHibernate/SByteType.cs | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Data; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | using NHibernate; | ||
33 | using NHibernate.SqlTypes; | ||
34 | using NHibernate.UserTypes; | ||
35 | |||
36 | namespace OpenSim.Data.NHibernate | ||
37 | { | ||
38 | [Serializable] | ||
39 | public class SByteType: IUserType | ||
40 | { | ||
41 | public object Assemble(object cached, object owner) | ||
42 | { | ||
43 | return cached; | ||
44 | } | ||
45 | |||
46 | bool IUserType.Equals(object sbyte1, object sbyte2) | ||
47 | { | ||
48 | return sbyte1.Equals(sbyte2); | ||
49 | } | ||
50 | |||
51 | public object DeepCopy(object sbyte1) | ||
52 | { | ||
53 | return sbyte1; | ||
54 | } | ||
55 | |||
56 | public object Disassemble(object sbyte1) | ||
57 | { | ||
58 | return sbyte1; | ||
59 | } | ||
60 | |||
61 | public int GetHashCode(object sbyte1) | ||
62 | { | ||
63 | return (sbyte1 == null) ? 0 : sbyte1.GetHashCode(); | ||
64 | } | ||
65 | |||
66 | public bool IsMutable | ||
67 | { | ||
68 | get { return false; } | ||
69 | } | ||
70 | |||
71 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | ||
72 | { | ||
73 | object sbyte1 = null; | ||
74 | |||
75 | int ord = rs.GetOrdinal(names[0]); | ||
76 | if (!rs.IsDBNull(ord)) | ||
77 | { | ||
78 | sbyte1 = Convert.ToSByte(rs.GetInt16(ord)); | ||
79 | } | ||
80 | return sbyte1; | ||
81 | } | ||
82 | |||
83 | public void NullSafeSet(IDbCommand cmd, object obj, int index) | ||
84 | { | ||
85 | sbyte b = (sbyte)obj; | ||
86 | ((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt16(b); | ||
87 | } | ||
88 | |||
89 | public object Replace(object original, object target, object owner) | ||
90 | { | ||
91 | return original; | ||
92 | } | ||
93 | |||
94 | public Type ReturnedType | ||
95 | { | ||
96 | get { return typeof(sbyte); } | ||
97 | } | ||
98 | |||
99 | public SqlType[] SqlTypes | ||
100 | { | ||
101 | get { return new SqlType [] { NHibernateUtil.Byte.SqlType }; } | ||
102 | } | ||
103 | } | ||
104 | } | ||
diff --git a/OpenSim/Data/NHibernate/UInt16Type.cs b/OpenSim/Data/NHibernate/UInt16Type.cs new file mode 100644 index 0000000..b805288 --- /dev/null +++ b/OpenSim/Data/NHibernate/UInt16Type.cs | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Data; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | using NHibernate; | ||
33 | using NHibernate.SqlTypes; | ||
34 | using NHibernate.UserTypes; | ||
35 | |||
36 | namespace OpenSim.Data.NHibernate | ||
37 | { | ||
38 | [Serializable] | ||
39 | public class UInt16Type : IUserType | ||
40 | { | ||
41 | public object Assemble(object cached, object owner) | ||
42 | { | ||
43 | return cached; | ||
44 | } | ||
45 | |||
46 | bool IUserType.Equals(object uint1, object uint2) | ||
47 | { | ||
48 | return uint1.Equals(uint2); | ||
49 | } | ||
50 | |||
51 | public object DeepCopy(object uint1) | ||
52 | { | ||
53 | return uint1; | ||
54 | } | ||
55 | |||
56 | public object Disassemble(object uint1) | ||
57 | { | ||
58 | return uint1; | ||
59 | } | ||
60 | |||
61 | public int GetHashCode(object uint1) | ||
62 | { | ||
63 | return (uint1 == null) ? 0 : uint1.GetHashCode(); | ||
64 | } | ||
65 | |||
66 | public bool IsMutable | ||
67 | { | ||
68 | get { return false; } | ||
69 | } | ||
70 | |||
71 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | ||
72 | { | ||
73 | object uint1 = null; | ||
74 | |||
75 | int ord = rs.GetOrdinal(names[0]); | ||
76 | if (!rs.IsDBNull(ord)) | ||
77 | { | ||
78 | uint1 = (UInt16)rs.GetInt16(ord); | ||
79 | } | ||
80 | |||
81 | return uint1; | ||
82 | } | ||
83 | |||
84 | public void NullSafeSet(IDbCommand cmd, object obj, int index) | ||
85 | { | ||
86 | UInt16 uint1 = (UInt16)obj; | ||
87 | ((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt16(uint1); | ||
88 | } | ||
89 | |||
90 | public object Replace(object original, object target, object owner) | ||
91 | { | ||
92 | return original; | ||
93 | } | ||
94 | |||
95 | public Type ReturnedType | ||
96 | { | ||
97 | get { return typeof(UInt16); } | ||
98 | } | ||
99 | |||
100 | public SqlType[] SqlTypes | ||
101 | { | ||
102 | get { return new SqlType [] { NHibernateUtil.Int16.SqlType }; } | ||
103 | } | ||
104 | } | ||
105 | } | ||
diff --git a/OpenSim/Data/NHibernate/UInt32Type.cs b/OpenSim/Data/NHibernate/UInt32Type.cs new file mode 100644 index 0000000..2500194 --- /dev/null +++ b/OpenSim/Data/NHibernate/UInt32Type.cs | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Data; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | using NHibernate; | ||
33 | using NHibernate.SqlTypes; | ||
34 | using NHibernate.UserTypes; | ||
35 | |||
36 | namespace OpenSim.Data.NHibernate | ||
37 | { | ||
38 | [Serializable] | ||
39 | public class UInt32Type : IUserType | ||
40 | { | ||
41 | public object Assemble(object cached, object owner) | ||
42 | { | ||
43 | return cached; | ||
44 | } | ||
45 | |||
46 | bool IUserType.Equals(object uint1, object uint2) | ||
47 | { | ||
48 | return uint1.Equals(uint2); | ||
49 | } | ||
50 | |||
51 | public object DeepCopy(object uint1) | ||
52 | { | ||
53 | return uint1; | ||
54 | } | ||
55 | |||
56 | public object Disassemble(object uint1) | ||
57 | { | ||
58 | return uint1; | ||
59 | } | ||
60 | |||
61 | public int GetHashCode(object uint1) | ||
62 | { | ||
63 | return (uint1 == null) ? 0 : uint1.GetHashCode(); | ||
64 | } | ||
65 | |||
66 | public bool IsMutable | ||
67 | { | ||
68 | get { return false; } | ||
69 | } | ||
70 | |||
71 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | ||
72 | { | ||
73 | object uint1 = null; | ||
74 | |||
75 | int ord = rs.GetOrdinal(names[0]); | ||
76 | if (!rs.IsDBNull(ord)) | ||
77 | { | ||
78 | uint1 = (UInt32)rs.GetInt32(ord); | ||
79 | } | ||
80 | |||
81 | return uint1; | ||
82 | } | ||
83 | |||
84 | public void NullSafeSet(IDbCommand cmd, object obj, int index) | ||
85 | { | ||
86 | UInt32 uint1 = (UInt32)obj; | ||
87 | ((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt32(uint1); | ||
88 | } | ||
89 | |||
90 | public object Replace(object original, object target, object owner) | ||
91 | { | ||
92 | return original; | ||
93 | } | ||
94 | |||
95 | public Type ReturnedType | ||
96 | { | ||
97 | get { return typeof(UInt32); } | ||
98 | } | ||
99 | |||
100 | public SqlType[] SqlTypes | ||
101 | { | ||
102 | get { return new SqlType [] { NHibernateUtil.Int32.SqlType }; } | ||
103 | } | ||
104 | } | ||
105 | } | ||
diff --git a/OpenSim/Data/NHibernate/UInt64Type.cs b/OpenSim/Data/NHibernate/UInt64Type.cs new file mode 100644 index 0000000..304c9371 --- /dev/null +++ b/OpenSim/Data/NHibernate/UInt64Type.cs | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Data; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | using NHibernate; | ||
33 | using NHibernate.SqlTypes; | ||
34 | using NHibernate.UserTypes; | ||
35 | |||
36 | namespace OpenSim.Data.NHibernate | ||
37 | { | ||
38 | [Serializable] | ||
39 | public class UInt64Type : IUserType | ||
40 | { | ||
41 | public object Assemble(object cached, object owner) | ||
42 | { | ||
43 | return cached; | ||
44 | } | ||
45 | |||
46 | bool IUserType.Equals(object uint1, object uint2) | ||
47 | { | ||
48 | return uint1.Equals(uint2); | ||
49 | } | ||
50 | |||
51 | public object DeepCopy(object uint1) | ||
52 | { | ||
53 | return uint1; | ||
54 | } | ||
55 | |||
56 | public object Disassemble(object uint1) | ||
57 | { | ||
58 | return uint1; | ||
59 | } | ||
60 | |||
61 | public int GetHashCode(object uint1) | ||
62 | { | ||
63 | return (uint1 == null) ? 0 : uint1.GetHashCode(); | ||
64 | } | ||
65 | |||
66 | public bool IsMutable | ||
67 | { | ||
68 | get { return false; } | ||
69 | } | ||
70 | |||
71 | public object NullSafeGet(IDataReader rs, string[] names, object owner) | ||
72 | { | ||
73 | object uint1 = null; | ||
74 | |||
75 | int ord = rs.GetOrdinal(names[0]); | ||
76 | if (!rs.IsDBNull(ord)) | ||
77 | { | ||
78 | uint1 = (UInt64)rs.GetInt64(ord); | ||
79 | } | ||
80 | |||
81 | return uint1; | ||
82 | } | ||
83 | |||
84 | public void NullSafeSet(IDbCommand cmd, object obj, int index) | ||
85 | { | ||
86 | UInt64 uint1 = (UInt64)obj; | ||
87 | ((IDataParameter)cmd.Parameters[index]).Value = Convert.ToInt64(uint1); | ||
88 | } | ||
89 | |||
90 | public object Replace(object original, object target, object owner) | ||
91 | { | ||
92 | return original; | ||
93 | } | ||
94 | |||
95 | public Type ReturnedType | ||
96 | { | ||
97 | get { return typeof(UInt64); } | ||
98 | } | ||
99 | |||
100 | public SqlType[] SqlTypes | ||
101 | { | ||
102 | get { return new SqlType [] { NHibernateUtil.Int64.SqlType }; } | ||
103 | } | ||
104 | } | ||
105 | } | ||