Author: mdryakhlenkov
Date: 2007-07-31 13:03:48 -0400 (Tue, 31 Jul 2007)
New Revision: 2773
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/propertyref/inheritence/union/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/proxy/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/querycache/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/readonly/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/reattachment/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/rowid/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/schemaupdate/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sorted/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ExceptionCheckingEntity.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ParamCheckingEntity.java
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/oracle-mappings.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/datadirect/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/datadirect/oracle/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/datadirect/oracle/StoredProcedures.hbm.xml
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/stateless/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/stats/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/subclassfilter/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/subselect/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/subselectfetch/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/ternary/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/timestamp/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/tm/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/tool/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/typedmanytoone/
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/typedonetoone/
Log:
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ExceptionCheckingEntity.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ExceptionCheckingEntity.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ExceptionCheckingEntity.java 2007-07-31
17:03:48 UTC (rev 2773)
@@ -0,0 +1,30 @@
+package mapping.sql.check;
+
+/**
+ * An entity which is expected to be mapped to each database using stored
+ * procedures which throw exceptions on their own; in other words, using
+ * {@link org.hibernate.engine.ExecuteUpdateResultCheckStyle#NONE}.
+ *
+ * @author Steve Ebersole
+ */
+public class ExceptionCheckingEntity {
+ private Long id;
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ParamCheckingEntity.java
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ParamCheckingEntity.java
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/ParamCheckingEntity.java 2007-07-31
17:03:48 UTC (rev 2773)
@@ -0,0 +1,29 @@
+package mapping.sql.check;
+
+/**
+ * An entity which is expected to be mapped to each database using stored
+ * procedures which return "affected row counts"; in other words, using
+ * {@link org.hibernate.engine.ExecuteUpdateResultCheckStyle#PARAM}.
+ *
+ * @author Steve Ebersole
+ */
+public class ParamCheckingEntity {
+ private Long id;
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/oracle-mappings.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/oracle-mappings.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/check/oracle-mappings.hbm.xml 2007-07-31
17:03:48 UTC (rev 2773)
@@ -0,0 +1,103 @@
+<?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="mapping.sql.check">
+
+ <class name="ExceptionCheckingEntity" table="ENTITY_E">
+ <id name="id" unsaved-value="0" column="ID">
+ <generator class="increment"/>
+ </id>
+ <property name="name" not-null="true"/>
+ <sql-insert callable="true" check="none">{call
createEntityE(?,?)}</sql-insert>
+ <sql-update callable="true" check="none">{call
updateEntityE(?,?)}</sql-update>
+ <sql-delete callable="true" check="none">{call
deleteEntityE(?)}</sql-delete>
+ </class>
+
+ <class name="ParamCheckingEntity" table="ENTITY_P">
+ <id name="id" unsaved-value="0" column="ID">
+ <generator class="increment"/>
+ </id>
+ <property name="name" not-null="true"/>
+ <sql-insert callable="true" check="param">{call
createEntityP(?,?,?)}</sql-insert>
+ <sql-update callable="true" check="param">{? = call
updateEntityP(?,?)}</sql-update>
+ <sql-delete callable="true" check="param">{? = call
deleteEntityP(?)}</sql-delete>
+ </class>
+
+
+ <database-object>
+ <create>
+ CREATE OR REPLACE PROCEDURE createEntityE(p_name ENTITY_E.NAME%TYPE, p_id
ENTITY_E.ID%TYPE)
+ AS BEGIN
+ RAISE_APPLICATION_ERROR( -20001, 'Insert failure checking' );
+ END;
+ </create>
+ <drop>
+ DROP PROCEDURE createEntityE;
+ </drop>
+ </database-object>
+
+ <database-object>
+ <create>
+ CREATE OR REPLACE PROCEDURE updateEntityE(p_name ENTITY_E.NAME%TYPE, p_id
ENTITY_E.ID%TYPE)
+ AS BEGIN
+ RAISE_APPLICATION_ERROR( -20001, 'Update failure checking' );
+ END;
+ </create>
+ <drop>
+ DROP PROCEDURE updateEntityE;
+ </drop>
+ </database-object>
+
+ <database-object>
+ <create>
+ CREATE OR REPLACE PROCEDURE deleteEntityE(p_id ENTITY_E.ID%TYPE)
+ AS BEGIN
+ RAISE_APPLICATION_ERROR( -20001, 'Update failure checking' );
+ END;
+ </create>
+ <drop>
+ DROP PROCEDURE deleteEntityE;
+ </drop>
+ </database-object>
+
+
+ <database-object>
+ <!-- Demonstrate using an Oracle procedure and a registered OUT paramater as
part of hand supplied sql -->
+ <create>
+ CREATE OR REPLACE PROCEDURE createEntityP(result OUT INTEGER, p_name
ENTITY_E.NAME%TYPE, p_id ENTITY_E.ID%TYPE)
+ AS BEGIN
+ /* force a failure by returning a non-1 result */
+ result := 2;
+ END;
+ </create>
+ <drop>
+ DROP PROCEDURE createEntityP;
+ </drop>
+ </database-object>
+
+ <database-object>
+ <!-- Demonstrate using an Oracle function and it's return value as part of
hand supplied sql -->
+ <create>
+ CREATE OR REPLACE FUNCTION updateEntityP(p_name ENTITY_E.NAME%TYPE, p_id
ENTITY_E.ID%TYPE)
+ RETURN INTEGER IS BEGIN
+ RETURN 2;
+ END;
+ </create>
+ <drop>
+ DROP PROCEDURE updateEntityP;
+ </drop>
+ </database-object>
+
+ <database-object>
+ <create>
+ CREATE OR REPLACE FUNCTION deleteEntityP(p_id ENTITY_E.ID%TYPE)
+ RETURN INTEGER IS BEGIN
+ RETURN 2;
+ END;
+ </create>
+ <drop>
+ DROP PROCEDURE deleteEntityE;
+ </drop>
+ </database-object>
+
+</hibernate-mapping>
\ No newline at end of file
Added:
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/datadirect/oracle/StoredProcedures.hbm.xml
===================================================================
---
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/datadirect/oracle/StoredProcedures.hbm.xml
(rev 0)
+++
trunk/hibernatetools/sampleprojects/org.jboss.tools.hibernate.sampleproject.mappingtypes/src/mapping/sql/hand/custom/datadirect/oracle/StoredProcedures.hbm.xml 2007-07-31
17:03:48 UTC (rev 2773)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+ This version is for DataDirect drivers jdbc standard handling of stored
procedures/functions.
+-->
+<hibernate-mapping package="mapping.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>
Show replies by date