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>
30 namespace RelationTypes {
31 const char Equal[] = "=";
32 const char LessThan[] = "<";
33 const char And[] = "AND";
34 const char Or[] = "OR";
35 const char Is[] = "IS";
36 const char In[] = "IN";
40 int GetColumnFromCommand<int>(ColumnIndex columnIndex,
43 return command->GetColumnInteger(columnIndex);
47 DPL::String GetColumnFromCommand<DPL::String>(ColumnIndex columnIndex,
50 return DPL::FromUTF8String(command->GetColumnString(columnIndex));
54 OptionalInteger GetColumnFromCommand<OptionalInteger>(ColumnIndex columnIndex,
57 return command->GetColumnOptionalInteger(columnIndex);
61 OptionalString GetColumnFromCommand<OptionalString>(ColumnIndex columnIndex,
64 return command->GetColumnOptionalString(columnIndex);
68 double GetColumnFromCommand<double>(ColumnIndex columnIndex,
71 return command->GetColumnDouble(columnIndex);
74 void DataCommandUtils::BindArgument(DataCommand *command,
78 command->BindInteger(index, argument);
81 void DataCommandUtils::BindArgument(DataCommand *command,
83 const OptionalInteger& argument)
85 command->BindInteger(index, argument);
88 void DataCommandUtils::BindArgument(DataCommand *command,
90 const DPL::String& argument)
92 command->BindString(index, argument);
95 void DataCommandUtils::BindArgument(DataCommand *command,
97 const OptionalString& argument)
99 command->BindString(index, argument);