[hibernate-commits] Hibernate SVN: r10459 - trunk/HibernateExt/ejb-api/src/javax/persistence

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Sep 6 11:20:56 EDT 2006


Author: epbernard
Date: 2006-09-06 11:20:50 -0400 (Wed, 06 Sep 2006)
New Revision: 10459

Modified:
   trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceException.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceProperty.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnit.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnits.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PostLoad.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PostPersist.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PostRemove.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PostUpdate.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PrePersist.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PreRemove.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PreUpdate.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/PrimaryKeyJoinColumn.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/QueryHint.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/RollbackException.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/SecondaryTable.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/Table.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/Temporal.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/TemporalType.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/Transient.java
   trunk/HibernateExt/ejb-api/src/javax/persistence/Version.java
Log:
EJB-211

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceException.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceException.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceException.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,5 +1,5 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss, Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
@@ -7,29 +7,44 @@
 package javax.persistence;
 
 /**
- * Comment
+ * Thrown by the persistence provider when a problem occurs. All instances of PersistenceException
+ * except for instances of NoResultException and NonUniqueResultException will cause the current
+ * transaction, if one is active, to be marked for rollback.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
  */
-public class PersistenceException extends RuntimeException
-{
-   public PersistenceException()
-   {
-   }
+public class PersistenceException extends RuntimeException {
+	/**
+	 * Constructs a new PersistenceException exception with null as its detail message.
+	 */
+	public PersistenceException() {
+	}
 
-   public PersistenceException(String message)
-   {
-      super(message);
-   }
+	/**
+	 * Constructs a new PersistenceException exception with the specified detail message.
+	 *
+	 * @param message the detail message
+	 */
+	public PersistenceException(String message) {
+		super( message );
+	}
 
-   public PersistenceException(String message, Throwable cause)
-   {
-      super(message, cause);
-   }
+	/**
+	 * Constructs a new PersistenceException exception with the specified detail message and cause
+	 *
+	 * @param message the detail message
+	 * @param cause the cause
+	 */
+	public PersistenceException(String message, Throwable cause) {
+		super( message, cause );
+	}
 
-   public PersistenceException(Throwable cause)
-   {
-      super(cause);
-   }
+	/**
+	 * Constructs a new PersistenceException exception with the specified cause
+	 *
+	 * @param cause the cause
+	 */
+	public PersistenceException(Throwable cause) {
+		super( cause );
+	}
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceProperty.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceProperty.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceProperty.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -16,7 +16,12 @@
 @Target({})
 @Retention(RUNTIME)
 public @interface PersistenceProperty {
+	/**
+	 * The name of the property
+	 */
 	String name();
-
+	/**
+	 * The value of the property
+	 */
 	String value();
 }
\ No newline at end of file

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnit.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnit.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnit.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,5 +1,5 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
@@ -12,15 +12,22 @@
 import java.lang.annotation.Target;
 
 /**
- * Comment
+ * Expresses a dependency on an EntityManagerFactory.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
  */
 @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PersistenceUnit
-{
-   String name() default "";
-   String unitName() default "";
+public @interface PersistenceUnit {
+	/**
+	 * The name by which the entity manager factory is to be accessed in the environment
+	 * referencing context, and is not needed when dependency injection is used.
+	 */
+	String name() default "";
+	/**
+	 * The name of the persistence unit as defined in the persistence.xml file. If specified, the
+	 * persistence unit for the entity manager factory that is accessible in JNDI must have the
+	 * same name.
+	 */
+	String unitName() default "";
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnits.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnits.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PersistenceUnits.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,5 +1,5 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
@@ -10,17 +10,17 @@
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import javax.persistence.PersistenceUnit;
 
 /**
- * Comment
+ * Declares one or more PersistenceUnit annotations
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision$
  */
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PersistenceUnits
-{
-   PersistenceUnit[] value();
+public @interface PersistenceUnits {
+	/**
+	 * One or more PersistenceUnit annotations
+	 */
+	PersistenceUnit[] value();
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PostLoad.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PostLoad.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PostLoad.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,5 +1,5 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
@@ -13,12 +13,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to
+ * methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PostLoad
-{
+public @interface PostLoad {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PostPersist.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PostPersist.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PostPersist.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,9 +1,10 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
+
 package javax.persistence;
 
 import java.lang.annotation.ElementType;
@@ -13,12 +14,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be
+ * applied to methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PostPersist
-{
+public @interface PostPersist {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PostRemove.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PostRemove.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PostRemove.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,9 +1,10 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
+
 package javax.persistence;
 
 import java.lang.annotation.ElementType;
@@ -13,12 +14,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied
+ * to methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PostRemove
-{
+public @interface PostRemove {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PostUpdate.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PostUpdate.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PostUpdate.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,9 +1,10 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
+
 package javax.persistence;
 
 import java.lang.annotation.ElementType;
@@ -13,12 +14,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to
+ * methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PostUpdate
-{
+public @interface PostUpdate {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PrePersist.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PrePersist.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PrePersist.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,9 +1,10 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
+
 package javax.persistence;
 
 import java.lang.annotation.ElementType;
@@ -13,12 +14,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied
+ * to methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PrePersist
-{
+public @interface PrePersist {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PreRemove.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PreRemove.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PreRemove.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,9 +1,10 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
+
 package javax.persistence;
 
 import java.lang.annotation.ElementType;
@@ -13,12 +14,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied
+ * to methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PreRemove
-{
+public @interface PreRemove {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PreUpdate.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PreUpdate.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PreUpdate.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -1,9 +1,10 @@
-/*
- * JBoss, the OpenSource J2EE webOS
+/* $Id$
+ * JBoss Inc
  *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
+
 package javax.persistence;
 
 import java.lang.annotation.ElementType;
@@ -13,12 +14,12 @@
 
 
 /**
- * comment
+ * Is used to specify callback methods for the corresponding lifecycle event. This annotation may be
+ * applied to methods of an entity class, a mapped superclass, or a callback listener class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  */
 @Target({ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
-public @interface PreUpdate
-{
+public @interface PreUpdate {
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/PrimaryKeyJoinColumn.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/PrimaryKeyJoinColumn.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/PrimaryKeyJoinColumn.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -9,11 +9,45 @@
 import static java.lang.annotation.RetentionPolicy.*;
 
 /**
+ * This annotation specifies a primary key column that is used as a foreign key to join to another
+ * table.
+ *
+ * It is used to join the primary table of an entity subclass in the JOINED mapping strategy to
+ * the primary table of its superclass; it is used within a SecondaryTable annotation to join a
+ * secondary table to a primary table; and it may be used in a OneToOne mapping in which the
+ * primary key of the referencing entity is used as a foreign key to the referenced entity.
+ *
+ * If no PrimaryKeyJoinColumn annotation is specified for a subclass in the JOINED mapping
+ * strategy, the foreign key columns are assumed to have the same names as the primary key
+ * columns of the primary table of the superclass
+ *
  * @author Emmanuel Bernard
  */
 @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
 public @interface PrimaryKeyJoinColumn {
+	/**
+	 * The name of the primary key column of the current table.
+	 *
+	 * Defaults to the same name as the primary key column of the primary table of the
+	 * superclass (JOINED mapping strategy); the same name as the primary key column of
+	 * the primary table (SecondaryTable mapping); or the same name as the primary key
+	 * column for the table for the referencing entity (OneToOne mapping)
+	 */
 	String name() default "";
+	/**
+	 * The name of the primary key column of the table being joined to.
+	 *
+	 * Defaults to the same name as the primary key column of the primary table of the
+	 * superclass (JOINED mapping strategy); the same name as the primary key column of the
+	 * primary table (SecondaryTable mapping); or the same name as the primary key column for
+	 * the table for the referencing entity (OneToOne mapping)
+	 */
 	String referencedColumnName() default "";
+	/**
+	 * The SQL fragment that is used when generating the DDL for the column. This should not be
+	 * specified for a OneToOne primary key association.
+	 *
+	 * Defaults to the generated SQL to create a column of the inferred type.
+	 */
 	String columnDefinition() default "";
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/QueryHint.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/QueryHint.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/QueryHint.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -6,12 +6,20 @@
 import java.lang.annotation.Target;
 
 /**
+ * An implementation-specific Query hint
+ *
  * @author Emmanuel Bernard
  */
 @Target({})
 @Retention(RUNTIME)
 public @interface QueryHint {
+	/**
+	 * Name of the hint
+	 */
 	String name();
 
+	/**
+	 * Value of the hint
+	 */
 	String value();
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/RollbackException.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/RollbackException.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/RollbackException.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -2,23 +2,42 @@
 package javax.persistence;
 
 /**
- * Exception occurs while commiting the transaction
+ * Thrown by the persistence provider when the EntityTransaction.commit() fails
  *
  * @author Emmanuel Bernard
  */
 public class RollbackException extends PersistenceException {
+	/**
+	 * Constructs a new RollbackException exception with null as its detail message
+	 */
 	public RollbackException() {
 		super();
 	}
 
+	/**
+	 * Constructs a new RollbackException exception with the specified cause
+	 *
+	 * @param cause The detail cause
+	 */
 	public RollbackException(Throwable cause) {
 		super( cause );
 	}
 
+	/**
+	 * Constructs a new RollbackException exception with the specified detail message
+	 *
+	 * @param message The detail message
+	 */
 	public RollbackException(String message) {
 		super( message );
 	}
 
+	/**
+	 * Constructs a new RollbackException exception with the specified detail message and cause
+	 *
+	 * @param message The detail message
+	 * @param cause The detail cause
+	 */
 	public RollbackException(String message, Throwable cause) {
 		super( message, cause );
 	}

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/SecondaryTable.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/SecondaryTable.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/SecondaryTable.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -9,13 +9,45 @@
 import static java.lang.annotation.RetentionPolicy.*;
 
 /**
+ * This annotation is used to specify a secondary table for the annotated entity class. Specifying
+ * one or more secondary tables indicates that the data for the entity class is stored across multiple
+ * tables.
+ *
+ * If no SecondaryTable annotation is specified, it is assumed that all persistent fields or properties
+ * of the entity are mapped to the primary table. If no primary key join columns are specified, the
+ * join columns are assumed to reference the primary key columns of the primary table, and have the
+ * same names and types as the referenced primary key columns of the primary table.
+ *
  * @author Emmanuel Bernard
  */
 @Target({TYPE}) @Retention(RUNTIME)
 public @interface SecondaryTable {
+	/**
+	 * The name of the table
+	 */
 	String name();
+	/**
+	 * The catalog of the table
+	 */
 	String catalog() default "";
+	/**
+	 * The schema of the table
+	 */
 	String schema() default "";
+	/**
+	 * The columns that are used to join with the primary table.
+	 *
+	 * Defaults to the column(s) of the same name(s) as the primary key column(s)
+	 * in the primary table
+	 */
 	PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+	/**
+	 * Unique constraints that are to be placed on the table. These are typically only used if
+	 * table generation is in effect. These constraints apply in addition to any constraints
+	 * specified by the Column and JoinColumn annotations and constraints entailed by primary
+	 * key mappings.
+	 *
+	 * Defaults to no additional constraints.
+	 */
 	UniqueConstraint[] uniqueConstraints() default {};
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/Table.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/Table.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/Table.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -9,12 +9,40 @@
 import static java.lang.annotation.RetentionPolicy.*;
 
 /**
+ * This annotation specifies the primary table for the annotated entity. Additional
+ * tables may be specified using SecondaryTable  or SecondaryTables annotation.
+ *
+ * If no Table annotation is specified for an entity class, the default values apply.
+ *
  * @author Emmanuel Bernard
  */
 @Target({TYPE}) @Retention(RUNTIME)
 public @interface Table {
+	/**
+	 * The name of the table.
+	 *
+	 * Defaults to the entity name.
+	 */
 	String name() default "";
+	/**
+	 * The catalog of the table.
+	 *
+	 * Defaults to the default catalog.
+	 */
 	String catalog() default "";
+	/**
+	 * The schema of the table.
+	 *
+	 * Defaults to the default schema for user.
+	 */
 	String schema() default "";
+	/**
+	 * Unique constraints that are to be placed on the table. These are only used if table
+	 * generation is in effect. These constraints apply in addition to any constraints
+	 * specified by the Column and JoinColumn annotations and constraints entailed by
+	 * primary key mappings.
+	 *
+	 * Defaults to no additional constraints.
+	 */
 	UniqueConstraint[] uniqueConstraints() default {};
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/Temporal.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/Temporal.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/Temporal.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -9,10 +9,18 @@
 import java.lang.annotation.Target;
 
 /**
+ * This annotation must be specified for persistent fields or properties of type Date and Calendar.
+ * It may only be specified for fields or properties of these types.
+ *
+ * The Temporal annotation may be used in conjunction with the Basic annotation.
+ *
  * @author Emmanuel Bernard
  */
 @Target({METHOD, FIELD})
 @Retention(RUNTIME)
 public @interface Temporal {
+	/**
+	 * The type used in mapping java.util.Date or java.util.Calendar
+	 */
 	TemporalType value();
 }

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/TemporalType.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/TemporalType.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/TemporalType.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -2,8 +2,20 @@
 //EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
 package javax.persistence;
 
+/**
+ * Type used to indicate a specific mapping of Date or Calendar.
+ */
 public enum TemporalType {
-	DATE, // java.sql.Date
-	TIME, // java.sql.Time
-	TIMESTAMP // java.sql.Timestamp
+	/**
+	 * Map as java.sql.Date
+	 */
+	DATE,
+	/**
+	 * Map as java.sql.Time
+	 */
+	TIME,
+	/**
+	 * Map as java.sql.Timestamp
+	 */
+	TIMESTAMP
 }
\ No newline at end of file

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/Transient.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/Transient.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/Transient.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -9,6 +9,9 @@
 import static java.lang.annotation.RetentionPolicy.*;
 
 /**
+ * This annotation specifies that the property or field is not persistent. It is used to annotate
+ * a property or field of an entity class, mapped superclass, or embeddable class.
+ * 
  * @author Emmanuel Bernard
  */
 @Target({METHOD, FIELD}) @Retention(RUNTIME)

Modified: trunk/HibernateExt/ejb-api/src/javax/persistence/Version.java
===================================================================
--- trunk/HibernateExt/ejb-api/src/javax/persistence/Version.java	2006-09-06 14:07:22 UTC (rev 10458)
+++ trunk/HibernateExt/ejb-api/src/javax/persistence/Version.java	2006-09-06 15:20:50 UTC (rev 10459)
@@ -9,6 +9,19 @@
 import static java.lang.annotation.RetentionPolicy.*;
 
 /**
+ * This annotation specifies the version field or property of an entity class that serves as its
+ * optimistic lock value. The version is used to ensure integrity when performing the merge
+ * operation and for optimistic concurrency control.
+ *
+ * Only a single Version property or field should be used per class; applications that use more
+ * than one Version property or field will not be portable.
+ *
+ * The Version property should be mapped to the primary table for the entity class; applications
+ * that map the Version property to a table other than the primary table will not be portable.
+ *
+ * The following types are supported for version properties: int, Integer, short, Short, long,
+ * Long, Timestamp.
+ *  
  * @author Emmanuel Bernard
  */
 @Target({METHOD, FIELD}) @Retention(RUNTIME)




More information about the hibernate-commits mailing list