struktura_silnika_obiektow_procesy5.xsd 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
  3. targetNamespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/struktura_silnika_obiektow_procesy5.xsd"
  4. xmlns:sso_procesy5="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/struktura_silnika_obiektow_procesy5.xsd"
  5. vc:minVersion="1.1"
  6. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  7. xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">
  8. <xs:import namespace="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  9. schemaLocation="../system_cache/appinfo.xsd"/>
  10. <xs:complexType name="OBSZAR"/>
  11. <xs:element name="A" type="sso_procesy5:OBSZAR"/>
  12. <xs:element name="B" type="sso_procesy5:OBSZAR"/>
  13. <xs:element name="ROOT_A">
  14. <xs:complexType>
  15. <xs:sequence>
  16. <xs:element name="CACHE">
  17. <xs:complexType>
  18. <xs:attribute name="ID_A"/>
  19. <xs:attribute name="ID_B"/>
  20. <xs:attribute name="ID_C"/>
  21. </xs:complexType>
  22. </xs:element>
  23. <xs:element name="A">
  24. <xs:complexType>
  25. <xs:sequence>
  26. <xs:element name="CACHE">
  27. <xs:complexType>
  28. <xs:attribute name="ID_A"/>
  29. <xs:attribute name="ID_B"/>
  30. <xs:attribute name="ID_C"/>
  31. </xs:complexType>
  32. </xs:element>
  33. </xs:sequence>
  34. <xs:attribute name="ID_SEQ_A"/>
  35. </xs:complexType>
  36. </xs:element>
  37. </xs:sequence>
  38. <xs:attribute name="ID_A"/>
  39. </xs:complexType>
  40. </xs:element>
  41. <xs:element name="CHILD_B">
  42. <xs:complexType>
  43. <xs:sequence>
  44. <xs:element ref="sso_procesy5:ROOT_A"/>
  45. <xs:element name="CACHE">
  46. <xs:complexType>
  47. <xs:attribute name="ID_A"/>
  48. <xs:attribute name="ID_B"/>
  49. <xs:attribute name="ID_C"/>
  50. </xs:complexType>
  51. </xs:element>
  52. <xs:element name="A">
  53. <xs:complexType>
  54. <xs:sequence>
  55. <xs:element name="CACHE">
  56. <xs:complexType>
  57. <xs:attribute name="ID_A"/>
  58. <xs:attribute name="ID_B"/>
  59. <xs:attribute name="ID_C"/>
  60. </xs:complexType>
  61. </xs:element>
  62. </xs:sequence>
  63. <xs:attribute name="ID_SEQ_B"/>
  64. </xs:complexType>
  65. </xs:element>
  66. </xs:sequence>
  67. <xs:attribute name="ID_B"/>
  68. </xs:complexType>
  69. </xs:element>
  70. <xs:element name="CHILD_C">
  71. <xs:complexType>
  72. <xs:sequence>
  73. <xs:element ref="sso_procesy5:CHILD_B"/>
  74. <xs:element name="CACHE">
  75. <xs:complexType>
  76. <xs:attribute name="ID_A"/>
  77. <xs:attribute name="ID_B"/>
  78. <xs:attribute name="ID_C"/>
  79. </xs:complexType>
  80. </xs:element>
  81. <xs:element name="A">
  82. <xs:complexType>
  83. <xs:sequence>
  84. <xs:element name="CACHE">
  85. <xs:complexType>
  86. <xs:attribute name="ID_A"/>
  87. <xs:attribute name="ID_B"/>
  88. <xs:attribute name="ID_C"/>
  89. </xs:complexType>
  90. </xs:element>
  91. </xs:sequence>
  92. <xs:attribute name="ID_SEQ_C"/>
  93. </xs:complexType>
  94. </xs:element>
  95. </xs:sequence>
  96. <xs:attribute name="ID_C"/>
  97. </xs:complexType>
  98. </xs:element>
  99. <xs:complexType name="COLUMN_NAME">
  100. <xs:attribute ref="system_cache__appinfo:id"/>
  101. </xs:complexType>
  102. <xs:simpleType name="COLUMN_VALUE_INSTANCE">
  103. <xs:restriction base="xs:string">
  104. <xs:enumeration value="true"/>
  105. <xs:enumeration value="derived"/>
  106. <xs:enumeration value=""/>
  107. </xs:restriction>
  108. </xs:simpleType>
  109. <xs:simpleType name="COLUMN_VALUE_in_ELEMENT_NAME">
  110. <xs:restriction base="xs:string"/>
  111. </xs:simpleType>
  112. <xs:simpleType name="COLUMN_VALUE_in_KEY_ID">
  113. <xs:annotation>
  114. <xs:documentation>W bazie danych beda to xs:INT ale tutaj beda dane do evaluacji</xs:documentation>
  115. </xs:annotation>
  116. <xs:restriction base="xs:string"/>
  117. </xs:simpleType>
  118. <xs:attribute name="evaluate_key_value"/>
  119. <xs:attribute name="read_key_value"/>
  120. <xs:complexType name="COLUMN_VALUE_in_KEY_ID_to_eval">
  121. <xs:annotation>
  122. <xs:documentation>W bazie danych beda to xs:INT ale tutaj beda dane do evaluacji</xs:documentation>
  123. </xs:annotation>
  124. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  125. </xs:complexType>
  126. <xs:complexType name="COLUMN_VALUE_in_KEY_ID_to_read">
  127. <xs:attribute ref="sso_procesy5:read_key_value"/>
  128. </xs:complexType>
  129. <xs:element name="create_sql_tables_from_go_recurse_from_root_by_build_element_with_cache">
  130. <xs:complexType>
  131. <xs:choice maxOccurs="unbounded">
  132. <xs:element name="structure_table_root_instance">
  133. <xs:complexType>
  134. <xs:sequence>
  135. <xs:element name="column_ELEMENT_ID"
  136. type="sso_procesy5:COLUMN_VALUE_in_KEY_ID_to_read"/>
  137. <xs:element name="column_ELEMENT_NAME"
  138. type="sso_procesy5:COLUMN_VALUE_in_ELEMENT_NAME"> </xs:element>
  139. <xs:element maxOccurs="0" minOccurs="0" name="column_REMOTE_ID"/>
  140. <xs:element maxOccurs="unbounded" name="columns_CACHE_INSTANCE">
  141. <xs:complexType>
  142. <xs:sequence>
  143. <xs:element name="COLUMN_NAME"
  144. type="sso_procesy5:COLUMN_NAME"/>
  145. <xs:element name="COLUMN_VALUE"
  146. type="sso_procesy5:COLUMN_VALUE_INSTANCE"/>
  147. </xs:sequence>
  148. </xs:complexType>
  149. </xs:element>
  150. </xs:sequence>
  151. <xs:attribute name="table_name" type="xs:ID" use="required"/>
  152. </xs:complexType>
  153. </xs:element>
  154. <xs:element name="structure_table_child_instance">
  155. <xs:complexType>
  156. <xs:sequence>
  157. <xs:element name="column_ELEMENT_ID"
  158. type="sso_procesy5:COLUMN_VALUE_in_KEY_ID_to_eval"/>
  159. <xs:element name="column_ELEMENT_NAME"
  160. type="sso_procesy5:COLUMN_VALUE_in_ELEMENT_NAME"> </xs:element>
  161. <xs:element maxOccurs="0" minOccurs="0" name="column_REMOTE_ID"/>
  162. <xs:element maxOccurs="unbounded" name="columns_CACHE_INSTANCE">
  163. <xs:complexType>
  164. <xs:sequence>
  165. <xs:element name="COLUMN_NAME"
  166. type="sso_procesy5:COLUMN_NAME"/>
  167. <xs:element name="COLUMN_VALUE"
  168. type="sso_procesy5:COLUMN_VALUE_INSTANCE"/>
  169. </xs:sequence>
  170. </xs:complexType>
  171. </xs:element>
  172. </xs:sequence>
  173. <xs:attribute name="table_name" type="xs:ID" use="required"/>
  174. </xs:complexType>
  175. </xs:element>
  176. <xs:element name="structure_table_sequence">
  177. <xs:complexType>
  178. <xs:sequence>
  179. <xs:element name="column_ELEMENT_ID"
  180. type="sso_procesy5:COLUMN_VALUE_in_KEY_ID_to_read"/>
  181. <xs:element name="column_PARENT_ID">
  182. <xs:complexType>
  183. <xs:annotation>
  184. <xs:documentation>W bazie danych beda to xs:INT ale tutaj beda dane do evaluacji</xs:documentation>
  185. </xs:annotation>
  186. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  187. </xs:complexType>
  188. </xs:element>
  189. <xs:element name="column_CACHE_INSTANCE_ID">
  190. <xs:annotation>
  191. <xs:documentation>Oznaczenie numeru ID instancji glownej - sluzy do cacheowania obiektow</xs:documentation>
  192. </xs:annotation>
  193. <xs:complexType>
  194. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  195. </xs:complexType>
  196. </xs:element>
  197. <xs:element maxOccurs="unbounded" name="columns_CACHE_INSTANCE">
  198. <xs:complexType>
  199. <xs:sequence>
  200. <xs:element name="COLUMN_NAME"
  201. type="sso_procesy5:COLUMN_NAME"/>
  202. <xs:element name="COLUMN_VALUE"
  203. type="sso_procesy5:COLUMN_VALUE_INSTANCE"/>
  204. </xs:sequence>
  205. </xs:complexType>
  206. </xs:element>
  207. </xs:sequence>
  208. <xs:attribute name="table_name" type="xs:ID" use="required"/>
  209. </xs:complexType>
  210. </xs:element>
  211. <xs:element name="structure_table_reference">
  212. <xs:complexType>
  213. <xs:sequence>
  214. <xs:element name="column_ELEMENT_ID"
  215. type="sso_procesy5:COLUMN_VALUE_in_KEY_ID_to_read"/>
  216. <xs:element name="column_PARENT_ID">
  217. <xs:complexType>
  218. <xs:annotation>
  219. <xs:documentation>W bazie danych beda to xs:INT ale tutaj beda dane do evaluacji</xs:documentation>
  220. </xs:annotation>
  221. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  222. </xs:complexType>
  223. </xs:element>
  224. <xs:element name="column_REMOTE_ID">
  225. <xs:complexType>
  226. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  227. </xs:complexType>
  228. </xs:element>
  229. <xs:element name="column_CACHE_INSTANCE_ID">
  230. <xs:annotation>
  231. <xs:documentation>Oznaczenie numeru ID instancji glownej - sluzy do cacheowania obiektow</xs:documentation>
  232. </xs:annotation>
  233. <xs:complexType>
  234. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  235. </xs:complexType>
  236. </xs:element>
  237. <xs:element maxOccurs="unbounded" name="column_CACHE_INSTANCE">
  238. <xs:complexType>
  239. <xs:sequence>
  240. <xs:element name="COLUMN_NAME"
  241. type="sso_procesy5:COLUMN_NAME"/>
  242. <xs:element name="COLUMN_VALUE"
  243. type="sso_procesy5:COLUMN_VALUE_INSTANCE"/>
  244. </xs:sequence>
  245. </xs:complexType>
  246. </xs:element>
  247. </xs:sequence>
  248. <xs:attribute name="table_name"/>
  249. </xs:complexType>
  250. </xs:element>
  251. <xs:element name="structure_table_value">
  252. <xs:annotation>
  253. <xs:documentation>For values of elements and also attributes. </xs:documentation>
  254. </xs:annotation>
  255. <xs:complexType>
  256. <xs:sequence>
  257. <xs:element name="column_ELEMENT_ID"
  258. type="sso_procesy5:COLUMN_VALUE_in_KEY_ID_to_read"/>
  259. <xs:element name="column_PARENT_ID">
  260. <xs:complexType>
  261. <xs:annotation>
  262. <xs:documentation>W bazie danych beda to xs:INT ale tutaj beda dane do evaluacji</xs:documentation>
  263. </xs:annotation>
  264. <xs:attribute ref="sso_procesy5:evaluate_key_value"/>
  265. </xs:complexType>
  266. </xs:element>
  267. <xs:element name="column_VALUE" type="xs:string"/>
  268. <xs:element maxOccurs="unbounded" name="columns_CACHE_INSTANCE">
  269. <xs:complexType>
  270. <xs:sequence>
  271. <xs:element name="COLUMN_NAME"
  272. type="sso_procesy5:COLUMN_NAME"/>
  273. <xs:element name="COLUMN_VALUE"
  274. type="sso_procesy5:COLUMN_VALUE_INSTANCE"/>
  275. </xs:sequence>
  276. </xs:complexType>
  277. </xs:element>
  278. </xs:sequence>
  279. <xs:attribute name="table_name" type="xs:ID" use="required"/>
  280. </xs:complexType>
  281. </xs:element>
  282. <xs:element name="structure_434_info"/>
  283. <xs:element
  284. ref="sso_procesy5:create_sql_tables_from_go_recurse_from_root_by_build_element_with_cache"
  285. />
  286. </xs:choice>
  287. </xs:complexType>
  288. </xs:element>
  289. <xs:element name="create_sql_table_cache_instance">
  290. <xs:complexType>
  291. <xs:attribute name="instance_id_table" type="xs:IDREF"/>
  292. <xs:attribute name="instance_id_value" type="xs:IDREF">
  293. <xs:annotation>
  294. <xs:documentation>Numer ID danego typu instancji, zapisanej w tabeli z @ID danej instancji</xs:documentation>
  295. </xs:annotation>
  296. </xs:attribute>
  297. </xs:complexType>
  298. </xs:element>
  299. <xs:complexType name="INSTANCE">
  300. <xs:annotation>
  301. <xs:documentation>Przykładowy obiekt instance np. REWIR, do którego w relacji jest BUDYNEK (INSTANCE2).
  302. Instancje powinny być zgodne z numerami #ID (primary_key) FLAT_TABLE, w związku z czym powinna istniec procedura importu rekordow z tabeli plaskiej do danych obiektowych powinna wyglądać następująco
  303. WHEN INSERT into FLAT_TABLE (ID,SOME_COLUMN,SOME_COLUMN2) then
  304. insert into INSTANCE ($ID)
  305. insert into INSTANCE_SOME_COLUMN(@OBJECT_ID,@value) values ($ID,$SOME_COLUMN);
  306. insert into INSTANCE_SOME_COLUMN2(@OBJECT_ID,@value) values ($ID,$SOME_COLUMN2);
  307. - liczniki @counter_value powinny sie dodac same na bazie triggerow)
  308. procedura importu z weryfikacja powinna dzialac tak samo
  309. PROCEDURE_IMPORT_UPDATE_FLAT_TABLE foreach FLAT_TABLE {
  310. j.w.
  311. }
  312. </xs:documentation>
  313. </xs:annotation>
  314. <xs:sequence>
  315. <xs:element name="FLAT_TABLE">
  316. <xs:annotation>
  317. <xs:documentation>Skojarzona z dana instancja tabela plaska, ktora powinna miec zgodny numer OBJECT_ID z kluczem tej tabeli, czyli w wiekszosci przypadków ta sama wartosc pola ID. W zasadzie te dane powinny przechodzic 1:1</xs:documentation>
  318. </xs:annotation>
  319. <xs:complexType>
  320. <xs:sequence>
  321. <xs:element name="ID">
  322. <xs:complexType>
  323. <xs:attribute name="OBJECT_ID" use="required"/>
  324. </xs:complexType>
  325. </xs:element>
  326. <xs:element maxOccurs="unbounded" minOccurs="0" name="SOME_COLUMN">
  327. <xs:complexType>
  328. <xs:attribute name="SOME_COLUMN_VALUE"/>
  329. </xs:complexType>
  330. </xs:element>
  331. <xs:element maxOccurs="unbounded" minOccurs="0" name="SOME_COLUMN_WITH_REFS">
  332. <xs:annotation>
  333. <xs:documentation>w przypadku, kiedy dany obiekt plaski zotsał ustawiony, że jest w relacji do jakiegoś innego obiektu, czyli np. REWIR moze zawierac BUDYNEK, oraz relacja zostala nazwana @id=REWIR_do_BUDUNEK, to powinna sie utworzyc kolumna w tabeli BUDYNEK o nazwie @id(REWIR_do_BUDYNEK), która będize zawierać @OBJECT_ID z tabeli BUDYNEK, która to kolumna powinna być wytriggerowana tak, że po zmianie relacji w element_refs będzie ona zaktualizowana. Założenia dla triggera:
  334. when update element_refs then
  335. update</xs:documentation>
  336. </xs:annotation>
  337. <xs:complexType>
  338. <xs:attribute name="OBJECT_ID"/>
  339. </xs:complexType>
  340. </xs:element>
  341. </xs:sequence>
  342. </xs:complexType>
  343. </xs:element>
  344. <xs:element maxOccurs="0" name="INSTANCES" minOccurs="0">
  345. <xs:annotation>
  346. <xs:documentation>NIEAKTUALNE @2015-11-20 - odtwarzamy całą mapę ułożenia obiektu zgodnie z dziecziczeniami
  347. tabela zawierajaca jakie instanncje reprezentuje dany obiekt - czyli w przypadku obiektu AAAA powinny byc wpisy , ze jest obiektem A, AA, AAA oraz AAAA .
  348. zalozenia dla triggerowania:
  349. PROCEDURE INSTANCES_DEREVIATIONS_UPDATE {
  350. delete from INSTANCES where $OBJECT_ID
  351. for each dereviations as $OBJECT_ID,$TYPE {
  352. insert into INSTANCES (OBJECT_ID,TYPE) values ($OBJECT_ID,$TYPE)
  353. }
  354. }
  355. when NEW INSTANCE then call_procedure INSTANCES_DEREVIATIONS_UPDATE
  356. when UPDATE INSTANCE TYPE on $OBJECT_ID then call_procedure INSTANCES_DEREVIATIONS_UPDATE
  357. </xs:documentation>
  358. </xs:annotation>
  359. <xs:complexType>
  360. <xs:attribute name="OBJECT_ID" use="required"/>
  361. <xs:attribute name="TYPE"/>
  362. </xs:complexType>
  363. </xs:element>
  364. <xs:element name="COUNTER">
  365. <xs:annotation>
  366. <xs:documentation>Tabela z licznikami dla każdej instancji- aby był osobny licznik kolejności dla każdego z instancji.
  367. Zasada triggerowania
  368. WHEN NEW_RECORD on INSTANCE_SOME_COLUMN then
  369. update COUNTER @counter_value +1;
  370. return @counter_value + 1;
  371. WHEN UPDATE INSTANCE
  372. REALOCATE(INSTANCE) { nalezy zrealokowac obiekty ustawiajac ich kolejnosc wlasciwa na podstawie danych wejsciowych, czyli jak doszedl jakis element, to musi byc ustawiony jego counter na @counter_value+1
  373. i wszystkie dane mają zwiększony @counter_value
  374. </xs:documentation>
  375. </xs:annotation>
  376. <xs:complexType>
  377. <xs:attribute name="OBJECT_ID"/>
  378. <xs:attribute name="counter_value"/>
  379. </xs:complexType>
  380. </xs:element>
  381. <xs:element maxOccurs="unbounded" minOccurs="0" name="INSTANCE_SOME_COLUMN">
  382. <xs:annotation>
  383. <xs:documentation>Kazda kolumna z plaskiego wystepuje pod nazwa tabeli np. DEVICES__a123asdad_ID.
  384. Przy triggerowaniu regula taka:
  385. when NEW_RECORD on FLAT_TABLE then
  386. .....
  387. when field SOME_COLUMN then insert into INSTANCE_SOME_COLUMN(@OBJECT_ID,@counter_value,@value) values
  388. (`wartosc klucza obiektu np. ID`,`nextval(@counter_value)`,`@SOME_COLUMN_VALUE`)
  389. </xs:documentation>
  390. </xs:annotation>
  391. <xs:complexType>
  392. <xs:attribute name="OBJECT_ID"/>
  393. <xs:attribute name="counter_value"/>
  394. <xs:attribute name="value"/>
  395. </xs:complexType>
  396. </xs:element>
  397. <xs:element maxOccurs="unbounded" minOccurs="0" name="element_refs">
  398. <xs:annotation>
  399. <xs:documentation>Informacje o relacjach do obcych obiektów z danego obiektu, tabela zawierajaca nr obiektu, licznik oraz @REMOTE_OBJECT_ID odnoszący się do @OBJECT_ID obcego obiektu, gdzie wiemy o jaki typ chodzi na podstawie schematu oraz nazwy tabeli, w której się znajduje dany rekord - bo do każdej relacji jest osobna tabela.
  400. dane mogą być cacheowane/triggerowane w z tabelami płaskimi, po stronie obiektu docelowego, z zawartością @OBJECT_ID oraz nazwą kolumny=$nazwa_tabeli_relacji(@id ze schematu).
  401. w związku z czym założenia do triggerowania są takie:
  402. when UPDATE on element_refs (@OBJECT_ID,@REMOTE_OBJECT_ID)
  403. then update FLAT_TABLE2 set element_refs2=@OBJECT_ID where #ID=@REMOTE_OBJECT_ID
  404. w przypadku triggerowania od strony tabeli płaskiej, to wyglądało by to tak:
  405. when UPDATE FLAT_TABLE2 where #ID=@OBJECT2_ID and element_refs2=@OBJECT_ID
  406. delete from element_ref where @ID_OBJECT=OLD.@OBJECT_ID
  407. insert into element_ref where @ID_OBJECT=NEW.@OBJECT_ID
  408. </xs:documentation>
  409. </xs:annotation>
  410. <xs:complexType>
  411. <xs:attribute name="OBJECT_ID"/>
  412. <xs:attribute name="counter_value"/>
  413. <xs:attribute name="REMOTE_OBJECT_ID"/>
  414. </xs:complexType>
  415. </xs:element>
  416. </xs:sequence>
  417. <xs:attribute name="OBJECT_ID" use="required"/>
  418. <xs:attribute name="TYPE" use="required">
  419. <xs:annotation>
  420. <xs:documentation>Aktualny typ dla którego dany obiekt został zainstancjonowany. Jeżeli obiekt jest typu A i został tylko jako A użyty, to jest tutaj wartość A oraz do INSTANCES tez wchodzi, jako typ A. Natomiast, jeżeli został on użyty jako AAAA, który jest typem dziedziczonym z A/AA/AAA/AAAA, to powinna tam byc wartosc 'AAAA'. </xs:documentation>
  421. </xs:annotation>
  422. </xs:attribute>
  423. <xs:attribute name="ELEMENT_NAME">
  424. <xs:annotation>
  425. <xs:documentation>Jezeli element byl uzyty dla zainstancjonowania obiektu - np. w wyniku zadzialania relacji, to nalezy to pole uzupelnic nazwa tego elementu. W zwiazku z czym dany obiekt nie bedzie mogl wystepowa jako dwa typy elementów? TODO czy jest to wlasciwe? TODO Moze to powinno przejsc na tabele INSTANCES?</xs:documentation>
  426. </xs:annotation>
  427. </xs:attribute>
  428. </xs:complexType>
  429. <xs:complexType name="INSTANCE2">
  430. <xs:annotation>
  431. <xs:documentation>Przykładowy inny obiekt - np podrzędny do INSTANCE np. BUDYNEK</xs:documentation>
  432. </xs:annotation>
  433. <xs:sequence>
  434. <xs:element name="FLAT_TABLE">
  435. <xs:complexType>
  436. <xs:sequence>
  437. <xs:element name="ID2">
  438. <xs:complexType>
  439. <xs:attribute name="OBJECT_ID" use="required"/>
  440. </xs:complexType>
  441. </xs:element>
  442. <xs:element maxOccurs="unbounded" minOccurs="0" name="SOME_COLUMN2">
  443. <xs:complexType>
  444. <xs:attribute name="SOME_COLUMN_VALUE"/>
  445. </xs:complexType>
  446. </xs:element>
  447. <xs:element maxOccurs="unbounded" minOccurs="0" name="element_refs2">
  448. <xs:annotation>
  449. <xs:documentation>w przypadku, kiedy dany obiekt plaski zotsał ustawiony, że jest w relacji do jakiegoś innego obiektu, czyli np. REWIR moze zawierac BUDYNEK, oraz relacja zostala nazwana @id=REWIR_do_BUDUNEK, to powinna sie utworzyc kolumna w tabeli BUDYNEK o nazwie @id(REWIR_do_BUDYNEK), która będize zawierać @OBJECT_ID z tabeli BUDYNEK, która to kolumna powinna być wytriggerowana tak, że po zmianie relacji w element_refs będzie ona zaktualizowana. Założenia dla triggera:
  450. when update element_refs then
  451. update</xs:documentation>
  452. </xs:annotation>
  453. <xs:complexType>
  454. <xs:attribute name="OBJECT_ID"/>
  455. </xs:complexType>
  456. </xs:element>
  457. </xs:sequence>
  458. </xs:complexType>
  459. </xs:element>
  460. <xs:element maxOccurs="0" name="INSTANCES2" minOccurs="0">
  461. <xs:complexType>
  462. <xs:attribute name="OBJECT_ID" use="required"/>
  463. <xs:attribute name="TYPE"/>
  464. </xs:complexType>
  465. </xs:element>
  466. <xs:element name="COUNTER2">
  467. <xs:complexType>
  468. <xs:attribute name="OBJECT_ID"/>
  469. <xs:attribute name="counter_value"/>
  470. </xs:complexType>
  471. </xs:element>
  472. <xs:element maxOccurs="unbounded" minOccurs="0" name="INSTANCE_SOME_COLUMN2">
  473. <xs:complexType>
  474. <xs:attribute name="OBJECT_ID"/>
  475. <xs:attribute name="counter_value"/>
  476. <xs:attribute name="value"/>
  477. </xs:complexType>
  478. </xs:element>
  479. <xs:element maxOccurs="unbounded" minOccurs="0" name="element_refs2">
  480. <xs:complexType>
  481. <xs:attribute name="OBJECT_ID"/>
  482. <xs:attribute name="counter_value"/>
  483. <xs:attribute name="REMOTE_OBJECT_ID"/>
  484. </xs:complexType>
  485. </xs:element>
  486. </xs:sequence>
  487. <xs:attribute name="OBJECT2_ID" use="required"/>
  488. <xs:attribute name="TYPE2" use="required"/>
  489. <xs:attribute name="ELEMENT2_NAME"/>
  490. </xs:complexType>
  491. </xs:schema>