Skip to content

Ru:criteria:metaexample

AlexeyDsov edited this page Apr 19, 2011 · 4 revisions

Xml Meta для статьи Criteria

Criteria - статья с базовыми примерами использования Criteria. В примерах используются объекты и связи как если бы соотвествовали этому описанию.

<?xml version="1.0"?>
<!DOCTYPE metaconfiguration SYSTEM "meta.dtd">
<metaconfiguration>
	<classes>
		<class name="Actor">
			<properties>
				<identifier type="Integer" name="id" column="id" />
				<property name="name" type="String" size="128" required="true" />
				<property name="country" type="String" size="32"/>
				<property name="childs" type="Integer" required="true" />

				<property name="roles" type="Role" relation="OneToMany" />
				<property
					name="bestFilm"
					column="best_film_id"
					type="Actor"
					relation="OneToOne" 
					fetch="lazy"
				/>
			</properties>
			<pattern name="StraightMapping" />
		</class>

		<class name="Film">
			<properties>
				<identifier type="Integer" name="id" column="id" />
				<property name="name" type="String" size="128" required="true" />
				<property name="year" type="Integer" />
				<property name="description" type="String" />

				<property name="roles" type="Role" relation="OneToMany" />
			</properties>
			<pattern name="StraightMapping" />
		</class>

		<class name="Role">
			<properties>
				<identifier type="Integer" name="id" column="id" />

				<property
					name="film"
					type="Film"
					relation="OneToOne"
					fetch="lazy"
					required="false"
				/>
				<property
					name="actor"
					type="Actor"
					relation="OneToOne"
					fetch="lazy"
					required="false"
				/>

				<property name="description" type="String" />
			</properties>
			<pattern name="StraightMapping" />
		</class>

	</classes>
</metaconfiguration>
Clone this wiki locally