| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <!-- |
|---|
| 3 | Copyright (c) 2006 Harri Kaimio |
|---|
| 4 | |
|---|
| 5 | This file is part of Photovault. |
|---|
| 6 | |
|---|
| 7 | Photovault is free software; you can redistribute it and/or modify it |
|---|
| 8 | under the terms of the GNU General Public License as published by |
|---|
| 9 | the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | (at your option) any later version. |
|---|
| 11 | |
|---|
| 12 | Photovault is distributed in the hope that it will be useful, but |
|---|
| 13 | WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | General Public License for more details. |
|---|
| 16 | |
|---|
| 17 | You should have received a copy of the GNU General Public License |
|---|
| 18 | along with Foobar; if not, write to the Free Software Foundation, |
|---|
| 19 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|---|
| 20 | --> |
|---|
| 21 | |
|---|
| 22 | <!-- This is a sample metadata repository for the ObJectBridge System. |
|---|
| 23 | Use this file as a template for building your own mappings--> |
|---|
| 24 | |
|---|
| 25 | <!-- defining entities for include-files --> |
|---|
| 26 | <!DOCTYPE descriptor-repository SYSTEM "repository.dtd" [ |
|---|
| 27 | <!ENTITY database SYSTEM "repository_database.xml"> |
|---|
| 28 | <!ENTITY internal SYSTEM "repository_internal.xml"> |
|---|
| 29 | ]> |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | <descriptor-repository version="1.0" isolation-level="read-uncommitted"> |
|---|
| 33 | |
|---|
| 34 | <!-- include all used database connections --> |
|---|
| 35 | &database; |
|---|
| 36 | |
|---|
| 37 | <!-- include ojb internal mappings here --> |
|---|
| 38 | &internal; |
|---|
| 39 | |
|---|
| 40 | <!-- include user defined mappings here --> |
|---|
| 41 | |
|---|
| 42 | <!-- PhotoFolder mappings --> |
|---|
| 43 | |
|---|
| 44 | <class-descriptor class="org.photovault.folder.PhotoFolder" table="photo_collections"> |
|---|
| 45 | |
|---|
| 46 | <!-- one of (field-descriptor extent-class) --> |
|---|
| 47 | <field-descriptor name="folderId" column="collection_id" jdbc-type="INTEGER" primarykey="true" autoincrement="true"> |
|---|
| 48 | </field-descriptor> |
|---|
| 49 | <field-descriptor name="uuid" column="collection_uuid" jdbc-type="VARCHAR" |
|---|
| 50 | conversion="org.photovault.imginfo.String2UUIDConversion"> |
|---|
| 51 | </field-descriptor> |
|---|
| 52 | <field-descriptor name="name" column="collection_name" jdbc-type="VARCHAR"> |
|---|
| 53 | </field-descriptor> |
|---|
| 54 | <field-descriptor name="description" column="COLLECTION_DESC" jdbc-type="VARCHAR"> |
|---|
| 55 | </field-descriptor> |
|---|
| 56 | <field-descriptor name="parentId" column="parent" jdbc-type="INTEGER"> |
|---|
| 57 | </field-descriptor> |
|---|
| 58 | <reference-descriptor name="parent" class-ref="org.photovault.folder.PhotoFolder"> |
|---|
| 59 | <documentation>Parent of this folder</documentation> |
|---|
| 60 | <foreignkey field-ref="parentId"> |
|---|
| 61 | </foreignkey> |
|---|
| 62 | </reference-descriptor> |
|---|
| 63 | <collection-descriptor name="subfolders" |
|---|
| 64 | element-class-ref="org.photovault.folder.PhotoFolder" |
|---|
| 65 | orderby="name" |
|---|
| 66 | sort="ASC" |
|---|
| 67 | auto-retrieve="true" |
|---|
| 68 | auto-update="none" |
|---|
| 69 | auto-delete="none" |
|---|
| 70 | proxy="true"> |
|---|
| 71 | <inverse-foreignkey field-ref="parentId"> |
|---|
| 72 | </inverse-foreignkey> |
|---|
| 73 | </collection-descriptor> |
|---|
| 74 | <collection-descriptor name="photos" |
|---|
| 75 | element-class-ref="org.photovault.imginfo.PhotoInfo" |
|---|
| 76 | collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList" |
|---|
| 77 | indirection-table="collection_photos" |
|---|
| 78 | auto-retrieve="true" |
|---|
| 79 | auto-update="none" |
|---|
| 80 | auto-delete="none" |
|---|
| 81 | proxy="true"> |
|---|
| 82 | <fk-pointing-to-this-class column="collection_id"> |
|---|
| 83 | </fk-pointing-to-this-class> |
|---|
| 84 | <fk-pointing-to-element-class column="photo_id"> |
|---|
| 85 | </fk-pointing-to-element-class> |
|---|
| 86 | </collection-descriptor> |
|---|
| 87 | </class-descriptor> |
|---|
| 88 | |
|---|
| 89 | <!-- ImageInstance mappings --> |
|---|
| 90 | <class-descriptor class="org.photovault.imginfo.ImageInstance" table="image_instances" row-reader="org.photovault.imginfo.ImageInstanceRowReader"> |
|---|
| 91 | <field-descriptor name="volumeId" column="volume_id" jdbc-type="VARCHAR" primarykey="true" nullable="false"> |
|---|
| 92 | <documentation></documentation> |
|---|
| 93 | </field-descriptor> |
|---|
| 94 | <field-descriptor name="uuid" column="instance_uuid" jdbc-type="VARCHAR" |
|---|
| 95 | conversion="org.photovault.imginfo.String2UUIDConversion"> |
|---|
| 96 | </field-descriptor> |
|---|
| 97 | <field-descriptor name="fname" column="fname" jdbc-type="VARCHAR" primarykey="true" nullable="false"> |
|---|
| 98 | </field-descriptor> |
|---|
| 99 | <field-descriptor name="photoUid" column="photo_id" jdbc-type="INTEGER"> |
|---|
| 100 | </field-descriptor> |
|---|
| 101 | <field-descriptor name="instanceType" column="instance_type" jdbc-type="VARCHAR" conversion="org.photovault.imginfo.OJBInstanceTypeConversion"> |
|---|
| 102 | </field-descriptor> |
|---|
| 103 | <field-descriptor name="width" column="width" jdbc-type="INTEGER"> |
|---|
| 104 | </field-descriptor> |
|---|
| 105 | <field-descriptor name="height" column="height" jdbc-type="INTEGER"> |
|---|
| 106 | </field-descriptor> |
|---|
| 107 | <field-descriptor name="rotated" column="rotated" jdbc-type="FLOAT"> |
|---|
| 108 | </field-descriptor> |
|---|
| 109 | <field-descriptor name="cropMinX" column="crop_xmin" jdbc-type="FLOAT"> |
|---|
| 110 | </field-descriptor> |
|---|
| 111 | <field-descriptor name="cropMaxX" column="crop_xmax" jdbc-type="FLOAT"> |
|---|
| 112 | </field-descriptor> |
|---|
| 113 | <field-descriptor name="cropMinY" column="crop_ymin" jdbc-type="FLOAT"> |
|---|
| 114 | </field-descriptor> |
|---|
| 115 | <field-descriptor name="cropMaxY" column="crop_ymax" jdbc-type="FLOAT"> |
|---|
| 116 | </field-descriptor> |
|---|
| 117 | <field-descriptor name="hash" column="hash" jdbc-type="VARBINARY"> |
|---|
| 118 | </field-descriptor> |
|---|
| 119 | <field-descriptor name="fileSize" column="file_size" jdbc-type="BIGINT"> |
|---|
| 120 | </field-descriptor> |
|---|
| 121 | <field-descriptor name="mtime" column="mtime" jdbc-type="BIGINT"> |
|---|
| 122 | </field-descriptor> |
|---|
| 123 | <field-descriptor name="checkTime" column="check_time" jdbc-type="TIMESTAMP" |
|---|
| 124 | conversion="org.photovault.imginfo.Timestamp2DateConversion"> |
|---|
| 125 | </field-descriptor> |
|---|
| 126 | <field-descriptor name="rawSettingsId" column="rawconv_id" jdbc-type="INTEGER"> |
|---|
| 127 | </field-descriptor> |
|---|
| 128 | <reference-descriptor name="rawSettings" class-ref="org.photovault.dcraw.RawConversionSettings"> |
|---|
| 129 | <documentation>Raw conversion settings for this photo</documentation> |
|---|
| 130 | <foreignkey field-ref="rawSettingsId"> |
|---|
| 131 | </foreignkey> |
|---|
| 132 | </reference-descriptor> |
|---|
| 133 | <field-descriptor name="channelMap" column="channel_map" jdbc-type="LONGVARBINARY" |
|---|
| 134 | conversion="org.photovault.image.ChannelMapOJBConversion"> |
|---|
| 135 | </field-descriptor> |
|---|
| 136 | </class-descriptor> |
|---|
| 137 | |
|---|
| 138 | <!-- PhotoInfo mappings --> |
|---|
| 139 | <class-descriptor class="org.photovault.imginfo.PhotoInfo" table="photos"> |
|---|
| 140 | <field-descriptor name="uid" column="photo_id" jdbc-type="INTEGER" primarykey="true" autoincrement="true"> |
|---|
| 141 | </field-descriptor> |
|---|
| 142 | <field-descriptor name="uuid" column="photo_uuid" jdbc-type="VARCHAR" |
|---|
| 143 | conversion="org.photovault.imginfo.String2UUIDConversion"> |
|---|
| 144 | </field-descriptor> |
|---|
| 145 | <field-descriptor name="shootingPlace" column="shooting_place" jdbc-type="VARCHAR"> |
|---|
| 146 | </field-descriptor> |
|---|
| 147 | <field-descriptor name="photographer" column="photographer" jdbc-type="VARCHAR"> |
|---|
| 148 | </field-descriptor> |
|---|
| 149 | <field-descriptor name="FStop" column="f_stop" jdbc-type="FLOAT"> |
|---|
| 150 | </field-descriptor> |
|---|
| 151 | <field-descriptor name="focalLength" column="focal_length" jdbc-type="FLOAT"> |
|---|
| 152 | </field-descriptor> |
|---|
| 153 | <field-descriptor name="shootTime" column="shoot_time" jdbc-type="TIMESTAMP" conversion="org.photovault.imginfo.Timestamp2DateConversion"> |
|---|
| 154 | </field-descriptor> |
|---|
| 155 | <field-descriptor name="timeAccuracy" column="time_accuracy" jdbc-type="DOUBLE"> |
|---|
| 156 | </field-descriptor> |
|---|
| 157 | <field-descriptor name="shutterSpeed" column="shutter_speed" jdbc-type="DOUBLE"> |
|---|
| 158 | </field-descriptor> |
|---|
| 159 | <field-descriptor name="camera" column="camera" jdbc-type="VARCHAR"> |
|---|
| 160 | </field-descriptor> |
|---|
| 161 | <field-descriptor name="lens" column="lens" jdbc-type="VARCHAR" length="30"> |
|---|
| 162 | </field-descriptor> |
|---|
| 163 | <field-descriptor name="film" column="film" jdbc-type="VARCHAR"> |
|---|
| 164 | </field-descriptor> |
|---|
| 165 | <field-descriptor name="filmSpeed" column="film_speed" jdbc-type="INTEGER"> |
|---|
| 166 | </field-descriptor> |
|---|
| 167 | <field-descriptor name="prefRotation" column="pref_rotation" jdbc-type="DOUBLE"> |
|---|
| 168 | </field-descriptor> |
|---|
| 169 | <field-descriptor name="cropMinX" column="clip_xmin" jdbc-type="FLOAT"> |
|---|
| 170 | </field-descriptor> |
|---|
| 171 | <field-descriptor name="cropMaxX" column="clip_xmax" jdbc-type="FLOAT"> |
|---|
| 172 | </field-descriptor> |
|---|
| 173 | <field-descriptor name="cropMinY" column="clip_ymin" jdbc-type="FLOAT"> |
|---|
| 174 | </field-descriptor> |
|---|
| 175 | <field-descriptor name="cropMaxY" column="clip_ymax" jdbc-type="FLOAT"> |
|---|
| 176 | </field-descriptor> |
|---|
| 177 | <field-descriptor name="description" column="description" jdbc-type="VARCHAR"> |
|---|
| 178 | </field-descriptor> |
|---|
| 179 | <field-descriptor name="techNotes" column="tech_notes" jdbc-type="VARCHAR"> |
|---|
| 180 | </field-descriptor> |
|---|
| 181 | <field-descriptor name="quality" column="photo_quality" jdbc-type="INTEGER"> |
|---|
| 182 | </field-descriptor> |
|---|
| 183 | <field-descriptor name="lastModified" column="last_modified" jdbc-type="TIMESTAMP" conversion="org.photovault.imginfo.Timestamp2DateConversion"> |
|---|
| 184 | </field-descriptor> |
|---|
| 185 | <field-descriptor name="origFname" column="orig_fname" jdbc-type="VARCHAR"> |
|---|
| 186 | </field-descriptor> |
|---|
| 187 | <field-descriptor name="origInstanceHash" column="hash" jdbc-type="VARBINARY"> |
|---|
| 188 | </field-descriptor> |
|---|
| 189 | <field-descriptor name="rawSettingsId" column="rawconv_id" jdbc-type="INTEGER"> |
|---|
| 190 | </field-descriptor> |
|---|
| 191 | <reference-descriptor name="rawSettings" class-ref="org.photovault.dcraw.RawConversionSettings"> |
|---|
| 192 | <documentation>Raw conversion settings for this photo</documentation> |
|---|
| 193 | <foreignkey field-ref="rawSettingsId"> |
|---|
| 194 | </foreignkey> |
|---|
| 195 | </reference-descriptor> |
|---|
| 196 | <field-descriptor name="channelMap" column="channel_map" jdbc-type="LONGVARBINARY" |
|---|
| 197 | conversion="org.photovault.image.ChannelMapOJBConversion"> |
|---|
| 198 | </field-descriptor> |
|---|
| 199 | |
|---|
| 200 | <!-- instances collection |
|---|
| 201 | Instances are aggregates of PhotoInfo object so we can use the default |
|---|
| 202 | collection implementation which deleted objects that are deleted from the |
|---|
| 203 | collection |
|---|
| 204 | --> |
|---|
| 205 | <collection-descriptor name="instances" |
|---|
| 206 | element-class-ref="org.photovault.imginfo.ImageInstance" |
|---|
| 207 | auto-retrieve="true" |
|---|
| 208 | auto-update="none" |
|---|
| 209 | auto-delete="none"> |
|---|
| 210 | <inverse-foreignkey field-ref="photoUid"> |
|---|
| 211 | </inverse-foreignkey> |
|---|
| 212 | </collection-descriptor> |
|---|
| 213 | <!-- folders collection |
|---|
| 214 | This is an m:n mappin so we will use manageable collections. |
|---|
| 215 | --> |
|---|
| 216 | <collection-descriptor name="folders" |
|---|
| 217 | element-class-ref="org.photovault.folder.PhotoFolder" |
|---|
| 218 | indirection-table="collection_photos" |
|---|
| 219 | collection-class="org.apache.ojb.broker.util.collections.ManageableArrayList" |
|---|
| 220 | auto-retrieve="true" |
|---|
| 221 | auto-update="none" |
|---|
| 222 | auto-delete="none" |
|---|
| 223 | proxy="true"> |
|---|
| 224 | <fk-pointing-to-this-class column="photo_id"/> |
|---|
| 225 | <fk-pointing-to-element-class column="collection_id"/> |
|---|
| 226 | </collection-descriptor> |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | </class-descriptor> |
|---|
| 230 | |
|---|
| 231 | <class-descriptor class="org.photovault.dcraw.RawConversionSettings" |
|---|
| 232 | table="dcraw_settings"> |
|---|
| 233 | <field-descriptor name="rawSettingId" column="rawconv_id" primarykey="true" |
|---|
| 234 | jdbc-type="INTEGER" autoincrement="true"/> |
|---|
| 235 | <field-descriptor name="white" column="whitepoint" jdbc-type="INTEGER"/> |
|---|
| 236 | <field-descriptor name="black" column="blackpoint" jdbc-type="INTEGER"/> |
|---|
| 237 | <field-descriptor name="evCorr" column="ev_corr" jdbc-type="FLOAT"/> |
|---|
| 238 | <field-descriptor name="hlightComp" column="hlight_corr" jdbc-type="FLOAT"/> |
|---|
| 239 | <field-descriptor name="useEmbeddedICCProfile" column="embedded_profile" jdbc-type="BIT"/> |
|---|
| 240 | <field-descriptor name="whiteBalanceType" column="wb_type" jdbc-type="INTEGER"/> |
|---|
| 241 | <field-descriptor name="redGreenRatio" column="r_g_ratio" jdbc-type="FLOAT"/> |
|---|
| 242 | <field-descriptor name="blueGreenRatio" column="b_g_ratio" jdbc-type="FLOAT"/> |
|---|
| 243 | <field-descriptor name="daylightRedGreenRatio" column="dl_r_g_ratio" jdbc-type="FLOAT"/> |
|---|
| 244 | <field-descriptor name="daylightBlueGreenRatio" column="dl_b_g_ratio" jdbc-type="FLOAT"/> |
|---|
| 245 | <field-descriptor name="colorProfileId" column="profile_id" jdbc-type="INTEGER"/> |
|---|
| 246 | <reference-descriptor name="colorProfile" class-ref="org.photovault.dcraw.ColorProfileDesc"> |
|---|
| 247 | <documentation>ICC profile used for raw conversion</documentation> |
|---|
| 248 | <foreignkey field-ref="colorProfileId"> |
|---|
| 249 | </foreignkey> |
|---|
| 250 | </reference-descriptor> |
|---|
| 251 | </class-descriptor> |
|---|
| 252 | |
|---|
| 253 | <class-descriptor class="org.photovault.dcraw.ColorProfileDesc" table="icc_profiles"> |
|---|
| 254 | <field-descriptor name="id" column="profile_id" primarykey="true" |
|---|
| 255 | jdbc-type="INTEGER" autoincrement="true"/> |
|---|
| 256 | <field-descriptor name="name" column="profile_name" jdbc-type="VARCHAR"/> |
|---|
| 257 | <field-descriptor name="description" column="profile_desc" jdbc-type="VARCHAR"/> |
|---|
| 258 | <field-descriptor name="hash" column="hash" jdbc-type="VARBINARY"/> |
|---|
| 259 | <collection-descriptor name="instances" |
|---|
| 260 | element-class-ref="org.photovault.dcraw.ColorProfileInstance" |
|---|
| 261 | auto-retrieve="true" |
|---|
| 262 | auto-update="none" |
|---|
| 263 | auto-delete="none"> |
|---|
| 264 | <inverse-foreignkey field-ref="profileId"/> |
|---|
| 265 | </collection-descriptor> |
|---|
| 266 | </class-descriptor> |
|---|
| 267 | |
|---|
| 268 | <class-descriptor class="org.photovault.dcraw.ColorProfileInstance" table="icc_instances"> |
|---|
| 269 | <field-descriptor name="profileId" column="profile_id" primarykey="true" jdbc-type="INTEGER"/> |
|---|
| 270 | <field-descriptor name="volumeId" column="volume_id" primarykey="true" jdbc-type="VARCHAR"/> |
|---|
| 271 | <field-descriptor name="fname" column="fname" jdbc-type="VARCHAR"/> |
|---|
| 272 | </class-descriptor> |
|---|
| 273 | |
|---|
| 274 | <class-descriptor class="org.photovault.common.DbInfo" table="database_info"> |
|---|
| 275 | <field-descriptor name="id" column="database_id" primarykey="true" jdbc-type="VARCHAR"/> |
|---|
| 276 | <field-descriptor name="createTime" column="create_time" |
|---|
| 277 | jdbc-type="TIMESTAMP" |
|---|
| 278 | conversion="org.photovault.imginfo.Timestamp2DateConversion"/> |
|---|
| 279 | <field-descriptor name="version" column="schema_version" jdbc-type="INTEGER"/> |
|---|
| 280 | </class-descriptor> |
|---|
| 281 | </descriptor-repository> |
|---|