|
Hibernate example source code file (GeneratedPropertyEntity.hbm.xml)
The Hibernate GeneratedPropertyEntity.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 package="org.hibernate.test.generated"> <class name="GeneratedPropertyEntity" table="gen_prop"> <id name="id"> <generator class="native"/> </id> <property name="name"/> <property name="lastModified" generated="always" type="binary"> <column name="lastModified" length="8"/> </property> </class> <database-object> <create> <![CDATA[CREATE OR REPLACE TRIGGER t_iu_gen_prop BEFORE INSERT OR UPDATE ON gen_prop FOR EACH ROW BEGIN IF INSERTING THEN :new.lastModified := HEXTORAW( '1' ); ELSE :new.lastModified := HEXTORAW( TO_NUMBER( RAWTOHEX( :old.lastModified ) ) + 1 ); END IF; END;]]> </create> <drop> <![CDATA[DROP TRIGGER t_iu_gen_prop]]> </drop> <dialect-scope name="org.hibernate.dialect.Oracle9iDialect"/> <dialect-scope name="org.hibernate.dialect.Oracle10gDialect"/> </database-object> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate GeneratedPropertyEntity.hbm.xml source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
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.