| 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 alarm in Bedework. |
|---|
| 8 |
|
|---|
| 9 |
An alarm may be associated with an event or task. |
|---|
| 10 |
|
|---|
| 11 |
Alarms may be of different types as defined by the RFC. |
|---|
| 12 |
0 -> AUDIO |
|---|
| 13 |
1 -> DISPLAY |
|---|
| 14 |
2 -> EMAIL |
|---|
| 15 |
3 -> PROCEDURE |
|---|
| 16 |
|
|---|
| 17 |
If sites want to implement non-standard alarm types use values 1000 and |
|---|
| 18 |
greater to define the type. 4-999 are reserved for expansions to the standard |
|---|
| 19 |
|
|---|
| 20 |
The following describes the use of each field and when or how required based |
|---|
| 21 |
on the trigger type |
|---|
| 22 |
|
|---|
| 23 |
Field Description Required Optional |
|---|
| 24 |
trigger This specifies the time for the alarm |
|---|
| 25 |
in rfc format ADEP |
|---|
| 26 |
trigger_start T if we trigger off the start, 'F' for end ADEP |
|---|
| 27 |
duration External form of duration ADEP |
|---|
| 28 |
repeat number of repitions ADEP |
|---|
| 29 |
attach audio file or attachment or exec P A E |
|---|
| 30 |
description DE P |
|---|
| 31 |
summary E |
|---|
| 32 |
attendees Set of attendees E |
|---|
| 33 |
|
|---|
| 34 |
internal use |
|---|
| 35 |
trigger_time This specifies the time for the next alarm |
|---|
| 36 |
converted to internal format |
|---|
| 37 |
previous_trigger Used to determine if we missed an alarm |
|---|
| 38 |
repeat_count Number of repeats we've done |
|---|
| 39 |
expired Set to 'T' when we're done - default 'F' |
|---|
| 40 |
=================================================================== --> |
|---|
| 41 |
|
|---|
| 42 |
<hibernate-mapping> |
|---|
| 43 |
<class name="org.bedework.calfacade.BwAlarm" |
|---|
| 44 |
table="bw_alarms" |
|---|
| 45 |
discriminator-value="O"> |
|---|
| 46 |
<id name="id" type="integer" column="alarmid" unsaved-value="-1"> |
|---|
| 47 |
<generator class="native"/> |
|---|
| 48 |
</id> |
|---|
| 49 |
|
|---|
| 50 |
<version name="seq" column="bwseq" type="integer" /> |
|---|
| 51 |
|
|---|
| 52 |
<property name="alarmType" column="alarm_type" type="integer" /> |
|---|
| 53 |
|
|---|
| 54 |
<property name="ownerHref" column="bw_owner" type="string" |
|---|
| 55 |
index="bwidx_alarm_owner" not-null="true" /> |
|---|
| 56 |
|
|---|
| 57 |
<property name="publick" type="true_false" > |
|---|
| 58 |
<column name="publick" not-null="true" /> |
|---|
| 59 |
</property> |
|---|
| 60 |
|
|---|
| 61 |
<property name="trigger" column="trigger_rfctime" type="string" |
|---|
| 62 |
length="16" /> |
|---|
| 63 |
|
|---|
| 64 |
<property name="triggerStart" type="true_false"> |
|---|
| 65 |
<column name="trigger_start" not-null="true" /> |
|---|
| 66 |
</property> |
|---|
| 67 |
|
|---|
| 68 |
<property name="duration" column="duration" type="string" |
|---|
| 69 |
length="100" /> |
|---|
| 70 |
<property name="repeat" column="repetitions" type="integer" /> |
|---|
| 71 |
|
|---|
| 72 |
<!-- This is inadequate and/or wrong |
|---|
| 73 |
It needs to be multiple valued and allow for longer values. |
|---|
| 74 |
Also, if a real attachment, it probably ought to be saved as a file and |
|---|
| 75 |
this would be a url |
|---|
| 76 |
--> |
|---|
| 77 |
<property name="attach" column="attach" type="string" |
|---|
| 78 |
length="2000"/> |
|---|
| 79 |
|
|---|
| 80 |
<set name="summaries" table="bw_alarmsummaries" |
|---|
| 81 |
cascade="all-delete-orphan" > |
|---|
| 82 |
<cache usage="read-write"/> |
|---|
| 83 |
<key column="bw_alarmid" foreign-key="bw_as_alarm_fk" /> |
|---|
| 84 |
<many-to-many class="org.bedework.calfacade.BwString" |
|---|
| 85 |
unique="true" |
|---|
| 86 |
column="bw_strid" |
|---|
| 87 |
foreign-key="bw_as_str_fk" /> |
|---|
| 88 |
</set> |
|---|
| 89 |
|
|---|
| 90 |
<set name="descriptions" table="bw_alarmdescriptions" |
|---|
| 91 |
cascade="all-delete-orphan" > |
|---|
| 92 |
<cache usage="read-write"/> |
|---|
| 93 |
<key column="bw_alarmid" foreign-key="bw_ad_alarm_fk" /> |
|---|
| 94 |
<many-to-many class="org.bedework.calfacade.BwString" |
|---|
| 95 |
unique="true" |
|---|
| 96 |
column="bw_strid" |
|---|
| 97 |
foreign-key="bw_ad_str_fk" /> |
|---|
| 98 |
</set> |
|---|
| 99 |
|
|---|
| 100 |
<set name="attendees" table="bw_alarm_attendees" |
|---|
| 101 |
cascade="all-delete-orphan" > |
|---|
| 102 |
<key column="alarmid" foreign-key="bw_aa_alarm_fk" /> |
|---|
| 103 |
<many-to-many class="org.bedework.calfacade.BwAttendee" |
|---|
| 104 |
column="attendeeid" |
|---|
| 105 |
foreign-key="bw_aa_att_fk"/> |
|---|
| 106 |
</set> |
|---|
| 107 |
|
|---|
| 108 |
<property name="triggerTime" column="trigger_time" type="string" length="16" /> |
|---|
| 109 |
<property name="previousTrigger" column="previous_trigger" type="string" length="16" /> |
|---|
| 110 |
<property name="repeatCount" column="repeat_count" type="integer" /> |
|---|
| 111 |
|
|---|
| 112 |
<property name="expired" type="true_false"> |
|---|
| 113 |
<column name="expired" not-null="true" /> |
|---|
| 114 |
</property> |
|---|
| 115 |
|
|---|
| 116 |
<list name="xproperties" table="bw_alarm_xprops" |
|---|
| 117 |
cascade="all-delete-orphan" > |
|---|
| 118 |
<!-- <cache usage="read-write"/> --> |
|---|
| 119 |
<key column="alarmid" foreign-key="bw_alarmxp_aid_fk" /> |
|---|
| 120 |
<list-index column="bwxp_position"/> |
|---|
| 121 |
<composite-element class="org.bedework.calfacade.BwXproperty"> |
|---|
| 122 |
<property name="name" type="string" length="100" |
|---|
| 123 |
column="bw_name" /> |
|---|
| 124 |
|
|---|
| 125 |
<property name="pars" type="string" length="4000" |
|---|
| 126 |
column="bw_pars" /> |
|---|
| 127 |
|
|---|
| 128 |
<property name="value" column="bw_value" type="text"/> |
|---|
| 129 |
</composite-element> |
|---|
| 130 |
</list> |
|---|
| 131 |
</class> |
|---|
| 132 |
|
|---|
| 133 |
<!-- ================================================================= |
|---|
| 134 |
Alarm queries |
|---|
| 135 |
================================================================= --> |
|---|
| 136 |
|
|---|
| 137 |
<query name="getUnexpiredAlarmsUser"><![CDATA[ |
|---|
| 138 |
from org.bedework.calfacade.BwAlarm as al |
|---|
| 139 |
where al.expired = false and al.ownerHref=:userHref |
|---|
| 140 |
]]></query> |
|---|
| 141 |
|
|---|
| 142 |
<query name="getUnexpiredAlarms"><![CDATA[ |
|---|
| 143 |
from org.bedework.calfacade.BwAlarm as al |
|---|
| 144 |
where al.expired = false |
|---|
| 145 |
]]></query> |
|---|
| 146 |
|
|---|
| 147 |
<!-- Return all unexpired alarms for the given user before the given time |
|---|
| 148 |
--> |
|---|
| 149 |
<query name="getUnexpiredAlarmsUserTime"><![CDATA[ |
|---|
| 150 |
from org.bedework.calfacade.BwAlarm as al |
|---|
| 151 |
where al.expired = false and al.ownerHref=:userHref and |
|---|
| 152 |
al.triggerTime <= :tt |
|---|
| 153 |
]]></query> |
|---|
| 154 |
|
|---|
| 155 |
<!-- Return all unexpired alarms before the given time |
|---|
| 156 |
--> |
|---|
| 157 |
<query name="getUnexpiredAlarmsTime"><![CDATA[ |
|---|
| 158 |
from org.bedework.calfacade.BwAlarm as al |
|---|
| 159 |
where al.expired = false and |
|---|
| 160 |
al.triggerTime <= :tt |
|---|
| 161 |
]]></query> |
|---|
| 162 |
</hibernate-mapping> |
|---|
| 163 |
|
|---|