orm_1_0.xsd 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Java Persistence API object-relational mapping file schema -->
  3. <xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm"
  4. xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
  5. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  6. elementFormDefault="qualified"
  7. attributeFormDefault="unqualified"
  8. version="1.0">
  9. <xsd:annotation>
  10. <xsd:documentation>
  11. @(#)orm_1_0.xsd 1.0 Feb 14 2006
  12. </xsd:documentation>
  13. </xsd:annotation>
  14. <xsd:annotation>
  15. <xsd:documentation><![CDATA[
  16. This is the XML Schema for the persistence object-relational
  17. mapping file.
  18. The file may be named "META-INF/orm.xml" in the persistence
  19. archive or it may be named some other name which would be
  20. used to locate the file as resource on the classpath.
  21. ]]></xsd:documentation>
  22. </xsd:annotation>
  23. <xsd:complexType name="emptyType"/>
  24. <xsd:simpleType name="versionType">
  25. <xsd:restriction base="xsd:token">
  26. <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
  27. </xsd:restriction>
  28. </xsd:simpleType>
  29. <!-- **************************************************** -->
  30. <xsd:element name="entity-mappings">
  31. <xsd:complexType>
  32. <xsd:annotation>
  33. <xsd:documentation>
  34. The entity-mappings element is the root element of an mapping
  35. file. It contains the following four types of elements:
  36. 1. The persistence-unit-metadata element contains metadata
  37. for the entire persistence unit. It is undefined if this element
  38. occurs in multiple mapping files within the same persistence unit.
  39. 2. The package, schema, catalog and access elements apply to all of
  40. the entity, mapped-superclass and embeddable elements defined in
  41. the same file in which they occur.
  42. 3. The sequence-generator, table-generator, named-query,
  43. named-native-query and sql-result-set-mapping elements are global
  44. to the persistence unit. It is undefined to have more than one
  45. sequence-generator or table-generator of the same name in the same
  46. or different mapping files in a persistence unit. It is also
  47. undefined to have more than one named-query or named-native-query
  48. of the same name in the same or different mapping files in a
  49. persistence unit.
  50. 4. The entity, mapped-superclass and embeddable elements each define
  51. the mapping information for a managed persistent class. The mapping
  52. information contained in these elements may be complete or it may
  53. be partial.
  54. </xsd:documentation>
  55. </xsd:annotation>
  56. <xsd:sequence>
  57. <xsd:element name="description" type="xsd:string"
  58. minOccurs="0"/>
  59. <xsd:element name="persistence-unit-metadata"
  60. type="orm:persistence-unit-metadata"
  61. minOccurs="0"/>
  62. <xsd:element name="package" type="xsd:string"
  63. minOccurs="0"/>
  64. <xsd:element name="schema" type="xsd:string"
  65. minOccurs="0"/>
  66. <xsd:element name="catalog" type="xsd:string"
  67. minOccurs="0"/>
  68. <xsd:element name="access" type="orm:access-type"
  69. minOccurs="0"/>
  70. <xsd:element name="sequence-generator" type="orm:sequence-generator"
  71. minOccurs="0" maxOccurs="unbounded"/>
  72. <xsd:element name="table-generator" type="orm:table-generator"
  73. minOccurs="0" maxOccurs="unbounded"/>
  74. <xsd:element name="named-query" type="orm:named-query"
  75. minOccurs="0" maxOccurs="unbounded"/>
  76. <xsd:element name="named-native-query" type="orm:named-native-query"
  77. minOccurs="0" maxOccurs="unbounded"/>
  78. <xsd:element name="sql-result-set-mapping"
  79. type="orm:sql-result-set-mapping"
  80. minOccurs="0" maxOccurs="unbounded"/>
  81. <xsd:element name="mapped-superclass" type="orm:mapped-superclass"
  82. minOccurs="0" maxOccurs="unbounded"/>
  83. <xsd:element name="entity" type="orm:entity"
  84. minOccurs="0" maxOccurs="unbounded"/>
  85. <xsd:element name="embeddable" type="orm:embeddable"
  86. minOccurs="0" maxOccurs="unbounded"/>
  87. </xsd:sequence>
  88. <xsd:attribute name="version" type="orm:versionType"
  89. fixed="1.0" use="required"/>
  90. </xsd:complexType>
  91. </xsd:element>
  92. <!-- **************************************************** -->
  93. <xsd:complexType name="persistence-unit-metadata">
  94. <xsd:annotation>
  95. <xsd:documentation>
  96. Metadata that applies to the persistence unit and not just to
  97. the mapping file in which it is contained.
  98. If the xml-mapping-metadata-complete element is specified then
  99. the complete set of mapping metadata for the persistence unit
  100. is contained in the XML mapping files for the persistence unit.
  101. </xsd:documentation>
  102. </xsd:annotation>
  103. <xsd:sequence>
  104. <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
  105. minOccurs="0"/>
  106. <xsd:element name="persistence-unit-defaults"
  107. type="orm:persistence-unit-defaults"
  108. minOccurs="0"/>
  109. </xsd:sequence>
  110. </xsd:complexType>
  111. <!-- **************************************************** -->
  112. <xsd:complexType name="persistence-unit-defaults">
  113. <xsd:annotation>
  114. <xsd:documentation>
  115. These defaults are applied to the persistence unit as a whole
  116. unless they are overridden by local annotation or XML
  117. element settings.
  118. schema - Used as the schema for all tables or secondary tables
  119. that apply to the persistence unit
  120. catalog - Used as the catalog for all tables or secondary tables
  121. that apply to the persistence unit
  122. access - Used as the access type for all managed classes in
  123. the persistence unit
  124. cascade-persist - Adds cascade-persist to the set of cascade options
  125. in entity relationships of the persistence unit
  126. entity-listeners - List of default entity listeners to be invoked
  127. on each entity in the persistence unit.
  128. </xsd:documentation>
  129. </xsd:annotation>
  130. <xsd:sequence>
  131. <xsd:element name="schema" type="xsd:string"
  132. minOccurs="0"/>
  133. <xsd:element name="catalog" type="xsd:string"
  134. minOccurs="0"/>
  135. <xsd:element name="access" type="orm:access-type"
  136. minOccurs="0"/>
  137. <xsd:element name="cascade-persist" type="orm:emptyType"
  138. minOccurs="0"/>
  139. <xsd:element name="entity-listeners" type="orm:entity-listeners"
  140. minOccurs="0"/>
  141. </xsd:sequence>
  142. </xsd:complexType>
  143. <!-- **************************************************** -->
  144. <xsd:complexType name="entity">
  145. <xsd:annotation>
  146. <xsd:documentation>
  147. Defines the settings and mappings for an entity. Is allowed to be
  148. sparsely populated and used in conjunction with the annotations.
  149. Alternatively, the metadata-complete attribute can be used to
  150. indicate that no annotations on the entity class (and its fields
  151. or properties) are to be processed. If this is the case then
  152. the defaulting rules for the entity and its subelements will
  153. be recursively applied.
  154. @Target(TYPE) @Retention(RUNTIME)
  155. public @interface Entity {
  156. String name() default "";
  157. }
  158. </xsd:documentation>
  159. </xsd:annotation>
  160. <xsd:sequence>
  161. <xsd:element name="description" type="xsd:string" minOccurs="0"/>
  162. <xsd:element name="table" type="orm:table"
  163. minOccurs="0"/>
  164. <xsd:element name="secondary-table" type="orm:secondary-table"
  165. minOccurs="0" maxOccurs="unbounded"/>
  166. <xsd:element name="primary-key-join-column"
  167. type="orm:primary-key-join-column"
  168. minOccurs="0" maxOccurs="unbounded"/>
  169. <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
  170. <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
  171. <xsd:element name="discriminator-value" type="orm:discriminator-value"
  172. minOccurs="0"/>
  173. <xsd:element name="discriminator-column"
  174. type="orm:discriminator-column"
  175. minOccurs="0"/>
  176. <xsd:element name="sequence-generator" type="orm:sequence-generator"
  177. minOccurs="0"/>
  178. <xsd:element name="table-generator" type="orm:table-generator"
  179. minOccurs="0"/>
  180. <xsd:element name="named-query" type="orm:named-query"
  181. minOccurs="0" maxOccurs="unbounded"/>
  182. <xsd:element name="named-native-query" type="orm:named-native-query"
  183. minOccurs="0" maxOccurs="unbounded"/>
  184. <xsd:element name="sql-result-set-mapping"
  185. type="orm:sql-result-set-mapping"
  186. minOccurs="0" maxOccurs="unbounded"/>
  187. <xsd:element name="exclude-default-listeners" type="orm:emptyType"
  188. minOccurs="0"/>
  189. <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
  190. minOccurs="0"/>
  191. <xsd:element name="entity-listeners" type="orm:entity-listeners"
  192. minOccurs="0"/>
  193. <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
  194. <xsd:element name="post-persist" type="orm:post-persist"
  195. minOccurs="0"/>
  196. <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
  197. <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
  198. <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
  199. <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
  200. <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
  201. <xsd:element name="attribute-override" type="orm:attribute-override"
  202. minOccurs="0" maxOccurs="unbounded"/>
  203. <xsd:element name="association-override"
  204. type="orm:association-override"
  205. minOccurs="0" maxOccurs="unbounded"/>
  206. <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
  207. </xsd:sequence>
  208. <xsd:attribute name="name" type="xsd:string"/>
  209. <xsd:attribute name="class" type="xsd:string" use="required"/>
  210. <xsd:attribute name="access" type="orm:access-type"/>
  211. <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
  212. </xsd:complexType>
  213. <!-- **************************************************** -->
  214. <xsd:complexType name="attributes">
  215. <xsd:annotation>
  216. <xsd:documentation>
  217. This element contains the entity field or property mappings.
  218. It may be sparsely populated to include only a subset of the
  219. fields or properties. If metadata-complete for the entity is true
  220. then the remainder of the attributes will be defaulted according
  221. to the default rules.
  222. </xsd:documentation>
  223. </xsd:annotation>
  224. <xsd:sequence>
  225. <xsd:choice>
  226. <xsd:element name="id" type="orm:id"
  227. minOccurs="0" maxOccurs="unbounded"/>
  228. <xsd:element name="embedded-id" type="orm:embedded-id"
  229. minOccurs="0"/>
  230. </xsd:choice>
  231. <xsd:element name="basic" type="orm:basic"
  232. minOccurs="0" maxOccurs="unbounded"/>
  233. <xsd:element name="version" type="orm:version"
  234. minOccurs="0" maxOccurs="unbounded"/>
  235. <xsd:element name="many-to-one" type="orm:many-to-one"
  236. minOccurs="0" maxOccurs="unbounded"/>
  237. <xsd:element name="one-to-many" type="orm:one-to-many"
  238. minOccurs="0" maxOccurs="unbounded"/>
  239. <xsd:element name="one-to-one" type="orm:one-to-one"
  240. minOccurs="0" maxOccurs="unbounded"/>
  241. <xsd:element name="many-to-many" type="orm:many-to-many"
  242. minOccurs="0" maxOccurs="unbounded"/>
  243. <xsd:element name="embedded" type="orm:embedded"
  244. minOccurs="0" maxOccurs="unbounded"/>
  245. <xsd:element name="transient" type="orm:transient"
  246. minOccurs="0" maxOccurs="unbounded"/>
  247. </xsd:sequence>
  248. </xsd:complexType>
  249. <!-- **************************************************** -->
  250. <xsd:simpleType name="access-type">
  251. <xsd:annotation>
  252. <xsd:documentation>
  253. This element determines how the persistence provider accesses the
  254. state of an entity or embedded object.
  255. </xsd:documentation>
  256. </xsd:annotation>
  257. <xsd:restriction base="xsd:token">
  258. <xsd:enumeration value="PROPERTY"/>
  259. <xsd:enumeration value="FIELD"/>
  260. </xsd:restriction>
  261. </xsd:simpleType>
  262. <!-- **************************************************** -->
  263. <xsd:complexType name="entity-listeners">
  264. <xsd:annotation>
  265. <xsd:documentation>
  266. @Target({TYPE}) @Retention(RUNTIME)
  267. public @interface EntityListeners {
  268. Class[] value();
  269. }
  270. </xsd:documentation>
  271. </xsd:annotation>
  272. <xsd:sequence>
  273. <xsd:element name="entity-listener" type="orm:entity-listener"
  274. minOccurs="0" maxOccurs="unbounded"/>
  275. </xsd:sequence>
  276. </xsd:complexType>
  277. <!-- **************************************************** -->
  278. <xsd:complexType name="entity-listener">
  279. <xsd:annotation>
  280. <xsd:documentation>
  281. Defines an entity listener to be invoked at lifecycle events
  282. for the entities that list this listener.
  283. </xsd:documentation>
  284. </xsd:annotation>
  285. <xsd:sequence>
  286. <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
  287. <xsd:element name="post-persist" type="orm:post-persist"
  288. minOccurs="0"/>
  289. <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
  290. <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
  291. <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
  292. <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
  293. <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
  294. </xsd:sequence>
  295. <xsd:attribute name="class" type="xsd:string" use="required"/>
  296. </xsd:complexType>
  297. <!-- **************************************************** -->
  298. <xsd:complexType name="pre-persist">
  299. <xsd:annotation>
  300. <xsd:documentation>
  301. @Target({METHOD}) @Retention(RUNTIME)
  302. public @interface PrePersist {}
  303. </xsd:documentation>
  304. </xsd:annotation>
  305. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  306. </xsd:complexType>
  307. <!-- **************************************************** -->
  308. <xsd:complexType name="post-persist">
  309. <xsd:annotation>
  310. <xsd:documentation>
  311. @Target({METHOD}) @Retention(RUNTIME)
  312. public @interface PostPersist {}
  313. </xsd:documentation>
  314. </xsd:annotation>
  315. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  316. </xsd:complexType>
  317. <!-- **************************************************** -->
  318. <xsd:complexType name="pre-remove">
  319. <xsd:annotation>
  320. <xsd:documentation>
  321. @Target({METHOD}) @Retention(RUNTIME)
  322. public @interface PreRemove {}
  323. </xsd:documentation>
  324. </xsd:annotation>
  325. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  326. </xsd:complexType>
  327. <!-- **************************************************** -->
  328. <xsd:complexType name="post-remove">
  329. <xsd:annotation>
  330. <xsd:documentation>
  331. @Target({METHOD}) @Retention(RUNTIME)
  332. public @interface PostRemove {}
  333. </xsd:documentation>
  334. </xsd:annotation>
  335. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  336. </xsd:complexType>
  337. <!-- **************************************************** -->
  338. <xsd:complexType name="pre-update">
  339. <xsd:annotation>
  340. <xsd:documentation>
  341. @Target({METHOD}) @Retention(RUNTIME)
  342. public @interface PreUpdate {}
  343. </xsd:documentation>
  344. </xsd:annotation>
  345. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  346. </xsd:complexType>
  347. <!-- **************************************************** -->
  348. <xsd:complexType name="post-update">
  349. <xsd:annotation>
  350. <xsd:documentation>
  351. @Target({METHOD}) @Retention(RUNTIME)
  352. public @interface PostUpdate {}
  353. </xsd:documentation>
  354. </xsd:annotation>
  355. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  356. </xsd:complexType>
  357. <!-- **************************************************** -->
  358. <xsd:complexType name="post-load">
  359. <xsd:annotation>
  360. <xsd:documentation>
  361. @Target({METHOD}) @Retention(RUNTIME)
  362. public @interface PostLoad {}
  363. </xsd:documentation>
  364. </xsd:annotation>
  365. <xsd:attribute name="method-name" type="xsd:string" use="required"/>
  366. </xsd:complexType>
  367. <!-- **************************************************** -->
  368. <xsd:complexType name="query-hint">
  369. <xsd:annotation>
  370. <xsd:documentation>
  371. @Target({}) @Retention(RUNTIME)
  372. public @interface QueryHint {
  373. String name();
  374. String value();
  375. }
  376. </xsd:documentation>
  377. </xsd:annotation>
  378. <xsd:attribute name="name" type="xsd:string" use="required"/>
  379. <xsd:attribute name="value" type="xsd:string" use="required"/>
  380. </xsd:complexType>
  381. <!-- **************************************************** -->
  382. <xsd:complexType name="named-query">
  383. <xsd:annotation>
  384. <xsd:documentation>
  385. @Target({TYPE}) @Retention(RUNTIME)
  386. public @interface NamedQuery {
  387. String name();
  388. String query();
  389. QueryHint[] hints() default {};
  390. }
  391. </xsd:documentation>
  392. </xsd:annotation>
  393. <xsd:sequence>
  394. <xsd:element name="query" type="xsd:string"/>
  395. <xsd:element name="hint" type="orm:query-hint"
  396. minOccurs="0" maxOccurs="unbounded"/>
  397. </xsd:sequence>
  398. <xsd:attribute name="name" type="xsd:string" use="required"/>
  399. </xsd:complexType>
  400. <!-- **************************************************** -->
  401. <xsd:complexType name="named-native-query">
  402. <xsd:annotation>
  403. <xsd:documentation>
  404. @Target({TYPE}) @Retention(RUNTIME)
  405. public @interface NamedNativeQuery {
  406. String name();
  407. String query();
  408. QueryHint[] hints() default {};
  409. Class resultClass() default void.class;
  410. String resultSetMapping() default ""; //named SqlResultSetMapping
  411. }
  412. </xsd:documentation>
  413. </xsd:annotation>
  414. <xsd:sequence>
  415. <xsd:element name="query" type="xsd:string"/>
  416. <xsd:element name="hint" type="orm:query-hint"
  417. minOccurs="0" maxOccurs="unbounded"/>
  418. </xsd:sequence>
  419. <xsd:attribute name="name" type="xsd:string" use="required"/>
  420. <xsd:attribute name="result-class" type="xsd:string"/>
  421. <xsd:attribute name="result-set-mapping" type="xsd:string"/>
  422. </xsd:complexType>
  423. <!-- **************************************************** -->
  424. <xsd:complexType name="sql-result-set-mapping">
  425. <xsd:annotation>
  426. <xsd:documentation>
  427. @Target({TYPE}) @Retention(RUNTIME)
  428. public @interface SqlResultSetMapping {
  429. String name();
  430. EntityResult[] entities() default {};
  431. ColumnResult[] columns() default {};
  432. }
  433. </xsd:documentation>
  434. </xsd:annotation>
  435. <xsd:sequence>
  436. <xsd:element name="entity-result" type="orm:entity-result"
  437. minOccurs="0" maxOccurs="unbounded"/>
  438. <xsd:element name="column-result" type="orm:column-result"
  439. minOccurs="0" maxOccurs="unbounded"/>
  440. </xsd:sequence>
  441. <xsd:attribute name="name" type="xsd:string" use="required"/>
  442. </xsd:complexType>
  443. <!-- **************************************************** -->
  444. <xsd:complexType name="entity-result">
  445. <xsd:annotation>
  446. <xsd:documentation>
  447. @Target({}) @Retention(RUNTIME)
  448. public @interface EntityResult {
  449. Class entityClass();
  450. FieldResult[] fields() default {};
  451. String discriminatorColumn() default "";
  452. }
  453. </xsd:documentation>
  454. </xsd:annotation>
  455. <xsd:sequence>
  456. <xsd:element name="field-result" type="orm:field-result"
  457. minOccurs="0" maxOccurs="unbounded"/>
  458. </xsd:sequence>
  459. <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
  460. <xsd:attribute name="discriminator-column" type="xsd:string"/>
  461. </xsd:complexType>
  462. <!-- **************************************************** -->
  463. <xsd:complexType name="field-result">
  464. <xsd:annotation>
  465. <xsd:documentation>
  466. @Target({}) @Retention(RUNTIME)
  467. public @interface FieldResult {
  468. String name();
  469. String column();
  470. }
  471. </xsd:documentation>
  472. </xsd:annotation>
  473. <xsd:attribute name="name" type="xsd:string" use="required"/>
  474. <xsd:attribute name="column" type="xsd:string" use="required"/>
  475. </xsd:complexType>
  476. <!-- **************************************************** -->
  477. <xsd:complexType name="column-result">
  478. <xsd:annotation>
  479. <xsd:documentation>
  480. @Target({}) @Retention(RUNTIME)
  481. public @interface ColumnResult {
  482. String name();
  483. }
  484. </xsd:documentation>
  485. </xsd:annotation>
  486. <xsd:attribute name="name" type="xsd:string" use="required"/>
  487. </xsd:complexType>
  488. <!-- **************************************************** -->
  489. <xsd:complexType name="table">
  490. <xsd:annotation>
  491. <xsd:documentation>
  492. @Target({TYPE}) @Retention(RUNTIME)
  493. public @interface Table {
  494. String name() default "";
  495. String catalog() default "";
  496. String schema() default "";
  497. UniqueConstraint[] uniqueConstraints() default {};
  498. }
  499. </xsd:documentation>
  500. </xsd:annotation>
  501. <xsd:sequence>
  502. <xsd:element name="unique-constraint" type="orm:unique-constraint"
  503. minOccurs="0" maxOccurs="unbounded"/>
  504. </xsd:sequence>
  505. <xsd:attribute name="name" type="xsd:string"/>
  506. <xsd:attribute name="catalog" type="xsd:string"/>
  507. <xsd:attribute name="schema" type="xsd:string"/>
  508. </xsd:complexType>
  509. <!-- **************************************************** -->
  510. <xsd:complexType name="secondary-table">
  511. <xsd:annotation>
  512. <xsd:documentation>
  513. @Target({TYPE}) @Retention(RUNTIME)
  514. public @interface SecondaryTable {
  515. String name();
  516. String catalog() default "";
  517. String schema() default "";
  518. PrimaryKeyJoinColumn[] pkJoinColumns() default {};
  519. UniqueConstraint[] uniqueConstraints() default {};
  520. }
  521. </xsd:documentation>
  522. </xsd:annotation>
  523. <xsd:sequence>
  524. <xsd:element name="primary-key-join-column"
  525. type="orm:primary-key-join-column"
  526. minOccurs="0" maxOccurs="unbounded"/>
  527. <xsd:element name="unique-constraint" type="orm:unique-constraint"
  528. minOccurs="0" maxOccurs="unbounded"/>
  529. </xsd:sequence>
  530. <xsd:attribute name="name" type="xsd:string" use="required"/>
  531. <xsd:attribute name="catalog" type="xsd:string"/>
  532. <xsd:attribute name="schema" type="xsd:string"/>
  533. </xsd:complexType>
  534. <!-- **************************************************** -->
  535. <xsd:complexType name="unique-constraint">
  536. <xsd:annotation>
  537. <xsd:documentation>
  538. @Target({}) @Retention(RUNTIME)
  539. public @interface UniqueConstraint {
  540. String[] columnNames();
  541. }
  542. </xsd:documentation>
  543. </xsd:annotation>
  544. <xsd:sequence>
  545. <xsd:element name="column-name" type="xsd:string"
  546. maxOccurs="unbounded"/>
  547. </xsd:sequence>
  548. </xsd:complexType>
  549. <!-- **************************************************** -->
  550. <xsd:complexType name="column">
  551. <xsd:annotation>
  552. <xsd:documentation>
  553. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  554. public @interface Column {
  555. String name() default "";
  556. boolean unique() default false;
  557. boolean nullable() default true;
  558. boolean insertable() default true;
  559. boolean updatable() default true;
  560. String columnDefinition() default "";
  561. String table() default "";
  562. int length() default 255;
  563. int precision() default 0; // decimal precision
  564. int scale() default 0; // decimal scale
  565. }
  566. </xsd:documentation>
  567. </xsd:annotation>
  568. <xsd:attribute name="name" type="xsd:string"/>
  569. <xsd:attribute name="unique" type="xsd:boolean"/>
  570. <xsd:attribute name="nullable" type="xsd:boolean"/>
  571. <xsd:attribute name="insertable" type="xsd:boolean"/>
  572. <xsd:attribute name="updatable" type="xsd:boolean"/>
  573. <xsd:attribute name="column-definition" type="xsd:string"/>
  574. <xsd:attribute name="table" type="xsd:string"/>
  575. <xsd:attribute name="length" type="xsd:int"/>
  576. <xsd:attribute name="precision" type="xsd:int"/>
  577. <xsd:attribute name="scale" type="xsd:int"/>
  578. </xsd:complexType>
  579. <!-- **************************************************** -->
  580. <xsd:complexType name="join-column">
  581. <xsd:annotation>
  582. <xsd:documentation>
  583. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  584. public @interface JoinColumn {
  585. String name() default "";
  586. String referencedColumnName() default "";
  587. boolean unique() default false;
  588. boolean nullable() default true;
  589. boolean insertable() default true;
  590. boolean updatable() default true;
  591. String columnDefinition() default "";
  592. String table() default "";
  593. }
  594. </xsd:documentation>
  595. </xsd:annotation>
  596. <xsd:attribute name="name" type="xsd:string"/>
  597. <xsd:attribute name="referenced-column-name" type="xsd:string"/>
  598. <xsd:attribute name="unique" type="xsd:boolean"/>
  599. <xsd:attribute name="nullable" type="xsd:boolean"/>
  600. <xsd:attribute name="insertable" type="xsd:boolean"/>
  601. <xsd:attribute name="updatable" type="xsd:boolean"/>
  602. <xsd:attribute name="column-definition" type="xsd:string"/>
  603. <xsd:attribute name="table" type="xsd:string"/>
  604. </xsd:complexType>
  605. <!-- **************************************************** -->
  606. <xsd:simpleType name="generation-type">
  607. <xsd:annotation>
  608. <xsd:documentation>
  609. public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
  610. </xsd:documentation>
  611. </xsd:annotation>
  612. <xsd:restriction base="xsd:token">
  613. <xsd:enumeration value="TABLE"/>
  614. <xsd:enumeration value="SEQUENCE"/>
  615. <xsd:enumeration value="IDENTITY"/>
  616. <xsd:enumeration value="AUTO"/>
  617. </xsd:restriction>
  618. </xsd:simpleType>
  619. <!-- **************************************************** -->
  620. <xsd:complexType name="attribute-override">
  621. <xsd:annotation>
  622. <xsd:documentation>
  623. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
  624. public @interface AttributeOverride {
  625. String name();
  626. Column column();
  627. }
  628. </xsd:documentation>
  629. </xsd:annotation>
  630. <xsd:sequence>
  631. <xsd:element name="column" type="orm:column"/>
  632. </xsd:sequence>
  633. <xsd:attribute name="name" type="xsd:string" use="required"/>
  634. </xsd:complexType>
  635. <!-- **************************************************** -->
  636. <xsd:complexType name="association-override">
  637. <xsd:annotation>
  638. <xsd:documentation>
  639. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
  640. public @interface AssociationOverride {
  641. String name();
  642. JoinColumn[] joinColumns();
  643. }
  644. </xsd:documentation>
  645. </xsd:annotation>
  646. <xsd:sequence>
  647. <xsd:element name="join-column" type="orm:join-column"
  648. maxOccurs="unbounded"/>
  649. </xsd:sequence>
  650. <xsd:attribute name="name" type="xsd:string" use="required"/>
  651. </xsd:complexType>
  652. <!-- **************************************************** -->
  653. <xsd:complexType name="id-class">
  654. <xsd:annotation>
  655. <xsd:documentation>
  656. @Target({TYPE}) @Retention(RUNTIME)
  657. public @interface IdClass {
  658. Class value();
  659. }
  660. </xsd:documentation>
  661. </xsd:annotation>
  662. <xsd:attribute name="class" type="xsd:string" use="required"/>
  663. </xsd:complexType>
  664. <!-- **************************************************** -->
  665. <xsd:complexType name="id">
  666. <xsd:annotation>
  667. <xsd:documentation>
  668. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  669. public @interface Id {}
  670. </xsd:documentation>
  671. </xsd:annotation>
  672. <xsd:sequence>
  673. <xsd:element name="column" type="orm:column"
  674. minOccurs="0"/>
  675. <xsd:element name="generated-value" type="orm:generated-value"
  676. minOccurs="0"/>
  677. <xsd:element name="temporal" type="orm:temporal"
  678. minOccurs="0"/>
  679. <xsd:element name="table-generator" type="orm:table-generator"
  680. minOccurs="0"/>
  681. <xsd:element name="sequence-generator" type="orm:sequence-generator"
  682. minOccurs="0"/>
  683. </xsd:sequence>
  684. <xsd:attribute name="name" type="xsd:string" use="required"/>
  685. </xsd:complexType>
  686. <!-- **************************************************** -->
  687. <xsd:complexType name="embedded-id">
  688. <xsd:annotation>
  689. <xsd:documentation>
  690. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  691. public @interface EmbeddedId {}
  692. </xsd:documentation>
  693. </xsd:annotation>
  694. <xsd:sequence>
  695. <xsd:element name="attribute-override" type="orm:attribute-override"
  696. minOccurs="0" maxOccurs="unbounded"/>
  697. </xsd:sequence>
  698. <xsd:attribute name="name" type="xsd:string" use="required"/>
  699. </xsd:complexType>
  700. <!-- **************************************************** -->
  701. <xsd:complexType name="transient">
  702. <xsd:annotation>
  703. <xsd:documentation>
  704. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  705. public @interface Transient {}
  706. </xsd:documentation>
  707. </xsd:annotation>
  708. <xsd:attribute name="name" type="xsd:string" use="required"/>
  709. </xsd:complexType>
  710. <!-- **************************************************** -->
  711. <xsd:complexType name="version">
  712. <xsd:annotation>
  713. <xsd:documentation>
  714. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  715. public @interface Version {}
  716. </xsd:documentation>
  717. </xsd:annotation>
  718. <xsd:sequence>
  719. <xsd:element name="column" type="orm:column" minOccurs="0"/>
  720. <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
  721. </xsd:sequence>
  722. <xsd:attribute name="name" type="xsd:string" use="required"/>
  723. </xsd:complexType>
  724. <!-- **************************************************** -->
  725. <xsd:complexType name="basic">
  726. <xsd:annotation>
  727. <xsd:documentation>
  728. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  729. public @interface Basic {
  730. FetchType fetch() default EAGER;
  731. boolean optional() default true;
  732. }
  733. </xsd:documentation>
  734. </xsd:annotation>
  735. <xsd:sequence>
  736. <xsd:element name="column" type="orm:column" minOccurs="0"/>
  737. <xsd:choice>
  738. <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
  739. <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
  740. <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
  741. </xsd:choice>
  742. </xsd:sequence>
  743. <xsd:attribute name="name" type="xsd:string" use="required"/>
  744. <xsd:attribute name="fetch" type="orm:fetch-type"/>
  745. <xsd:attribute name="optional" type="xsd:boolean"/>
  746. </xsd:complexType>
  747. <!-- **************************************************** -->
  748. <xsd:simpleType name="fetch-type">
  749. <xsd:annotation>
  750. <xsd:documentation>
  751. public enum FetchType { LAZY, EAGER };
  752. </xsd:documentation>
  753. </xsd:annotation>
  754. <xsd:restriction base="xsd:token">
  755. <xsd:enumeration value="LAZY"/>
  756. <xsd:enumeration value="EAGER"/>
  757. </xsd:restriction>
  758. </xsd:simpleType>
  759. <!-- **************************************************** -->
  760. <xsd:complexType name="lob">
  761. <xsd:annotation>
  762. <xsd:documentation>
  763. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  764. public @interface Lob {}
  765. </xsd:documentation>
  766. </xsd:annotation>
  767. </xsd:complexType>
  768. <!-- **************************************************** -->
  769. <xsd:simpleType name="temporal">
  770. <xsd:annotation>
  771. <xsd:documentation>
  772. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  773. public @interface Temporal {
  774. TemporalType value();
  775. }
  776. </xsd:documentation>
  777. </xsd:annotation>
  778. <xsd:restriction base="orm:temporal-type"/>
  779. </xsd:simpleType>
  780. <!-- **************************************************** -->
  781. <xsd:simpleType name="temporal-type">
  782. <xsd:annotation>
  783. <xsd:documentation>
  784. public enum TemporalType {
  785. DATE, // java.sql.Date
  786. TIME, // java.sql.Time
  787. TIMESTAMP // java.sql.Timestamp
  788. }
  789. </xsd:documentation>
  790. </xsd:annotation>
  791. <xsd:restriction base="xsd:token">
  792. <xsd:enumeration value="DATE"/>
  793. <xsd:enumeration value="TIME"/>
  794. <xsd:enumeration value="TIMESTAMP"/>
  795. </xsd:restriction>
  796. </xsd:simpleType>
  797. <!-- **************************************************** -->
  798. <xsd:simpleType name="enumerated">
  799. <xsd:annotation>
  800. <xsd:documentation>
  801. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  802. public @interface Enumerated {
  803. EnumType value() default ORDINAL;
  804. }
  805. </xsd:documentation>
  806. </xsd:annotation>
  807. <xsd:restriction base="orm:enum-type"/>
  808. </xsd:simpleType>
  809. <!-- **************************************************** -->
  810. <xsd:simpleType name="enum-type">
  811. <xsd:annotation>
  812. <xsd:documentation>
  813. public enum EnumType {
  814. ORDINAL,
  815. STRING
  816. }
  817. </xsd:documentation>
  818. </xsd:annotation>
  819. <xsd:restriction base="xsd:token">
  820. <xsd:enumeration value="ORDINAL"/>
  821. <xsd:enumeration value="STRING"/>
  822. </xsd:restriction>
  823. </xsd:simpleType>
  824. <!-- **************************************************** -->
  825. <xsd:complexType name="many-to-one">
  826. <xsd:annotation>
  827. <xsd:documentation>
  828. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  829. public @interface ManyToOne {
  830. Class targetEntity() default void.class;
  831. CascadeType[] cascade() default {};
  832. FetchType fetch() default EAGER;
  833. boolean optional() default true;
  834. }
  835. </xsd:documentation>
  836. </xsd:annotation>
  837. <xsd:sequence>
  838. <xsd:choice>
  839. <xsd:element name="join-column" type="orm:join-column"
  840. minOccurs="0" maxOccurs="unbounded"/>
  841. <xsd:element name="join-table" type="orm:join-table"
  842. minOccurs="0"/>
  843. </xsd:choice>
  844. <xsd:element name="cascade" type="orm:cascade-type"
  845. minOccurs="0"/>
  846. </xsd:sequence>
  847. <xsd:attribute name="name" type="xsd:string" use="required"/>
  848. <xsd:attribute name="target-entity" type="xsd:string"/>
  849. <xsd:attribute name="fetch" type="orm:fetch-type"/>
  850. <xsd:attribute name="optional" type="xsd:boolean"/>
  851. </xsd:complexType>
  852. <!-- **************************************************** -->
  853. <xsd:complexType name="cascade-type">
  854. <xsd:annotation>
  855. <xsd:documentation>
  856. public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
  857. </xsd:documentation>
  858. </xsd:annotation>
  859. <xsd:sequence>
  860. <xsd:element name="cascade-all" type="orm:emptyType"
  861. minOccurs="0"/>
  862. <xsd:element name="cascade-persist" type="orm:emptyType"
  863. minOccurs="0"/>
  864. <xsd:element name="cascade-merge" type="orm:emptyType"
  865. minOccurs="0"/>
  866. <xsd:element name="cascade-remove" type="orm:emptyType"
  867. minOccurs="0"/>
  868. <xsd:element name="cascade-refresh" type="orm:emptyType"
  869. minOccurs="0"/>
  870. </xsd:sequence>
  871. </xsd:complexType>
  872. <!-- **************************************************** -->
  873. <xsd:complexType name="one-to-one">
  874. <xsd:annotation>
  875. <xsd:documentation>
  876. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  877. public @interface OneToOne {
  878. Class targetEntity() default void.class;
  879. CascadeType[] cascade() default {};
  880. FetchType fetch() default EAGER;
  881. boolean optional() default true;
  882. String mappedBy() default "";
  883. }
  884. </xsd:documentation>
  885. </xsd:annotation>
  886. <xsd:sequence>
  887. <xsd:choice>
  888. <xsd:element name="primary-key-join-column"
  889. type="orm:primary-key-join-column"
  890. minOccurs="0" maxOccurs="unbounded"/>
  891. <xsd:element name="join-column" type="orm:join-column"
  892. minOccurs="0" maxOccurs="unbounded"/>
  893. <xsd:element name="join-table" type="orm:join-table"
  894. minOccurs="0"/>
  895. </xsd:choice>
  896. <xsd:element name="cascade" type="orm:cascade-type"
  897. minOccurs="0"/>
  898. </xsd:sequence>
  899. <xsd:attribute name="name" type="xsd:string" use="required"/>
  900. <xsd:attribute name="target-entity" type="xsd:string"/>
  901. <xsd:attribute name="fetch" type="orm:fetch-type"/>
  902. <xsd:attribute name="optional" type="xsd:boolean"/>
  903. <xsd:attribute name="mapped-by" type="xsd:string"/>
  904. </xsd:complexType>
  905. <!-- **************************************************** -->
  906. <xsd:complexType name="one-to-many">
  907. <xsd:annotation>
  908. <xsd:documentation>
  909. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  910. public @interface OneToMany {
  911. Class targetEntity() default void.class;
  912. CascadeType[] cascade() default {};
  913. FetchType fetch() default LAZY;
  914. String mappedBy() default "";
  915. }
  916. </xsd:documentation>
  917. </xsd:annotation>
  918. <xsd:sequence>
  919. <xsd:element name="order-by" type="orm:order-by"
  920. minOccurs="0"/>
  921. <xsd:element name="map-key" type="orm:map-key"
  922. minOccurs="0"/>
  923. <xsd:choice>
  924. <xsd:element name="join-table" type="orm:join-table"
  925. minOccurs="0"/>
  926. <xsd:element name="join-column" type="orm:join-column"
  927. minOccurs="0" maxOccurs="unbounded"/>
  928. </xsd:choice>
  929. <xsd:element name="cascade" type="orm:cascade-type"
  930. minOccurs="0"/>
  931. </xsd:sequence>
  932. <xsd:attribute name="name" type="xsd:string" use="required"/>
  933. <xsd:attribute name="target-entity" type="xsd:string"/>
  934. <xsd:attribute name="fetch" type="orm:fetch-type"/>
  935. <xsd:attribute name="mapped-by" type="xsd:string"/>
  936. </xsd:complexType>
  937. <!-- **************************************************** -->
  938. <xsd:complexType name="join-table">
  939. <xsd:annotation>
  940. <xsd:documentation>
  941. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  942. public @interface JoinTable {
  943. String name() default "";
  944. String catalog() default "";
  945. String schema() default "";
  946. JoinColumn[] joinColumns() default {};
  947. JoinColumn[] inverseJoinColumns() default {};
  948. UniqueConstraint[] uniqueConstraints() default {};
  949. }
  950. </xsd:documentation>
  951. </xsd:annotation>
  952. <xsd:sequence>
  953. <xsd:element name="join-column" type="orm:join-column"
  954. minOccurs="0" maxOccurs="unbounded"/>
  955. <xsd:element name="inverse-join-column" type="orm:join-column"
  956. minOccurs="0" maxOccurs="unbounded"/>
  957. <xsd:element name="unique-constraint" type="orm:unique-constraint"
  958. minOccurs="0" maxOccurs="unbounded"/>
  959. </xsd:sequence>
  960. <xsd:attribute name="name" type="xsd:string"/>
  961. <xsd:attribute name="catalog" type="xsd:string"/>
  962. <xsd:attribute name="schema" type="xsd:string"/>
  963. </xsd:complexType>
  964. <!-- **************************************************** -->
  965. <xsd:complexType name="many-to-many">
  966. <xsd:annotation>
  967. <xsd:documentation>
  968. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  969. public @interface ManyToMany {
  970. Class targetEntity() default void.class;
  971. CascadeType[] cascade() default {};
  972. FetchType fetch() default LAZY;
  973. String mappedBy() default "";
  974. }
  975. </xsd:documentation>
  976. </xsd:annotation>
  977. <xsd:sequence>
  978. <xsd:element name="order-by" type="orm:order-by"
  979. minOccurs="0"/>
  980. <xsd:element name="map-key" type="orm:map-key"
  981. minOccurs="0"/>
  982. <xsd:element name="join-table" type="orm:join-table"
  983. minOccurs="0"/>
  984. <xsd:element name="cascade" type="orm:cascade-type"
  985. minOccurs="0"/>
  986. </xsd:sequence>
  987. <xsd:attribute name="name" type="xsd:string" use="required"/>
  988. <xsd:attribute name="target-entity" type="xsd:string"/>
  989. <xsd:attribute name="fetch" type="orm:fetch-type"/>
  990. <xsd:attribute name="mapped-by" type="xsd:string"/>
  991. </xsd:complexType>
  992. <!-- **************************************************** -->
  993. <xsd:complexType name="generated-value">
  994. <xsd:annotation>
  995. <xsd:documentation>
  996. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  997. public @interface GeneratedValue {
  998. GenerationType strategy() default AUTO;
  999. String generator() default "";
  1000. }
  1001. </xsd:documentation>
  1002. </xsd:annotation>
  1003. <xsd:attribute name="strategy" type="orm:generation-type"/>
  1004. <xsd:attribute name="generator" type="xsd:string"/>
  1005. </xsd:complexType>
  1006. <!-- **************************************************** -->
  1007. <xsd:complexType name="map-key">
  1008. <xsd:annotation>
  1009. <xsd:documentation>
  1010. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  1011. public @interface MapKey {
  1012. String name() default "";
  1013. }
  1014. </xsd:documentation>
  1015. </xsd:annotation>
  1016. <xsd:attribute name="name" type="xsd:string"/>
  1017. </xsd:complexType>
  1018. <!-- **************************************************** -->
  1019. <xsd:simpleType name="order-by">
  1020. <xsd:annotation>
  1021. <xsd:documentation>
  1022. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  1023. public @interface OrderBy {
  1024. String value() default "";
  1025. }
  1026. </xsd:documentation>
  1027. </xsd:annotation>
  1028. <xsd:restriction base="xsd:string"/>
  1029. </xsd:simpleType>
  1030. <!-- **************************************************** -->
  1031. <xsd:complexType name="inheritance">
  1032. <xsd:annotation>
  1033. <xsd:documentation>
  1034. @Target({TYPE}) @Retention(RUNTIME)
  1035. public @interface Inheritance {
  1036. InheritanceType strategy() default SINGLE_TABLE;
  1037. }
  1038. </xsd:documentation>
  1039. </xsd:annotation>
  1040. <xsd:attribute name="strategy" type="orm:inheritance-type"/>
  1041. </xsd:complexType>
  1042. <!-- **************************************************** -->
  1043. <xsd:simpleType name="inheritance-type">
  1044. <xsd:annotation>
  1045. <xsd:documentation>
  1046. public enum InheritanceType
  1047. { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
  1048. </xsd:documentation>
  1049. </xsd:annotation>
  1050. <xsd:restriction base="xsd:token">
  1051. <xsd:enumeration value="SINGLE_TABLE"/>
  1052. <xsd:enumeration value="JOINED"/>
  1053. <xsd:enumeration value="TABLE_PER_CLASS"/>
  1054. </xsd:restriction>
  1055. </xsd:simpleType>
  1056. <!-- **************************************************** -->
  1057. <xsd:simpleType name="discriminator-value">
  1058. <xsd:annotation>
  1059. <xsd:documentation>
  1060. @Target({TYPE}) @Retention(RUNTIME)
  1061. public @interface DiscriminatorValue {
  1062. String value();
  1063. }
  1064. </xsd:documentation>
  1065. </xsd:annotation>
  1066. <xsd:restriction base="xsd:string"/>
  1067. </xsd:simpleType>
  1068. <!-- **************************************************** -->
  1069. <xsd:simpleType name="discriminator-type">
  1070. <xsd:annotation>
  1071. <xsd:documentation>
  1072. public enum DiscriminatorType { STRING, CHAR, INTEGER };
  1073. </xsd:documentation>
  1074. </xsd:annotation>
  1075. <xsd:restriction base="xsd:token">
  1076. <xsd:enumeration value="STRING"/>
  1077. <xsd:enumeration value="CHAR"/>
  1078. <xsd:enumeration value="INTEGER"/>
  1079. </xsd:restriction>
  1080. </xsd:simpleType>
  1081. <!-- **************************************************** -->
  1082. <xsd:complexType name="primary-key-join-column">
  1083. <xsd:annotation>
  1084. <xsd:documentation>
  1085. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
  1086. public @interface PrimaryKeyJoinColumn {
  1087. String name() default "";
  1088. String referencedColumnName() default "";
  1089. String columnDefinition() default "";
  1090. }
  1091. </xsd:documentation>
  1092. </xsd:annotation>
  1093. <xsd:attribute name="name" type="xsd:string"/>
  1094. <xsd:attribute name="referenced-column-name" type="xsd:string"/>
  1095. <xsd:attribute name="column-definition" type="xsd:string"/>
  1096. </xsd:complexType>
  1097. <!-- **************************************************** -->
  1098. <xsd:complexType name="discriminator-column">
  1099. <xsd:annotation>
  1100. <xsd:documentation>
  1101. @Target({TYPE}) @Retention(RUNTIME)
  1102. public @interface DiscriminatorColumn {
  1103. String name() default "DTYPE";
  1104. DiscriminatorType discriminatorType() default STRING;
  1105. String columnDefinition() default "";
  1106. int length() default 31;
  1107. }
  1108. </xsd:documentation>
  1109. </xsd:annotation>
  1110. <xsd:attribute name="name" type="xsd:string"/>
  1111. <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
  1112. <xsd:attribute name="column-definition" type="xsd:string"/>
  1113. <xsd:attribute name="length" type="xsd:int"/>
  1114. </xsd:complexType>
  1115. <!-- **************************************************** -->
  1116. <xsd:complexType name="embeddable">
  1117. <xsd:annotation>
  1118. <xsd:documentation>
  1119. Defines the settings and mappings for embeddable objects. Is
  1120. allowed to be sparsely populated and used in conjunction with
  1121. the annotations. Alternatively, the metadata-complete attribute
  1122. can be used to indicate that no annotations are to be processed
  1123. in the class. If this is the case then the defaulting rules will
  1124. be recursively applied.
  1125. @Target({TYPE}) @Retention(RUNTIME)
  1126. public @interface Embeddable {}
  1127. </xsd:documentation>
  1128. </xsd:annotation>
  1129. <xsd:sequence>
  1130. <xsd:element name="description" type="xsd:string" minOccurs="0"/>
  1131. <xsd:element name="attributes" type="orm:embeddable-attributes"
  1132. minOccurs="0"/>
  1133. </xsd:sequence>
  1134. <xsd:attribute name="class" type="xsd:string" use="required"/>
  1135. <xsd:attribute name="access" type="orm:access-type"/>
  1136. <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
  1137. </xsd:complexType>
  1138. <!-- **************************************************** -->
  1139. <xsd:complexType name="embeddable-attributes">
  1140. <xsd:sequence>
  1141. <xsd:element name="basic" type="orm:basic"
  1142. minOccurs="0" maxOccurs="unbounded"/>
  1143. <xsd:element name="transient" type="orm:transient"
  1144. minOccurs="0" maxOccurs="unbounded"/>
  1145. </xsd:sequence>
  1146. </xsd:complexType>
  1147. <!-- **************************************************** -->
  1148. <xsd:complexType name="embedded">
  1149. <xsd:annotation>
  1150. <xsd:documentation>
  1151. @Target({METHOD, FIELD}) @Retention(RUNTIME)
  1152. public @interface Embedded {}
  1153. </xsd:documentation>
  1154. </xsd:annotation>
  1155. <xsd:sequence>
  1156. <xsd:element name="attribute-override" type="orm:attribute-override"
  1157. minOccurs="0" maxOccurs="unbounded"/>
  1158. </xsd:sequence>
  1159. <xsd:attribute name="name" type="xsd:string" use="required"/>
  1160. </xsd:complexType>
  1161. <!-- **************************************************** -->
  1162. <xsd:complexType name="mapped-superclass">
  1163. <xsd:annotation>
  1164. <xsd:documentation>
  1165. Defines the settings and mappings for a mapped superclass. Is
  1166. allowed to be sparsely populated and used in conjunction with
  1167. the annotations. Alternatively, the metadata-complete attribute
  1168. can be used to indicate that no annotations are to be processed
  1169. If this is the case then the defaulting rules will be recursively
  1170. applied.
  1171. @Target(TYPE) @Retention(RUNTIME)
  1172. public @interface MappedSuperclass{}
  1173. </xsd:documentation>
  1174. </xsd:annotation>
  1175. <xsd:sequence>
  1176. <xsd:element name="description" type="xsd:string" minOccurs="0"/>
  1177. <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
  1178. <xsd:element name="exclude-default-listeners" type="orm:emptyType"
  1179. minOccurs="0"/>
  1180. <xsd:element name="exclude-superclass-listeners" type="orm:emptyType"
  1181. minOccurs="0"/>
  1182. <xsd:element name="entity-listeners" type="orm:entity-listeners"
  1183. minOccurs="0"/>
  1184. <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
  1185. <xsd:element name="post-persist" type="orm:post-persist"
  1186. minOccurs="0"/>
  1187. <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
  1188. <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
  1189. <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
  1190. <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
  1191. <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
  1192. <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
  1193. </xsd:sequence>
  1194. <xsd:attribute name="class" type="xsd:string" use="required"/>
  1195. <xsd:attribute name="access" type="orm:access-type"/>
  1196. <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
  1197. </xsd:complexType>
  1198. <!-- **************************************************** -->
  1199. <xsd:complexType name="sequence-generator">
  1200. <xsd:annotation>
  1201. <xsd:documentation>
  1202. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
  1203. public @interface SequenceGenerator {
  1204. String name();
  1205. String sequenceName() default "";
  1206. int initialValue() default 1;
  1207. int allocationSize() default 50;
  1208. }
  1209. </xsd:documentation>
  1210. </xsd:annotation>
  1211. <xsd:attribute name="name" type="xsd:string" use="required"/>
  1212. <xsd:attribute name="sequence-name" type="xsd:string"/>
  1213. <xsd:attribute name="initial-value" type="xsd:int"/>
  1214. <xsd:attribute name="allocation-size" type="xsd:int"/>
  1215. </xsd:complexType>
  1216. <!-- **************************************************** -->
  1217. <xsd:complexType name="table-generator">
  1218. <xsd:annotation>
  1219. <xsd:documentation>
  1220. @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
  1221. public @interface TableGenerator {
  1222. String name();
  1223. String table() default "";
  1224. String catalog() default "";
  1225. String schema() default "";
  1226. String pkColumnName() default "";
  1227. String valueColumnName() default "";
  1228. String pkColumnValue() default "";
  1229. int initialValue() default 0;
  1230. int allocationSize() default 50;
  1231. UniqueConstraint[] uniqueConstraints() default {};
  1232. }
  1233. </xsd:documentation>
  1234. </xsd:annotation>
  1235. <xsd:sequence>
  1236. <xsd:element name="unique-constraint" type="orm:unique-constraint"
  1237. minOccurs="0" maxOccurs="unbounded"/>
  1238. </xsd:sequence>
  1239. <xsd:attribute name="name" type="xsd:string" use="required"/>
  1240. <xsd:attribute name="table" type="xsd:string"/>
  1241. <xsd:attribute name="catalog" type="xsd:string"/>
  1242. <xsd:attribute name="schema" type="xsd:string"/>
  1243. <xsd:attribute name="pk-column-name" type="xsd:string"/>
  1244. <xsd:attribute name="value-column-name" type="xsd:string"/>
  1245. <xsd:attribute name="pk-column-value" type="xsd:string"/>
  1246. <xsd:attribute name="initial-value" type="xsd:int"/>
  1247. <xsd:attribute name="allocation-size" type="xsd:int"/>
  1248. </xsd:complexType>
  1249. </xsd:schema>