|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!-- |
| 3 | + ~ SPDX-License-Identifier: Apache-2.0 |
| 4 | + ~ Copyright Red Hat Inc. and Hibernate Authors |
| 5 | + --> |
| 6 | +<entity-mappings xmlns="http://www.hibernate.org/xsd/orm/mapping" |
| 7 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 8 | + version="7.0"> |
| 9 | + <package>org.hibernate.orm.test.any.xml</package> |
| 10 | + |
| 11 | + <entity class="Person"> |
| 12 | + <table name="persons"/> |
| 13 | + <attributes> |
| 14 | + <id name="id"> |
| 15 | + <generated-value generator="increment"/> |
| 16 | + </id> |
| 17 | + <basic name="name"/> |
| 18 | + <any name="data"> |
| 19 | + <discriminator> |
| 20 | + <type>STRING</type> |
| 21 | + <column name="data_type"/> |
| 22 | + <mapping value="A">Address</mapping> |
| 23 | + </discriminator> |
| 24 | + <key> |
| 25 | + <java-class>Long</java-class> |
| 26 | + <column name="data_fk"/> |
| 27 | + </key> |
| 28 | + </any> |
| 29 | + </attributes> |
| 30 | + </entity> |
| 31 | + |
| 32 | + <entity class="Address"> |
| 33 | + <table name="addresses"/> |
| 34 | + <attributes> |
| 35 | + <id name="id"> |
| 36 | + <generated-value generator="increment"/> |
| 37 | + </id> |
| 38 | + <element-collection name="lines" target-class="String"> |
| 39 | + <column name="line"/> |
| 40 | + <collection-table name="address_lines"> |
| 41 | + <join-column name="address_fk"/> |
| 42 | + </collection-table> |
| 43 | + </element-collection> |
| 44 | + </attributes> |
| 45 | + </entity> |
| 46 | +</entity-mappings> |
| 47 | + |
| 48 | +<!--<!DOCTYPE hibernate-mapping PUBLIC--> |
| 49 | +<!-- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"--> |
| 50 | +<!-- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">--> |
| 51 | + |
| 52 | +<!--<hibernate-mapping package="org.hibernate.orm.test.any.xml">--> |
| 53 | + |
| 54 | +<!-- <class name="Person" table="T_ANY_PERSON">--> |
| 55 | +<!-- <id name="id" column="ID_">--> |
| 56 | +<!-- <generator class="increment" />--> |
| 57 | +<!-- </id>--> |
| 58 | +<!-- <property name="name" />--> |
| 59 | +<!-- <any name="data" id-type="long" cascade="none">--> |
| 60 | +<!-- <meta-value value="A" class="Address"/>--> |
| 61 | +<!-- <column name="DATATYPE_"/>--> |
| 62 | +<!-- <column name="DATAID_"/>--> |
| 63 | +<!-- </any>--> |
| 64 | +<!-- </class>--> |
| 65 | + |
| 66 | +<!-- <class name="Address" table="T_ANY_ADDRESS">--> |
| 67 | +<!-- <id name="id" column="ID_">--> |
| 68 | +<!-- <generator class="increment" />--> |
| 69 | +<!-- </id>--> |
| 70 | +<!-- <set name="lines" table="LINE">--> |
| 71 | +<!-- <key column="ADDRESS" />--> |
| 72 | +<!-- <element type="string" />--> |
| 73 | +<!-- </set>--> |
| 74 | +<!-- </class>--> |
| 75 | + |
| 76 | +<!--</hibernate-mapping>--> |
0 commit comments