00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _DATABASE_ORIGINAL_MODEL_H_
00038 #define _DATABASE_ORIGINAL_MODEL_H_
00039
00040 #include <database_interface/db_class.h>
00041
00042 namespace household_objects_database {
00043
00045
00048 class DatabaseOriginalModel : public database_interface::DBClass
00049 {
00050 private:
00051
00052 public:
00053
00054 database_interface::DBField<int> id_;
00055
00056 database_interface::DBField<std::string> model_;
00057 database_interface::DBField<std::string> maker_;
00058 database_interface::DBField< std::vector<std::string> > tags_;
00059 database_interface::DBField<std::string> source_;
00060 database_interface::DBField<std::string> description_;
00061 database_interface::DBField<std::string> barcode_;
00062 database_interface::DBField<std::string> acquisition_method_;
00063 database_interface::DBField<std::string> recognition_id_;
00064 database_interface::DBField<bool> concave_filled_;
00065
00067
00074 void initFields()
00075 {
00076
00077 primary_key_field_ = &id_;
00078
00079 fields_.push_back(&model_);
00080 fields_.push_back(&maker_);
00081 fields_.push_back(&tags_);
00082 fields_.push_back(&source_);
00083 fields_.push_back(&description_);
00084 fields_.push_back(&barcode_);
00085 fields_.push_back(&acquisition_method_);
00086 fields_.push_back(&recognition_id_);
00087 fields_.push_back(&concave_filled_);
00088
00089
00090 id_.setSequenceName("unscaled_model_unscaled_model_id_seq");
00091 }
00092
00094
00099 void initPermissions()
00100 {
00101
00102
00103 setAllFieldsReadFromDatabase(false);
00104 setAllFieldsWriteToDatabase(false);
00105
00106
00107 id_.setReadFromDatabase(true);
00108
00109 tags_.setReadFromDatabase(true);
00110 barcode_.setReadFromDatabase(true);
00111
00112 model_.setReadWrite(true);
00113 maker_.setReadWrite(true);
00114 source_.setReadWrite(true);
00115 acquisition_method_.setReadWrite(true);
00116 }
00117
00119
00122 DatabaseOriginalModel() :
00123 id_(database_interface::DBFieldBase::TEXT, this, "original_model_id", "original_model", true),
00124 model_(database_interface::DBFieldBase::TEXT, this, "original_model_model" ,"original_model", true),
00125 maker_(database_interface::DBFieldBase::TEXT, this, "original_model_maker", "original_model", true),
00126 tags_(database_interface::DBFieldBase::TEXT, this, "original_model_tags", "original_model", true),
00127 source_(database_interface::DBFieldBase::TEXT, this, "original_model_source", "original_model", true),
00128 description_(database_interface::DBFieldBase::TEXT, this, "original_model_description", "original_model", true),
00129 barcode_(database_interface::DBFieldBase::TEXT, this, "original_model_barcode", "original_model", true),
00130 acquisition_method_(database_interface::DBFieldBase::TEXT, this, "acquisition_method_name", "original_model", true),
00131 recognition_id_(database_interface::DBFieldBase::TEXT, this, "original_model_recognition_id",
00132 "original_model", true),
00133 concave_filled_(database_interface::DBFieldBase::TEXT, this, "original_model_concave_filled",
00134 "original_model", true)
00135 {
00136 initFields();
00137 initPermissions();
00138 }
00139
00141
00144 DatabaseOriginalModel(const DatabaseOriginalModel *other) :
00145 id_(this, &other->id_),
00146 model_(this, &other->model_),
00147 maker_(this, &other->maker_),
00148 tags_(this, &other->tags_),
00149 source_(this, &other->source_),
00150 description_(this, &other->description_),
00151 barcode_(this, &other->barcode_),
00152 acquisition_method_(this, &other->acquisition_method_),
00153 recognition_id_(this, &other->recognition_id_),
00154 concave_filled_(this, &other->concave_filled_)
00155 {
00156 initFields();
00157
00158 }
00159 };
00160
00161 }
00162
00163 #endif