19 #include <mtp/mtptypessimple.h> |
19 #include <mtp/mtptypessimple.h> |
20 |
20 |
21 #include "cmtpobjectstore.h" |
21 #include "cmtpobjectstore.h" |
22 #include "cmtpreferencemgr.h" |
22 #include "cmtpreferencemgr.h" |
23 #include "dbutility.h" |
23 #include "dbutility.h" |
|
24 #include "mtpdebug.h" |
|
25 #include "OstTraceDefinitions.h" |
|
26 #ifdef OST_TRACE_COMPILER_IN_USE |
|
27 #include "cmtpreferencemgrTraces.h" |
|
28 #endif |
|
29 |
24 |
30 |
25 |
31 |
26 _LIT(KSQLReferenceTableName, "ReferenceStore"); |
32 _LIT(KSQLReferenceTableName, "ReferenceStore"); |
27 _LIT(KSQLReferenceIndexName, "ReferenceIndex"); |
33 _LIT(KSQLReferenceIndexName, "ReferenceIndex"); |
28 _LIT(KSQLCreateReferenceTableText,"CREATE TABLE ReferenceStore (HandleId UNSIGNED INTEGER, References LONG VARBINARY)"); |
34 _LIT(KSQLCreateReferenceTableText,"CREATE TABLE ReferenceStore (HandleId UNSIGNED INTEGER, References LONG VARBINARY)"); |
178 Create the reference table in the database |
184 Create the reference table in the database |
179 @leave One of the system wide error codes, if a processing failure occurs. |
185 @leave One of the system wide error codes, if a processing failure occurs. |
180 */ |
186 */ |
181 void CMTPReferenceMgr::CreateTableL() |
187 void CMTPReferenceMgr::CreateTableL() |
182 { |
188 { |
183 User::LeaveIfError(iDatabase->Execute(KSQLCreateReferenceTableText)); |
189 LEAVEIFERROR(iDatabase->Execute(KSQLCreateReferenceTableText), |
|
190 OstTrace0( TRACE_ERROR, CMTPREFERENCEMGR_CREATETABLEL, "TABLE ReferenceStore create failed!" )); |
184 } |
191 } |
185 |
192 |
186 /** |
193 /** |
187 Create the index in the reference table |
194 Create the index in the reference table |
188 @leave One of the system wide error codes, if a processing failure occurs. |
195 @leave One of the system wide error codes, if a processing failure occurs. |
189 */ |
196 */ |
190 void CMTPReferenceMgr::CreateIndexL() |
197 void CMTPReferenceMgr::CreateIndexL() |
191 { |
198 { |
192 User::LeaveIfError(iDatabase->Execute(KSQLCreateReferenceIndexText)); |
199 LEAVEIFERROR(iDatabase->Execute(KSQLCreateReferenceIndexText), |
|
200 OstTrace0( TRACE_ERROR, CMTPREFERENCEMGR_CREATEINDEXL, "INDEX ReferenceIndex on ReferenceStore create failed!" )); |
193 } |
201 } |
194 |
202 |
195 /** |
203 /** |
196 Get reference on the object identified by aIdentifier |
204 Get reference on the object identified by aIdentifier |
197 @param aIdentifier The 64bit internal object identifier |
205 @param aIdentifier The 64bit internal object identifier |