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

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

This example Hibernate source code file (StoredProcedures.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

currency, datadirect, doctype, dtd, empid, employee, employment, employment, enddate, hibernate/hibernate, mapping, mapping, regioncode, startdate

The Hibernate StoredProcedures.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 version is for DataDirect drivers jdbc standard handling of stored procedures/functions.
-->
<hibernate-mapping package="org.hibernate.test.sql.hand" default-access="field">

	<sql-query name="simpleScalar" callable="true">
	 <return-scalar column="name" type="string"/>
	 <return-scalar column="value" type="long"/>
	 { call simpleScalar(:number) }
	</sql-query>
	<sql-query name="paramhandling" callable="true">
		<return-scalar column="value" type="long" />
		<return-scalar column="value2" type="long" />
		{ call testParamHandling(?,?) }
	</sql-query>

	<sql-query name="paramhandling_mixed" callable="true">
		<return-scalar column="value" type="long" />
		<return-scalar column="value2" type="long" />
		{ call testParamHandling(?,:second) }
	</sql-query>

	<sql-query name="selectAllEmployments" callable="true">
		<return alias="emp" class="Employment">
			<return-property name="employee" column="EMPLOYEE"/>
			<return-property name="employer" column="EMPLOYER"/>			
			<return-property name="startDate" column="STARTDATE"/>
			<return-property name="endDate" column="ENDDATE"/>			
			<return-property name="regionCode" column="REGIONCODE"/>			
			<return-property name="employmentId" column="EMPID"/>						
			<return-property name="salary">
  			  <return-column name="VALUE"/>
			  <return-column name="CURRENCY"/>			
			</return-property>
		</return>
	 { call allEmployments() }
	</sql-query>

</hibernate-mapping>

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate StoredProcedures.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.