alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (Documents.hbm.xml)

This example Hibernate source code file (Documents.hbm.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

doctype, doctype, document, document, dtd, hibernate, hibernate, hibernate/hibernate, mapping, mapping, public, this

The Hibernate Documents.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">

<!-- 

  This mapping demonstrates 

     (1) use of lazy properties - this feature requires buildtime 
         bytecode instrumentation; we don't think this is a very
         necessary feature, but provide it for completeleness; if
         Hibernate encounters uninstrumented classes, lazy property
         fetching will be silently disabled, to enable testing
     
     (2) use of a formula to define a "derived property"
     
-->

<hibernate-mapping 
	package="org.hibernate.test.lazycache"
	default-access="field">
 	
	<class name="Document" table="documents">
    	<cache usage="nonstrict-read-write" include="non-lazy" region="foo"/>
   		<id name="id">
    		<generator class="native"/>
    	</id>
    	<property name="name" not-null="true" length="50"/>
    	<property name="upperCaseName" formula="upper(name)" lazy="true"/>
    	<property name="summary" not-null="true" length="200" lazy="true"/>
    	<property name="text" not-null="true" length="2000" lazy="true"/>
    	<property name="lastTextModification" not-null="true" lazy="true" access="field"/>
    </class>
 	

</hibernate-mapping>

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate Documents.hbm.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.