Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5b7f8120f0a41cb8b7dd08212d3328e20f1cff5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.eclipse.org/emf/teneo/samples/emf/annotations/hbmapkeys"
	xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns="http://www.eclipse.org/emf/teneo/samples/emf/annotations/hbmapkeys">
	<xsd:complexType name="Book">
		<xsd:sequence>
			<xsd:element name="title" type="xsd:string" />
			<xsd:element maxOccurs="unbounded" minOccurs="0" name="writersByName" type="StringToWriterMapEntry">
				<xsd:annotation>
					<xsd:appinfo source="teneo.jpa">
						@HbMapKey(columns=@Column(name="THENAMEOFTHEWRITER"))
						@JoinColumn(name="JOIN_COLUMN_WRITER")
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:element>
			<xsd:element maxOccurs="unbounded" minOccurs="0" name="cityByWriter" type="WriterToCityMapEntry">
				<xsd:annotation>
					<xsd:appinfo source="teneo.jpa">
						@MapKeyManyToMany(targetEntity="Writer", joinColumns=@JoinColumn(name="THE_CITYWRITER_ID"))
						@JoinColumn(name="JOIN_COLUMN_CITY")
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="Writer">
		<xsd:sequence>
			<xsd:element name="name" type="xsd:string">
				<xsd:annotation>
					<xsd:appinfo source="teneo.jpa">
						@Column(name="THENAMEOFTHEWRITER")
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="City">
		<xsd:sequence>
			<xsd:element name="name" type="xsd:string"/>
			<xsd:element name="cityWriter" type="xsd:IDREF" ecore:reference="Writer">
				<xsd:annotation>
					<xsd:appinfo source="teneo.jpa">
						@JoinColumn(name="THE_CITYWRITER_ID")
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType ecore:instanceClass="java.util.Map$Entry" name="StringToWriterMapEntry">
		<xsd:attribute name="key" type="xsd:string" />
		<xsd:attribute name="value" type="xsd:IDREF" ecore:reference="Writer" />
	</xsd:complexType>
	<xsd:complexType ecore:instanceClass="java.util.Map$Entry" name="WriterToCityMapEntry">
		<xsd:attribute name="key" type="xsd:IDREF" ecore:reference="Writer" />
		<xsd:attribute name="value" type="xsd:IDREF" ecore:reference="City" />
	</xsd:complexType>
</xsd:schema>

Back to the top