aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate
diff options
context:
space:
mode:
authorSean Dague2008-07-17 18:59:06 +0000
committerSean Dague2008-07-17 18:59:06 +0000
commitdd144e12ba7a92d4a92986ccaa66d63d410ef028 (patch)
tree03aca0f0087568ae975e5c51f3481d3e3fec526d /OpenSim/Data/NHibernate
parentfinish NHibernate mapping for prims, and it even seems to work (diff)
downloadopensim-SC-dd144e12ba7a92d4a92986ccaa66d63d410ef028.zip
opensim-SC-dd144e12ba7a92d4a92986ccaa66d63d410ef028.tar.gz
opensim-SC-dd144e12ba7a92d4a92986ccaa66d63d410ef028.tar.bz2
opensim-SC-dd144e12ba7a92d4a92986ccaa66d63d410ef028.tar.xz
git merge
Diffstat (limited to 'OpenSim/Data/NHibernate')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateRegionData.cs30
-rw-r--r--OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml21
-rw-r--r--OpenSim/Data/NHibernate/TextureUserType.cs12
3 files changed, 4 insertions, 59 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
index 3ba3556..8ca0afe 100644
--- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections;
30using System.Collections.Generic; 29using System.Collections.Generic;
31using System.IO; 30using System.IO;
32using System.Reflection; 31using System.Reflection;
@@ -113,33 +112,6 @@ namespace OpenSim.Data.NHibernate
113 { 112 {
114 return null; 113 return null;
115 } 114 }
116
117 private void SaveOrUpdate(SceneObjectPart p)
118 {
119 try
120 {
121 ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart));
122 criteria.Add(Expression.Eq("UUID", p.UUID));
123 if (criteria.List().Count < 1)
124 {
125 session.Save(p);
126 }
127 else if (criteria.List().Count == 1)
128 {
129 SceneObjectPart old = (SceneObjectPart)criteria.List()[0];
130 session.Evict(old);
131 session.Update(p);
132 }
133 else
134 {
135 m_log.Error("Not unique");
136 }
137 }
138 catch (Exception e)
139 {
140 m_log.Error("[NHIBERNATE] issue saving asset", e);
141 }
142 }
143 115
144 /// <summary> 116 /// <summary>
145 /// Adds an object into region storage 117 /// Adds an object into region storage
@@ -153,7 +125,7 @@ namespace OpenSim.Data.NHibernate
153 foreach (SceneObjectPart part in obj.Children.Values) 125 foreach (SceneObjectPart part in obj.Children.Values)
154 { 126 {
155 m_log.InfoFormat("Storing part {0}", part.UUID); 127 m_log.InfoFormat("Storing part {0}", part.UUID);
156 SaveOrUpdate(part); 128 session.SaveOrUpdate(part);
157 } 129 }
158 session.Flush(); 130 session.Flush();
159 } 131 }
diff --git a/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml b/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml
index 40d3864..5b8b7f2 100644
--- a/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml
@@ -82,26 +82,7 @@
82 <column name="ScaleY" /> 82 <column name="ScaleY" />
83 <column name="ScaleZ" /> 83 <column name="ScaleZ" />
84 </property> 84 </property>
85 <property name="PCode" type="System.Byte" /> 85
86 <property name="PathBegin" type="System.UInt16" />
87 <property name="PathEnd" type="System.UInt16" />
88 <property name="PathScaleX" type="System.Byte" />
89 <property name="PathScaleY" type="System.Byte" />
90 <property name="PathShearX" type="System.Byte" />
91 <property name="PathShearY" type="System.Byte" />
92 <property name="PathSkew" type="System.SByte" />
93 <property name="PathCurve" type="System.Byte" />
94 <property name="PathRadiusOffset" type="System.SByte" />
95 <property name="PathRevolutions" type="System.Byte" />
96 <property name="PathTaperX" type="System.SByte" />
97 <property name="PathTwist" type="System.SByte" />
98 <property name="ProfileBegin" type="System.UInt16" />
99 <property name="ProfileEnd" type="System.UInt16" />
100 <property name="ProfileCurve" type="System.Byte" />
101 <property name="ProfileHollow" type="System.UInt16" />
102 <property name="TextureEntry" column="Texture" type="System.Byte[]" />
103 <property name="ExtraParams" type="System.Byte[]" />
104 <property name="State" type="System.Byte" />
105 </component> 86 </component>
106 87
107 </class> 88 </class>
diff --git a/OpenSim/Data/NHibernate/TextureUserType.cs b/OpenSim/Data/NHibernate/TextureUserType.cs
index b688a16..dac7c75 100644
--- a/OpenSim/Data/NHibernate/TextureUserType.cs
+++ b/OpenSim/Data/NHibernate/TextureUserType.cs
@@ -49,16 +49,8 @@ namespace OpenSim.Data.NHibernate
49 49
50 public object DeepCopy(object texture) 50 public object DeepCopy(object texture)
51 { 51 {
52 if (texture == null) 52 byte[] bytes = ((LLObject.TextureEntry)texture).ToBytes();
53 { 53 return new LLObject.TextureEntry(bytes, 0, bytes.Length);
54 // TODO: should parametrize this texture out
55 return new LLObject.TextureEntry(new LLUUID("89556747-24cb-43ed-920b-47caed15465f"));
56 }
57 else
58 {
59 byte[] bytes = ((LLObject.TextureEntry)texture).ToBytes();
60 return new LLObject.TextureEntry(bytes, 0, bytes.Length);
61 }
62 } 54 }
63 55
64 public object Disassemble(object texture) 56 public object Disassemble(object texture)