2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Bartosz Janiak (b.janiak@samsung.com)
20 * @brief Static definitions and function template specialziations of DPL-ORM.
23 #include <dpl/db/orm.h>
29 namespace RelationTypes {
30 const char Equal[] = "=";
31 const char LessThan[] = "<";
32 const char And[] = "AND";
33 const char Or[] = "OR";
34 const char Is[] = "IS";
35 const char In[] = "IN";
39 int GetColumnFromCommand<int>(ColumnIndex columnIndex,
42 return command->GetColumnInteger(columnIndex);
46 DPL::String GetColumnFromCommand<DPL::String>(ColumnIndex columnIndex,
49 return DPL::FromUTF8String(command->GetColumnString(columnIndex));
53 OptionalInteger GetColumnFromCommand<OptionalInteger>(ColumnIndex columnIndex,
56 return command->GetColumnOptionalInteger(columnIndex);
60 OptionalString GetColumnFromCommand<OptionalString>(ColumnIndex columnIndex,
63 return command->GetColumnOptionalString(columnIndex);
67 double GetColumnFromCommand<double>(ColumnIndex columnIndex,
70 return command->GetColumnDouble(columnIndex);
73 void DataCommandUtils::BindArgument(DataCommand *command,
77 command->BindInteger(index, argument);
80 void DataCommandUtils::BindArgument(DataCommand *command,
82 const OptionalInteger& argument)
84 command->BindInteger(index, argument);
87 void DataCommandUtils::BindArgument(DataCommand *command,
89 const DPL::String& argument)
91 command->BindString(index, argument);
94 void DataCommandUtils::BindArgument(DataCommand *command,
96 const OptionalString& argument)
98 command->BindString(index, argument);