aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSean Dague2008-04-09 02:08:07 +0000
committerSean Dague2008-04-09 02:08:07 +0000
commitea16221c1b7d7879f5d33c53bdd209803b90ed0d (patch)
treef6c1340fb9438eeb8e7868a20cb8d6ae650c699c /OpenSim
parentfixing attributes (diff)
downloadopensim-SC-ea16221c1b7d7879f5d33c53bdd209803b90ed0d.zip
opensim-SC-ea16221c1b7d7879f5d33c53bdd209803b90ed0d.tar.gz
opensim-SC-ea16221c1b7d7879f5d33c53bdd209803b90ed0d.tar.bz2
opensim-SC-ea16221c1b7d7879f5d33c53bdd209803b90ed0d.tar.xz
NHibernate Inventory getting close, except for some of the
complex folder queries.
Diffstat (limited to 'OpenSim')
-rwxr-xr-xOpenSim/Data/NHibernate/Migration/SqliteInventory.pl8
-rw-r--r--OpenSim/Data/NHibernate/NHibernateInventoryData.cs2
-rw-r--r--OpenSim/Data/NHibernate/Resources/InventoryFolderBase.hbm.xml6
-rw-r--r--OpenSim/Data/NHibernate/Resources/InventoryItemBase.hbm.xml4
4 files changed, 12 insertions, 8 deletions
diff --git a/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl b/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl
index d8698f4..c59cbce 100755
--- a/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl
+++ b/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl
@@ -25,15 +25,19 @@ my $items = "INSERT INTO InventoryItems(ID, AssetID, AssetType, InvType, Folder,
25my $folders = "INSERT INTO InventoryFolders(ID, Name, Owner, ParentID, Type, Version) "; 25my $folders = "INSERT INTO InventoryFolders(ID, Name, Owner, ParentID, Type, Version) ";
26 26
27open(SQLITE, "sqlite3 inventoryStore.db .dump |") or die "can't open the database for migration"; 27open(SQLITE, "sqlite3 inventoryStore.db .dump |") or die "can't open the database for migration";
28open(WRITE,"| sqlite3 Inventory.db");
28 29
29while(my $line = <SQLITE>) { 30while(my $line = <SQLITE>) {
30 $line =~ s/([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})/$1-$2-$3-$4-$5/g; 31 $line =~ s/([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})/$1-$2-$3-$4-$5/g;
31 if($line =~ s/(INSERT INTO "inventoryitems")/$items/) { 32 if($line =~ s/(INSERT INTO "inventoryitems")/$items/) {
32 print $line; 33 print $line;
34 print WRITE $line;
33 } 35 }
34 if($line =~ s/(INSERT INTO "inventoryfolders")/$folders/) { 36 if($line =~ s/(INSERT INTO "inventoryfolders")/$folders/) {
35 print $line; 37 print $line;
36 } 38 print WRITE $line;
37 39 }
38} 40}
39 41
42close(WRITE);
43close(SQLITE);
diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
index 9e35b76..8bc41c9 100644
--- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Data.NHibernate
77 HbmSerializer.Default.Serialize(System.Reflection.Assembly.GetExecutingAssembly())) 77 HbmSerializer.Default.Serialize(System.Reflection.Assembly.GetExecutingAssembly()))
78 cfg.AddInputStream(stream); 78 cfg.AddInputStream(stream);
79 79
80 new SchemaExport(cfg).Create(true, true); 80 // new SchemaExport(cfg).Create(true, true);
81 81
82 factory = cfg.BuildSessionFactory(); 82 factory = cfg.BuildSessionFactory();
83 } 83 }
diff --git a/OpenSim/Data/NHibernate/Resources/InventoryFolderBase.hbm.xml b/OpenSim/Data/NHibernate/Resources/InventoryFolderBase.hbm.xml
index d24d312..4de0b7c 100644
--- a/OpenSim/Data/NHibernate/Resources/InventoryFolderBase.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/InventoryFolderBase.hbm.xml
@@ -1,13 +1,13 @@
1<?xml version="1.0" encoding="utf-8" ?> 1<?xml version="1.0" encoding="utf-8" ?>
2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 2<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
3 <class name="OpenSim.Framework.InventoryFolderBase, OpenSim.Framework" table="InventoryItems" lazy="false"> 3 <class name="OpenSim.Framework.InventoryFolderBase, OpenSim.Framework" table="InventoryFolders" lazy="false">
4 <id name="ID" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate"> 4 <id name="ID" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate">
5 <generator class="assigned" /> 5 <generator class="assigned" />
6 </id> 6 </id>
7 <property name="Type" type="short" /> 7 <property name="Type" type="short" />
8 <property name="Version" type="short" /> 8 <property name="Version" type="short" />
9 <property name="ParentID" index="parent_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" /> 9 <property name="ParentID" index="folder_parent_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" />
10 <property name="Owner" index="owner_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" /> 10 <property name="Owner" index="folder_owner_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" />
11 <property name="Name" type="String" length="64" /> 11 <property name="Name" type="String" length="64" />
12 </class> 12 </class>
13</hibernate-mapping> \ No newline at end of file 13</hibernate-mapping> \ No newline at end of file
diff --git a/OpenSim/Data/NHibernate/Resources/InventoryItemBase.hbm.xml b/OpenSim/Data/NHibernate/Resources/InventoryItemBase.hbm.xml
index 8a0fb69..c4e9b01 100644
--- a/OpenSim/Data/NHibernate/Resources/InventoryItemBase.hbm.xml
+++ b/OpenSim/Data/NHibernate/Resources/InventoryItemBase.hbm.xml
@@ -7,8 +7,8 @@
7 <property name="InvType" type="int" /> 7 <property name="InvType" type="int" />
8 <property name="AssetType" type="int" /> 8 <property name="AssetType" type="int" />
9 <property name="AssetID" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" /> 9 <property name="AssetID" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" />
10 <property name="Folder" index="folder_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" /> 10 <property name="Folder" index="item_folder_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" />
11 <property name="Owner" index="owner_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" /> 11 <property name="Owner" index="item_owner_id" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" />
12 <property name="Creator" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" /> 12 <property name="Creator" type="OpenSim.Data.NHibernate.LLUUIDString, OpenSim.Data.NHibernate" />
13 <property name="Name" type="String" length="64" /> 13 <property name="Name" type="String" length="64" />
14 <property name="Description" type="String" length="64" /> 14 <property name="Description" type="String" length="64" />