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";
38 int GetColumnFromCommand<int>(ColumnIndex columnIndex,
41 return command->GetColumnInteger(columnIndex);
45 DPL::String GetColumnFromCommand<DPL::String>(ColumnIndex columnIndex,
48 return DPL::FromUTF8String(command->GetColumnString(columnIndex));
52 OptionalInteger GetColumnFromCommand<OptionalInteger>(ColumnIndex columnIndex,
55 return command->GetColumnOptionalInteger(columnIndex);
59 OptionalString GetColumnFromCommand<OptionalString>(ColumnIndex columnIndex,
62 return command->GetColumnOptionalString(columnIndex);
66 double GetColumnFromCommand<double>(ColumnIndex columnIndex,
69 return command->GetColumnDouble(columnIndex);
72 void DataCommandUtils::BindArgument(DataCommand *command,
76 command->BindInteger(index, argument);
79 void DataCommandUtils::BindArgument(DataCommand *command,
81 const OptionalInteger& argument)
83 command->BindInteger(index, argument);
86 void DataCommandUtils::BindArgument(DataCommand *command,
88 const DPL::String& argument)
90 command->BindString(index, argument);
93 void DataCommandUtils::BindArgument(DataCommand *command,
95 const OptionalString& argument)
97 command->BindString(index, argument);