|
Hibernate example source code file (OneToOne.hbm.xml)
The Hibernate OneToOne.hbm.xml source code<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <!-- Mappings demonstrating bidirectional one-to-one mappings for testing with various operations. Person -> Address is modeled as a bidirectional one to one based on FK. Person -> Details is modeled as a bidirectional one to one based on PK. --> <hibernate-mapping package="org.hibernate.test.nonflushedchanges"> <class name="Person" table="OPS_PERSON"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="name" column="NAME" type="string"/> <one-to-one name="address" class="Address" property-ref="resident"/> <one-to-one name="details" class="PersonalDetails" cascade="all"/> </class> <class name="Address" table="OPS_ADDRESS"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="streetAddress" column="STREET" type="string"/> <property name="city" column="CITY" type="string"/> <property name="country" column="CTRY" type="string"/> <many-to-one name="resident" column="RESIDENT" class="Person"/> </class> <class name="PersonalDetails" table="OPS_PERS_DETAIL"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="somePersonalDetail" column="SOME_DETAIL" type="string"/> <one-to-one name="person" class="Person" cascade="none" constrained="true"/> </class> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate OneToOne.hbm.xml source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.