Author: epbernard
Date: 2006-11-30 12:03:45 -0500 (Thu, 30 Nov 2006)
New Revision: 10895
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/Loader.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/ResultCheckStyle.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDelete.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDeleteAll.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLInsert.java
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLUpdate.java
Log:
ANN-37 SQL Overriding support
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/Loader.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/Loader.java 2006-11-30
15:22:57 UTC (rev 10894)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/Loader.java 2006-11-30
17:03:45 UTC (rev 10895)
@@ -0,0 +1,22 @@
+package org.hibernate.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Loader Annotation for overwriting Hibernate default FIND method
+ *
+ * @author L�szl� Benke
+ */
+@Target( {TYPE, FIELD, METHOD} )
+@Retention( RUNTIME )
+public @interface Loader {
+ /**
+ * namedQuery to use for loading
+ */
+ String namedQuery() default "";
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/ResultCheckStyle.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/ResultCheckStyle.java 2006-11-30
15:22:57 UTC (rev 10894)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/ResultCheckStyle.java 2006-11-30
17:03:45 UTC (rev 10895)
@@ -0,0 +1,13 @@
+//$Id:
+package org.hibernate.annotations;
+
+/**
+ * Possible checks on Sql Insert, Delete, Update
+ *
+ * @author L�szl� Benke
+ */
+public enum ResultCheckStyle {
+ NONE,
+ COUNT,
+ PARAM
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDelete.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDelete.java 2006-11-30
15:22:57 UTC (rev 10894)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDelete.java 2006-11-30
17:03:45 UTC (rev 10895)
@@ -0,0 +1,33 @@
+//$Id:$
+package org.hibernate.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * SqlDelete Annotation for overwriting Hibernate default DELETE method
+ *
+ * @author L�szl� Benke
+ */
+@Target( {TYPE, FIELD, METHOD} )
+@Retention( RUNTIME )
+public @interface SQLDelete {
+ /**
+ * Procedure name or DELETE STATEMENT
+ */
+ String sql();
+
+ /**
+ * Is the statement using stored procedure or not
+ */
+ boolean callable() default false;
+
+ /**
+ * For persistence operation what style of determining results (success/failure) is to
be used.
+ */
+ ResultCheckStyle check() default ResultCheckStyle.NONE;
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDeleteAll.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDeleteAll.java 2006-11-30
15:22:57 UTC (rev 10894)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLDeleteAll.java 2006-11-30
17:03:45 UTC (rev 10895)
@@ -0,0 +1,34 @@
+//$Id: $
+package org.hibernate.annotations;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * SqlDelete Annotation for overwriting Hibernate default DELETE ALL method
+ *
+ * @author L�szl� Benke
+ */
+@Target( {TYPE, FIELD, METHOD} )
+@Retention( RetentionPolicy.RUNTIME )
+public @interface SQLDeleteAll {
+ /**
+ * Procedure name or DELETE STATEMENT
+ */
+ String sql();
+
+ /**
+ * Is the statement using stored procedure or not
+ */
+ boolean callable() default false;
+
+ /**
+ * For persistence operation what style of determining results (success/failure) is to
be used.
+ */
+ ResultCheckStyle check() default ResultCheckStyle.NONE;
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLInsert.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLInsert.java 2006-11-30
15:22:57 UTC (rev 10894)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLInsert.java 2006-11-30
17:03:45 UTC (rev 10895)
@@ -0,0 +1,33 @@
+//$Id:$
+package org.hibernate.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * SqlInsert Annotation for overwriting Hibernate default INSERT INTO method
+ *
+ * @author L�szl� Benke
+ */
+@Target( {TYPE, FIELD, METHOD} )
+@Retention( RUNTIME )
+public @interface SQLInsert {
+ /**
+ * Procedure name or INSERT STATEMENT
+ */
+ String sql();
+
+ /**
+ * Is the statement using stored procedure or not
+ */
+ boolean callable() default false;
+
+ /**
+ * For persistence operation what style of determining results (success/failure) is to
be used.
+ */
+ ResultCheckStyle check() default ResultCheckStyle.NONE;
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLUpdate.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLUpdate.java 2006-11-30
15:22:57 UTC (rev 10894)
+++
branches/Branch_3_2/HibernateExt/metadata/src/java/org/hibernate/annotations/SQLUpdate.java 2006-11-30
17:03:45 UTC (rev 10895)
@@ -0,0 +1,34 @@
+//$Id:$
+package org.hibernate.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * SqlUpdate Annotation for overwriting Hibernate default UPDATE method
+ *
+ * @author L�szl� Benke
+ */
+@Target( {TYPE, FIELD, METHOD} )
+@Retention( RUNTIME )
+public @interface SQLUpdate {
+
+ /**
+ * Procedure name or UPDATE STATEMENT
+ */
+ String sql();
+
+ /**
+ * Is the statement using stored procedure or not
+ */
+ boolean callable() default false;
+
+ /**
+ * For persistence operation what style of determining results (success/failure) is to
be used.
+ */
+ ResultCheckStyle check() default ResultCheckStyle.NONE;
+}
Show replies by date