| 1 |
<?xml version="1.0"?> |
|---|
| 2 |
<!DOCTYPE hibernate-mapping PUBLIC |
|---|
| 3 |
"-//Hibernate/Hibernate Mapping DTD//EN" |
|---|
| 4 |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
|---|
| 5 |
|
|---|
| 6 |
<!-- =================================================================== |
|---|
| 7 |
An Event Annotation in Bedework. |
|---|
| 8 |
This refers to another event (possibly also an annotation) and holds |
|---|
| 9 |
changes to that event. |
|---|
| 10 |
|
|---|
| 11 |
This definition differs from The event definition only in that all |
|---|
| 12 |
fields (except the index and sequence) may be null and the event does |
|---|
| 13 |
not have a reference to another event. |
|---|
| 14 |
=================================================================== --> |
|---|
| 15 |
|
|---|
| 16 |
<hibernate-mapping> |
|---|
| 17 |
<class name="org.bedework.calfacade.BwEventAnnotation" |
|---|
| 18 |
table="eventAnnotations"> |
|---|
| 19 |
<id name="id" type="integer" column="eventid" unsaved-value="-1"> |
|---|
| 20 |
<generator class="native"/> |
|---|
| 21 |
</id> |
|---|
| 22 |
|
|---|
| 23 |
<version name="seq" column="seq" type="integer" /> |
|---|
| 24 |
|
|---|
| 25 |
<many-to-one name="creator" |
|---|
| 26 |
class="org.bedework.calfacade.BwUser" > |
|---|
| 27 |
<column name="creatorid" index="idx_eventann_creator" /> |
|---|
| 28 |
</many-to-one> |
|---|
| 29 |
|
|---|
| 30 |
<many-to-one name="owner" |
|---|
| 31 |
class="org.bedework.calfacade.BwUser" |
|---|
| 32 |
unique="true"> |
|---|
| 33 |
<column name="ownerid" |
|---|
| 34 |
index="sidx_eventann_owner" /> |
|---|
| 35 |
</many-to-one> |
|---|
| 36 |
|
|---|
| 37 |
<property name="access" column="access" type="text" /> |
|---|
| 38 |
|
|---|
| 39 |
<property name="publick" type="true_false" > |
|---|
| 40 |
<column name="publick" /> |
|---|
| 41 |
</property> |
|---|
| 42 |
|
|---|
| 43 |
<component name="dtstart" |
|---|
| 44 |
class="org.bedework.calfacade.BwDateTime" > |
|---|
| 45 |
<property name="dateType" column="start_date_type" type="true_false" |
|---|
| 46 |
/> |
|---|
| 47 |
<property name="tzid" column="start_tzid" type="string" /> |
|---|
| 48 |
<property name="dtval" column="start_dtval" type="string" |
|---|
| 49 |
/> |
|---|
| 50 |
<property name="date" column="start_date" type="string" |
|---|
| 51 |
index="idx_eventann_start" /> |
|---|
| 52 |
</component> |
|---|
| 53 |
|
|---|
| 54 |
<!-- All day events and events which end when they start have no |
|---|
| 55 |
end date/time --> |
|---|
| 56 |
<component name="dtend" |
|---|
| 57 |
class="org.bedework.calfacade.BwDateTime" > |
|---|
| 58 |
<property name="dateType" column="end_date_type" type="true_false" /> |
|---|
| 59 |
<property name="tzid" column="end_tzid" type="string" /> |
|---|
| 60 |
<property name="dtval" column="end_dtval" type="string" /> |
|---|
| 61 |
<property name="date" column="end_date" type="string" |
|---|
| 62 |
index="idx_eventann_end" /> |
|---|
| 63 |
</component> |
|---|
| 64 |
|
|---|
| 65 |
<property name="duration" column="duration" type="string" /> |
|---|
| 66 |
|
|---|
| 67 |
<property name="endType" column="end_type" type="char" |
|---|
| 68 |
/> |
|---|
| 69 |
|
|---|
| 70 |
<property name="deleted" type="true_false"> |
|---|
| 71 |
<column name="deleted" |
|---|
| 72 |
index="idx_eventann_deleted" /> |
|---|
| 73 |
</property> |
|---|
| 74 |
|
|---|
| 75 |
<property name="summary" type="string" > |
|---|
| 76 |
<column name="summary" /> |
|---|
| 77 |
</property> |
|---|
| 78 |
<property name="description" column="description" type="text"/> |
|---|
| 79 |
|
|---|
| 80 |
<property name="link" column="link" type="string" /> |
|---|
| 81 |
|
|---|
| 82 |
<property name="status" type="string" /> |
|---|
| 83 |
|
|---|
| 84 |
<property name="cost" column="cost" type="string"/> |
|---|
| 85 |
|
|---|
| 86 |
<many-to-one name="organizer" |
|---|
| 87 |
class="org.bedework.calfacade.BwOrganizer" |
|---|
| 88 |
column="organizerid" |
|---|
| 89 |
cascade="all,delete-orphan" |
|---|
| 90 |
unique="true"/> |
|---|
| 91 |
|
|---|
| 92 |
<many-to-one name="calendar" |
|---|
| 93 |
class="org.bedework.calfacade.BwCalendar" |
|---|
| 94 |
column="calendarid" |
|---|
| 95 |
index="idx_eventann_calendar" unique-key="eventann-key" /> |
|---|
| 96 |
|
|---|
| 97 |
<property name="dtstamp" column="dtstamp" type="string" /> |
|---|
| 98 |
|
|---|
| 99 |
<property name="lastmod" type="string" > |
|---|
| 100 |
<column name="lastmod" /> |
|---|
| 101 |
</property> |
|---|
| 102 |
|
|---|
| 103 |
<property name="created" type="string"> |
|---|
| 104 |
<column name="created" /> |
|---|
| 105 |
</property> |
|---|
| 106 |
|
|---|
| 107 |
<property name="priority" type="integer" > |
|---|
| 108 |
<column name="priority" /> |
|---|
| 109 |
</property> |
|---|
| 110 |
|
|---|
| 111 |
<many-to-one name="sponsor" |
|---|
| 112 |
class="org.bedework.calfacade.BwSponsor" > |
|---|
| 113 |
<column name="sponsorid" index="idx_eventann_sponsor" /> |
|---|
| 114 |
</many-to-one> |
|---|
| 115 |
|
|---|
| 116 |
<many-to-one name="location" |
|---|
| 117 |
class="org.bedework.calfacade.BwLocation" > |
|---|
| 118 |
<column name="locationid" index="idx_eventann_location" /> |
|---|
| 119 |
</many-to-one> |
|---|
| 120 |
|
|---|
| 121 |
<property name="name" column="eventname" type="text"/> |
|---|
| 122 |
|
|---|
| 123 |
<!-- calendar + guid + recurrence-id is a unique key. --> |
|---|
| 124 |
<property name="guid" type="string" length="500" unique-key="eventann-key" /> |
|---|
| 125 |
|
|---|
| 126 |
<property name="sequence" type="integer" /> |
|---|
| 127 |
|
|---|
| 128 |
<property name="transparency" column="transparency" type="text"/> |
|---|
| 129 |
|
|---|
| 130 |
<property name="categoriesChanged" type="true_false"> |
|---|
| 131 |
<column name="categories_changed" /> |
|---|
| 132 |
</property> |
|---|
| 133 |
|
|---|
| 134 |
<set name="categories" table="event_annotation_categories" |
|---|
| 135 |
lazy="true" > |
|---|
| 136 |
<key column="eventid"/> |
|---|
| 137 |
<many-to-many class="org.bedework.calfacade.BwCategory" |
|---|
| 138 |
column="categoryid"/> |
|---|
| 139 |
</set> |
|---|
| 140 |
|
|---|
| 141 |
<property name="attendeesChanged" type="true_false"> |
|---|
| 142 |
<column name="attendees_changed" /> |
|---|
| 143 |
</property> |
|---|
| 144 |
|
|---|
| 145 |
<set name="attendees" table="event_annotation_attendees" |
|---|
| 146 |
cascade="all-delete-orphan" > |
|---|
| 147 |
<key column="attendeeid"/> |
|---|
| 148 |
<many-to-many class="org.bedework.calfacade.BwAttendee" /> |
|---|
| 149 |
</set> |
|---|
| 150 |
|
|---|
| 151 |
<!-- We don't map the alarms because generally we have to fetch them |
|---|
| 152 |
based on critera we cannot derive from the event. |
|---|
| 153 |
|
|---|
| 154 |
Generally we only fetch the alarms for a given event and the |
|---|
| 155 |
curremt user. |
|---|
| 156 |
<set name="alarms" table="event_alarms" |
|---|
| 157 |
lazy="true" |
|---|
| 158 |
cascade="all-delete-orphan" > |
|---|
| 159 |
<key column="eventid" /> |
|---|
| 160 |
<many-to-many class="org.bedework.calfacade.BwEventAlarm" |
|---|
| 161 |
column="id"/> |
|---|
| 162 |
</set> |
|---|
| 163 |
--> |
|---|
| 164 |
|
|---|
| 165 |
<property name="recurring" type="true_false" column="recurring" |
|---|
| 166 |
index="idx_eventann_recurring" /> |
|---|
| 167 |
|
|---|
| 168 |
<property name="recurrenceChanged" type="true_false"> |
|---|
| 169 |
<column name="recurrence_changed" /> |
|---|
| 170 |
</property> |
|---|
| 171 |
|
|---|
| 172 |
<component name="recurrence" |
|---|
| 173 |
class="org.bedework.calfacade.BwRecurrence" > |
|---|
| 174 |
<set name="rrules" lazy="true" table="event_annotationrrules" |
|---|
| 175 |
cascade="all,delete-orphan"> |
|---|
| 176 |
<key column="eventid"/> |
|---|
| 177 |
<element type="string" column="rrule"/> |
|---|
| 178 |
</set> |
|---|
| 179 |
|
|---|
| 180 |
<set name="rdates" lazy="true" table="event_annotationrdates" |
|---|
| 181 |
cascade="all,delete-orphan"> |
|---|
| 182 |
<key column="eventid"/> |
|---|
| 183 |
<element type="string" column="rdate" /> |
|---|
| 184 |
</set> |
|---|
| 185 |
|
|---|
| 186 |
<set name="exdates" lazy="true" table="event_annotationexdates" |
|---|
| 187 |
cascade="all,delete-orphan"> |
|---|
| 188 |
<key column="eventid"/> |
|---|
| 189 |
<element type="string" column="exdate" /> |
|---|
| 190 |
</set> |
|---|
| 191 |
|
|---|
| 192 |
<property name="recurrenceId" column="recurrence_id" type="string" |
|---|
| 193 |
unique-key="eventann-key" /> |
|---|
| 194 |
|
|---|
| 195 |
<property name="latestDate" column="latest_date" type="string" |
|---|
| 196 |
index="idx_eventann_latest_date" /> |
|---|
| 197 |
|
|---|
| 198 |
<property name="expanded" type="true_false" column="expanded" |
|---|
| 199 |
index="idx_eventann_expanded" /> |
|---|
| 200 |
</component> |
|---|
| 201 |
|
|---|
| 202 |
<many-to-one name="target" |
|---|
| 203 |
class="org.bedework.calfacade.BwEventObj" lazy="true" > |
|---|
| 204 |
<column name="targetid" /> |
|---|
| 205 |
</many-to-one> |
|---|
| 206 |
|
|---|
| 207 |
<many-to-one name="master" |
|---|
| 208 |
class="org.bedework.calfacade.BwEventObj" lazy="true" > |
|---|
| 209 |
<column name="masterid" /> |
|---|
| 210 |
</many-to-one> |
|---|
| 211 |
</class> |
|---|
| 212 |
|
|---|
| 213 |
<!-- ================================================================= |
|---|
| 214 |
Event queries |
|---|
| 215 |
================================================================= --> |
|---|
| 216 |
|
|---|
| 217 |
<!-- |
|---|
| 218 |
<query name="eventsByName"><![CDATA[ |
|---|
| 219 |
from org.bedework.calfacade.BwEvent as ev |
|---|
| 220 |
where ev.name = :name and ev.calendar = :cal |
|---|
| 221 |
]]></query> |
|---|
| 222 |
--> |
|---|
| 223 |
</hibernate-mapping> |
|---|
| 224 |
|
|---|