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<bool> concave_filled_;
00064
00066
00073 void initFields()
00074 {
00075
00076 primary_key_field_ = &id_;
00077
00078 fields_.push_back(&model_);
00079 fields_.push_back(&maker_);
00080 fields_.push_back(&tags_);
00081 fields_.push_back(&source_);
00082 fields_.push_back(&description_);
00083 fields_.push_back(&barcode_);
00084 fields_.push_back(&acquisition_method_);
00085 fields_.push_back(&concave_filled_);
00086
00087
00088 id_.setSequenceName("unscaled_model_unscaled_model_id_seq");
00089 }
00090
00092
00097 void initPermissions()
00098 {
00099
00100
00101 setAllFieldsReadFromDatabase(false);
00102 setAllFieldsWriteToDatabase(false);
00103
00104
00105 id_.setReadFromDatabase(true);
00106
00107 tags_.setReadFromDatabase(true);
00108 barcode_.setReadFromDatabase(true);
00109
00110 model_.setReadWrite(true);
00111 maker_.setReadWrite(true);
00112 source_.setReadWrite(true);
00113 acquisition_method_.setReadWrite(true);
00114 }
00115
00117
00120 DatabaseOriginalModel() :
00121 id_(database_interface::DBFieldBase::TEXT, this, "original_model_id", "original_model", true),
00122 model_(database_interface::DBFieldBase::TEXT, this, "original_model_model" ,"original_model", true),
00123 maker_(database_interface::DBFieldBase::TEXT, this, "original_model_maker", "original_model", true),
00124 tags_(database_interface::DBFieldBase::TEXT, this, "original_model_tags", "original_model", true),
00125 source_(database_interface::DBFieldBase::TEXT, this, "original_model_source", "original_model", true),
00126 description_(database_interface::DBFieldBase::TEXT, this, "original_model_description", "original_model", true),
00127 barcode_(database_interface::DBFieldBase::TEXT, this, "original_model_barcode", "original_model", true),
00128 acquisition_method_(database_interface::DBFieldBase::TEXT, this, "acquisition_method_name", "original_model", true),
00129 concave_filled_(database_interface::DBFieldBase::TEXT, this, "original_model_concave_filled",
00130 "original_model", true)
00131 {
00132 initFields();
00133 initPermissions();
00134 }
00135
00137
00140 DatabaseOriginalModel(const DatabaseOriginalModel *other) :
00141 id_(this, &other->id_),
00142 model_(this, &other->model_),
00143 maker_(this, &other->maker_),
00144 tags_(this, &other->tags_),
00145 source_(this, &other->source_),
00146 description_(this, &other->description_),
00147 barcode_(this, &other->barcode_),
00148 acquisition_method_(this, &other->acquisition_method_),
00149 concave_filled_(this, &other->concave_filled_)
00150 {
00151 initFields();
00152
00153 }
00154 };
00155
00156 }
00157
00158 #endif