Hibernate mapping files detail
Mapping Declaration Object/relational mappings are usually defined in XML document. The mapping language is Java-centric, meaning that mappings are constructed around persistent class declarations, not table declarations. Mapping Document
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="pojo"> <class name="Employee" table=”Employee”> <id name="id" type=”java.lang.Long”> <generator class=”sequence”/> </id> </class> </hibernate-mapping> <strong><class> </strong>element |
The element maps the domain object with corresponding entity in the database. hibernate-mapping element allows you to nest several persistent mappings, as shown above. It … Read more