|
Hibernate example source code file (mappings.hbm.xml)
The Hibernate mappings.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">
<hibernate-mapping>
<class name="org.hibernate.envers.test.integration.entityNames.singleAssociatedAudited.Person" entity-name="Personaje" table="OWNERS">
<id name="id" column="ID_person" type="long" >
<generator class="native" />
</id>
<property name="name" type="string" length="255"
column="NAME" not-null="true" />
<property name="age" type="int" column="AGE"/>
</class>
<!-- Deliberately use the same domain object and map it to a different database table. See issue HHH-4648. -->
<class name="org.hibernate.envers.test.integration.entityNames.singleAssociatedAudited.Person" entity-name="Driveraje" table="DRIVERS">
<id name="id" column="ID_person" type="long" >
<generator class="native" />
</id>
<property name="name" type="string" length="255"
column="NAME" not-null="true" />
<property name="age" type="int" column="AGE"/>
</class>
<class name="org.hibernate.envers.test.integration.entityNames.singleAssociatedAudited.Car" >
<id name="id" column="ID_BED" type="long">
<generator class="native" />
</id>
<property name="number" type="int" column="int" not-null="true" />
<many-to-one name="owner" entity-name="Personaje"/>
<many-to-one name="driver" entity-name="Driveraje"/>
</class>
</hibernate-mapping>
Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate mappings.hbm.xml source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 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.