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

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

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

between, cat_id, cat_id, category, category, department, department, doctype, prod_cat, prod_id, product, sales_person, system, system

The Hibernate Category.hbm.xml source code

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
        SYSTEM
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="org.hibernate.test.filter">

    <class name="Category" table="CATEGORY">
        <id name="id" column="CAT_ID">
            <generator class="native"/>
        </id>

        <property name="name" type="string"/>
        <property name="effectiveStartDate" column="eff_start_dt" type="java.util.Date"/>
        <property name="effectiveEndDate" column="eff_end_dt" type="java.util.Date"/>

        <set cascade="none" inverse="true" name="products" table="PROD_CAT">
            <key column="CAT_ID"/>
            <many-to-many column="PROD_ID" class="Product"/>
        </set>

        <filter name="effectiveDate" condition=":asOfDate BETWEEN eff_start_dt and eff_end_dt"/>
        <filter name="unioned">
            'abc' in ( select d.reg from DEPARTMENT d where (d.dept_id=123) union select p.name from SALES_PERSON p )
        </filter>

    </class>

</hibernate-mapping>

Other Hibernate examples (source code examples)

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