- 
                Notifications
    You must be signed in to change notification settings 
- Fork 52
Ru:criteria:metaexample
        AlexeyDsov edited this page Apr 19, 2011 
        ·
        4 revisions
      
    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>