diff options
Merge branch '0.6.9-post-fixes' into careminster
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteInventoryStore.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index 64591fd..9ce21b1 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs | |||
@@ -30,7 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Data; | 30 | using System.Data; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | 32 | using log4net; |
33 | using Mono.Data.SqliteClient; | 33 | using Mono.Data.Sqlite; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | 36 | ||
@@ -88,15 +88,17 @@ namespace OpenSim.Data.SQLite | |||
88 | invFoldersDa = new SqliteDataAdapter(foldersSelectCmd); | 88 | invFoldersDa = new SqliteDataAdapter(foldersSelectCmd); |
89 | 89 | ||
90 | ds = new DataSet(); | 90 | ds = new DataSet(); |
91 | 91 | ||
92 | ds.Tables.Add(createInventoryFoldersTable()); | 92 | ds.Tables.Add(createInventoryFoldersTable()); |
93 | invFoldersDa.Fill(ds.Tables["inventoryfolders"]); | 93 | invFoldersDa.Fill(ds.Tables["inventoryfolders"]); |
94 | setupFoldersCommands(invFoldersDa, conn); | 94 | setupFoldersCommands(invFoldersDa, conn); |
95 | CreateDataSetMapping(invFoldersDa, "inventoryfolders"); | ||
95 | m_log.Info("[INVENTORY DB]: Populated Inventory Folders Definitions"); | 96 | m_log.Info("[INVENTORY DB]: Populated Inventory Folders Definitions"); |
96 | 97 | ||
97 | ds.Tables.Add(createInventoryItemsTable()); | 98 | ds.Tables.Add(createInventoryItemsTable()); |
98 | invItemsDa.Fill(ds.Tables["inventoryitems"]); | 99 | invItemsDa.Fill(ds.Tables["inventoryitems"]); |
99 | setupItemsCommands(invItemsDa, conn); | 100 | setupItemsCommands(invItemsDa, conn); |
101 | CreateDataSetMapping(invItemsDa, "inventoryitems"); | ||
100 | m_log.Info("[INVENTORY DB]: Populated Inventory Items Definitions"); | 102 | m_log.Info("[INVENTORY DB]: Populated Inventory Items Definitions"); |
101 | 103 | ||
102 | ds.AcceptChanges(); | 104 | ds.AcceptChanges(); |
@@ -721,6 +723,15 @@ namespace OpenSim.Data.SQLite | |||
721 | * | 723 | * |
722 | **********************************************************************/ | 724 | **********************************************************************/ |
723 | 725 | ||
726 | protected void CreateDataSetMapping(IDataAdapter da, string tableName) | ||
727 | { | ||
728 | ITableMapping dbMapping = da.TableMappings.Add(tableName, tableName); | ||
729 | foreach (DataColumn col in ds.Tables[tableName].Columns) | ||
730 | { | ||
731 | dbMapping.ColumnMappings.Add(col.ColumnName, col.ColumnName); | ||
732 | } | ||
733 | } | ||
734 | |||
724 | /// <summary> | 735 | /// <summary> |
725 | /// Create the "inventoryitems" table | 736 | /// Create the "inventoryitems" table |
726 | /// </summary> | 737 | /// </summary> |