[jboss-cvs] JBossAS SVN: r61536 - in projects/javaee/trunk: jboss-persistence-api and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 21 07:39:58 EDT 2007


Author: wolfc
Date: 2007-03-21 07:39:58 -0400 (Wed, 21 Mar 2007)
New Revision: 61536

Added:
   projects/javaee/trunk/jboss-persistence-api/
   projects/javaee/trunk/jboss-persistence-api/.classpath
   projects/javaee/trunk/jboss-persistence-api/.project
   projects/javaee/trunk/jboss-persistence-api/.settings/
   projects/javaee/trunk/jboss-persistence-api/.settings/org.eclipse.jdt.core.prefs
   projects/javaee/trunk/jboss-persistence-api/pom.xml
   projects/javaee/trunk/jboss-persistence-api/src/
   projects/javaee/trunk/jboss-persistence-api/src/etc/
   projects/javaee/trunk/jboss-persistence-api/src/etc/jdstyle.css
   projects/javaee/trunk/jboss-persistence-api/src/etc/license.txt
   projects/javaee/trunk/jboss-persistence-api/src/main/
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverride.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverrides.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverride.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverrides.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Basic.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/CascadeType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Column.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ColumnResult.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorColumn.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorValue.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embeddable.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embedded.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EmbeddedId.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Entity.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityExistsException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityListeners.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManager.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManagerFactory.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityNotFoundException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityResult.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityTransaction.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EnumType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Enumerated.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeDefaultListeners.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeSuperclassListeners.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FetchType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FieldResult.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FlushModeType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GeneratedValue.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GenerationType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Id.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/IdClass.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Inheritance.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/InheritanceType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumn.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumns.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinTable.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Lob.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/LockModeType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToMany.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToOne.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MapKey.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MappedSuperclass.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQueries.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQuery.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQueries.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQuery.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NoResultException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NonUniqueResultException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToMany.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToOne.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OptimisticLockException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OrderBy.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Persistence.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContext.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContextType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContexts.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceProperty.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnit.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnits.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostLoad.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostPersist.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostRemove.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostUpdate.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrePersist.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreRemove.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreUpdate.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumn.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumns.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Query.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/QueryHint.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/RollbackException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTable.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTables.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SequenceGenerator.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMapping.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMappings.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Table.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TableGenerator.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Temporal.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TemporalType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TransactionRequiredException.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Transient.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/UniqueConstraint.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Version.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/package-info.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/ClassTransformer.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceProvider.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitInfo.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitTransactionType.java
   projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/package-info.java
Log:
EJB 3.0 Persistence API


Property changes on: projects/javaee/trunk/jboss-persistence-api
___________________________________________________________________
Name: svn:ignore
   + target


Added: projects/javaee/trunk/jboss-persistence-api/.classpath
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/.classpath	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/.classpath	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,5 @@
+<classpath>
+  <classpathentry kind="src" path="src/main"/>
+  <classpathentry kind="output" path="target/eclipse-classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>

Added: projects/javaee/trunk/jboss-persistence-api/.project
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/.project	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/.project	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,13 @@
+<projectDescription>
+  <name>jboss-persistence-api</name>
+  <comment>The Java Persistence 3.0 API classes</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: projects/javaee/trunk/jboss-persistence-api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/.settings/org.eclipse.jdt.core.prefs	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/.settings/org.eclipse.jdt.core.prefs	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,5 @@
+#Wed Mar 21 11:33:40 CET 2007
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5

Added: projects/javaee/trunk/jboss-persistence-api/pom.xml
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/pom.xml	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/pom.xml	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,50 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>jboss</groupId>
+    <artifactId>jboss-javaee</artifactId>
+    <version>5.0.0-SNAPSHOT</version>
+    <relativePath>../build/pom.xml</relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>jboss</groupId>
+  <artifactId>jboss-persistence-api</artifactId>
+  <version>3.0.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>JBoss Persistence 3.0 API</name>
+  <url>http://www.jboss.org</url>
+  <description>The Java Persistence 3.0 API classes</description>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <Specification-Title>Enterprise JavaBeans 3.0</Specification-Title>
+              <Specification-Version>Final Release</Specification-Version>
+              <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <doctitle>EJB 3.0 Persistence API Documentation</doctitle>
+          <links>
+            <link>http://java.sun.com/j2se/1.5/docs/api</link>
+          </links>
+          <stylesheetfile>jdstyle.css</stylesheetfile>
+          <windowtitle>EJB 3.0 Persistence API Documentation</windowtitle>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>

Added: projects/javaee/trunk/jboss-persistence-api/src/etc/jdstyle.css
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/etc/jdstyle.css	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/etc/jdstyle.css	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,117 @@
+/* Javadoc style sheet */
+
+/* Define colors, fonts and other style attributes here to override the defaults  */
+
+/* Page background color */
+body { 	font-family: Arial;
+	background-color: white;
+	font-size: 10pt;
+ }
+td { 	font-family: Arial;
+	font-size: 10pt;
+ }
+/* Table colors */
+.TableHeadingColor     { background: #F4F4F4 }
+.TableSubHeadingColor  { background: #F4F4F4 }
+.TableRowColor         { background: #FFFFFF }
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont   { font-size: normal; font-family: Arial }
+.FrameHeadingFont { font-size: normal; font-family: Arial }
+.FrameItemFont    { font-size: normal; font-family: Arial }
+
+/* Example of smaller, sans-serif font in frames */
+/* .FrameItemFont  { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */
+
+/* Navigation bar fonts and colors */
+.NavBarCell1    { background-color:#F4F4F4;}
+.NavBarCell1Rev { background-color:silver;}
+
+.NavBarFont1    { font-family: Arial, Helvetica, sans-serif; color:#000000;}
+.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;}
+
+.NavBarCell2    { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+.NavBarCell3    { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;}
+
+A {
+    color: #003399;
+}
+
+A:active {
+    color: #003399;
+}
+
+A:visited {
+    color: #888888;
+}
+
+P, OL, UL, LI, DL, DT, DD, BLOCKQUOTE {
+    color: #000000;
+}
+
+TD, TH, SPAN {
+    color: #000000;
+}
+
+BLOCKQUOTE {
+    margin-right: 0px;
+}
+
+
+/*H1, H2, H3, H4, H5, H6    {
+    color: #000000;
+    font-weight:500;
+    margin-top:10px;
+    padding-top:15px;
+}
+
+H1 { font-size: 150%; }
+H2 { font-size: 140%; }
+H3 { font-size: 110%; font-weight: bold; }
+H4 { font-size: 110%; font-weight: bold;}
+H5 { font-size: 100%; font-style: italic; }
+H6 { font-size: 100%; font-style: italic; }*/
+
+TT {
+font-size: 90%;
+    font-family: "Courier New", Courier, monospace;
+    color: #000000;
+}
+
+PRE {
+font-size: 90%;
+    padding: 5px;
+    border-style: solid;
+    border-width: 1px;
+    border-color: #CCCCCC;
+    background-color: #F4F4F4;
+}
+
+UL, OL, LI {
+    list-style: disc;
+}
+
+HR  {
+    width: 100%;
+    height: 1px;
+    background-color: #CCCCCC;
+    border-width: 0px;
+    padding: 0px;
+    color: #CCCCCC;
+}
+
+.variablelist { 
+    padding-top: 10; 
+    padding-bottom:10; 
+    margin:0;
+}
+
+.itemizedlist, UL { 
+    padding-top: 0; 
+    padding-bottom:0; 
+    margin:0; 
+}
+
+.term { 
+    font-weight:bold;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/etc/license.txt
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/etc/license.txt	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/etc/license.txt	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,119 @@
+Specification: JSR-000220 Enterprise JavaBeans v.3.0 ("Specification")
+Version: 3.0
+Status: Final Release
+Release: 8 May 2006
+Copyright 2006 SUN MICROSYSTEMS, INC.
+4150 Network Circle, Santa Clara, California 95054, U.S.A
+All rights reserved.
+LIMITED LICENSE GRANTS
+1. _License for Evaluation Purposes_. Sun hereby grants you a fully-paid, non-exclusive, non-transferable,
+worldwide, limited license (without the right to sublicense), under Sun’s applicable intellectual
+property rights to view, download, use and reproduce the Specification only for the purpose of internal
+evaluation. This includes (i) developing applications intended to run on an implementation of the Specification,
+provided that such applications do not themselves implement any portion(s) of the Specification,
+and (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the
+Specification in oral or written communications which discuss the Specification provided that such excerpts
+do not in the aggregate constitute a significant portion of the Specification.
+2. _License for the Distribution of Compliant Implementations_. Sun also grants you a perpetual, nonexclusive,
+non-transferable, worldwide, fully paid-up, royalty free, limited license (without the right to
+sublicense) under any applicable copyrights or, subject to the provisions of subsection 4 below, patent
+rights it may have covering the Specification to create and/or distribute an Independent Implementation
+of the Specification that: (a) fully implements the Specification including all its required interfaces and
+functionality; (b) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include
+any public or protected packages, classes, Java interfaces, fields or methods within the Licensor
+Name Space other than those required/authorized by the Specification or Specifications being implemented;
+and (c) passes the Technology Compatibility Kit (including satisfying the requirements of the
+applicable TCK Users Guide) for such Specification ("Compliant Implementation"). In addition, the
+foregoing license is expressly conditioned on your not acting outside its scope. No license is granted
+hereunder for any other purpose (including, for example, modifying the Specification, other than to the
+extent of your fair use rights, or distributing the Specification to third parties). Also, no right, title, or
+interest in or to any trademarks, service marks, or trade names of Sun or Sun’s licensors is granted hereunder.
+Java, and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems,
+Inc. in the U.S. and other countries.
+3. _Pass-through Conditions_. You need not include limitations (a)-(c) from the previous paragraph or
+any other particular "pass through" requirements in any license You grant concerning the use of your Independent
+Implementation or products derived from it. However, except with respect to Independent Implementations
+(and products derived from them) that satisfy limitations (a)-(c) from the previous
+paragraph, You may neither: (a) grant or otherwise pass through to your licensees any licenses under
+Sun’s applicable intellectual property rights; nor (b) authorize your licensees to make any claims concerning
+their implementation’s compliance with the Specification in question.
+4. _Reciprocity Concerning Patent Licenses_.
+a. With respect to any patent claims covered by the license granted under subparagraph 2 above that
+would be infringed by all technically feasible implementations of the Specification, such license is conditioned
+upon your offering on fair, reasonable and non-discriminatory terms, to any party seeking it
+from You, a perpetual, non-exclusive, non-transferable, worldwide license under Your patent rights
+which are or would be infringed by all technically feasible implementations of the Specification to develop,
+distribute and use a Compliant Implementation.
+b With respect to any patent claims owned by Sun and covered by the license granted under subparagraph
+2, whether or not their infringement can be avoided in a technically feasible manner when implementing
+the Specification, such license shall terminate with respect to such claims if You initiate a claim against
+Sun that it has, in the course of performing its responsibilities as the Specification Lead, induced any other
+entity to infringe Your patent rights.
+c Also with respect to any patent claims owned by Sun and covered by the license granted under subparagraph
+2 above, where the infringement of such claims can be avoided in a technically feasible manner
+when implementing the Specification such license, with respect to such claims, shall terminate if You
+initiate a claim against Sun that its making, having made, using, offering to sell, selling or importing a
+Compliant Implementation infringes Your patent rights.
+5. _Definitions_. For the purposes of this Agreement: "Independent Implementation" shall mean an implementation
+of the Specification that neither derives from any of Sun’s source code or binary code materials
+nor, except with an appropriate and separate license from Sun, includes any of Sun’s source code
+or binary code materials; "Licensor Name Space" shall mean the public class or interface declarations
+whose names begin with "java", "javax", "com.sun" or their equivalents in any subsequent naming convention
+adopted by Sun through the Java Community Process, or any recognized successors or replacements
+thereof; and "Technology Compatibility Kit" or "TCK" shall mean the test suite and
+accompanying TCK User’s Guide provided by Sun which corresponds to the Specification and that was
+available either (i) from Sun 120 days before the first release of Your Independent Implementation that
+allows its use for commercial purposes, or (ii) more recently than 120 days from such release but against
+which You elect to test Your implementation of the Specification.
+This Agreement will terminate immediately without notice from Sun if you breach the Agreement or act
+outside the scope of the licenses granted above.
+DISCLAIMER OF WARRANTIES
+THE SPECIFICATION IS PROVIDED "AS IS". SUN MAKES NO REPRESENTATIONS OR WARRANTIES,
+EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT
+(INCLUDING AS A CONSEQUENCE OF ANY PRACTICE OR IMPLEMENTATION
+OF THE SPECIFICATION), OR THAT THE CONTENTS OF THE SPECIFICATION ARE
+SUITABLE FOR ANY PURPOSE. This document does not represent any commitment to release or implement
+any portion of the Specification in any product. In addition, the Specification could include technical
+inaccuracies or typographical errors.
+LIMITATION OF LIABILITY
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS
+BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE,
+PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ARISING OUT OF OR RELATED IN ANY WAY TO YOUR HAVING, IMPLEMENTING OR
+OTHERWISE USING THE SPECIFICATION, EVEN IF SUN AND/OR ITS LICENSORS HAVE
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+You will indemnify, hold harmless, and defend Sun and its licensors from any claims arising or resulting
+from: (i) your use of the Specification; (ii) the use or distribution of your Java application, applet and/or
+implementation; and/or (iii) any claims that later versions or releases of any Specification furnished to
+you are incompatible with the Specification provided to you under this license.
+
+RESTRICTED RIGHTS LEGEND
+U.S. Government: If this Specification is being acquired by or on behalf of the U.S. Government or by a
+U.S. Government prime contractor or subcontractor (at any tier), then the Government’s rights in the
+Software and accompanying documentation shall be only as set forth in this license; this is in accordance
+with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with
+48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions).
+REPORT
+If you provide Sun with any comments or suggestions concerning the Specification ("Feedback"), you
+hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii)
+grant Sun a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense
+through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the
+Feedback for any purpose.
+GENERAL TERMS
+Any action related to this Agreement will be governed by California law and controlling U.S. federal law.
+The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction
+will not apply.
+The Specification is subject to U.S. export control laws and may be subject to export or import regulations
+in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges
+that it has the responsibility to obtain such licenses to export, re-export or import as may be
+required after delivery to Licensee.
+This Agreement is the parties’ entire agreement relating to its subject matter. It supersedes all prior or
+contemporaneous oral or written communications, proposals, conditions, representations and warranties
+and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication
+between the parties relating to its subject matter during the term of this Agreement. No modification
+to this Agreement will be binding, unless in writing and signed by an authorized representative
+of each party.
+Rev. April, 2006
+Sun/Final/Full
\ No newline at end of file

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverride.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverride.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverride.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,34 @@
+//$Id:$
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+
+/**
+ * This annotation is used to override a many-to-one or one-to-one mapping of property or field for
+ * an entity relationship.
+ * The AssociationOverride annotation may be applied to an entity that extends a mapped superclass
+ * to override a many-to-one or one-to-one mapping defined by the mapped superclass. If the
+ * AssociationOverride annotation is not specified, the join column is mapped the same as in
+ * the original mapping.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+public @interface AssociationOverride {
+	/**
+	 * The name of the relationship property whose mapping is being overridden if property-based
+	 * access is being used, or the name of the relationship field if field-based access is used.
+	 */
+	String name();
+
+	/**
+	 * The join column that is being mapped to the persistent attribute.
+	 */
+	JoinColumn[] joinColumns();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverrides.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverrides.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AssociationOverrides.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,24 @@
+//$Id:$
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+
+/**
+ * This annotation is used to override mappings of multiple many-to-one
+ * or one-to-one relationship properties or fields.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+public @interface AssociationOverrides {
+	/**
+	 * Mapping overrides of relationship properties or fields
+	 */
+	AssociationOverride[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverride.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverride.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverride.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,34 @@
+//$Id: AttributeOverride.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.*;
+import static java.lang.annotation.ElementType.*;
+
+
+/**
+ * The AttributeOverride annotation is used to override the mapping of a Basic (whether explicit
+ * or default) property or field or Id property or field.
+ *
+ * The AttributeOverride annotation may be applied to an entity that extends a mapped superclass
+ * or to an embedded field or property to override a basic mapping defined by the mapped superclass
+ * or embeddable class. If the AttributeOverride annotation is not specified, the column is mapped
+ * the same as in the original mapping.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+public @interface AttributeOverride {
+	/**
+	 * The name of the property whose mapping is being overridden if property-based access is being
+	 * used, or the name of the field if field-based access is used.
+	 */
+	String name();
+	/**
+	 * The column that is being mapped to the persistent attribute
+	 */
+	Column column();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverrides.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverrides.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/AttributeOverrides.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,23 @@
+//$Id: AttributeOverrides.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.*;
+import static java.lang.annotation.ElementType.*;
+
+
+/**
+ * Is used to override mappings of multiple properties or fields
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+public @interface AttributeOverrides {
+	/**
+	 * One or more mapping override
+	 */
+	AttributeOverride[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Basic.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Basic.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Basic.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,39 @@
+//$Id: Basic.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+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;
+import static javax.persistence.FetchType.EAGER;
+
+/**
+ * The Basic annotation is the simplest type of mapping to a database column. The Basic
+ * annotation can be applied to a persistent property or instance variable of any of the
+ * following types: Java primitive types, wrappers of the primitive types, String,
+ * java.math.BigInteger, java.math.BigDecimal, java.util.Date, java.util.Calendar,
+ * java.sql.Date, java.sql.Time, java.sql.Timestamp, byte[], Byte[], char[], Character[],
+ * enums, and any other type that implements Serializable.
+ *
+ * The use of the Basic annotation is optional for persistent fields and properties of these types.
+
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Basic {
+	/**
+	 * Defines whether the value of the field or property should be lazily loaded or must be
+	 * eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime
+	 * that the value must be eagerly fetched. The LAZY strategy is a hint to the persistence
+	 * provider runtime. If not specified, defaults to EAGER.
+	 */
+	FetchType fetch() default EAGER;
+	/**
+	 * Defines whether the value of the field or property may be null. This is a hint and is
+	 * disregarded for primitive types; it may be used in schema generation. If not specified,
+	 * defaults to true.
+	 */
+	boolean optional() default true;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/CascadeType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/CascadeType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/CascadeType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,32 @@
+//$Id: CascadeType.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+/**
+ * Defines the set of cascadable operations that are propagated to the associated entity.
+ * The value cascade=ALL is equivalent to cascade={PERSIST, MERGE, REMOVE, REFRESH}.
+ *
+ * @author Emmanuel Bernard
+ */
+public enum CascadeType {
+	/**
+	 * Cascade all operations
+	 */
+	ALL,
+	/**
+	 * Cascade persist operations
+	 */
+	PERSIST,
+	/**
+	 * Cascade merge operations
+	 */
+	MERGE,
+	/**
+	 * Cascade remove operations
+	 */
+	REMOVE,
+	/**
+	 * Cascade refresh operations
+	 */
+	REFRESH 
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Column.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Column.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Column.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,65 @@
+//$Id: Column.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Is used to specify a mapped column for a persistent property or field. If no Column annotation is
+ * specified, the default values are applied.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Column {
+	/**
+	 * The name of the column. Defaults to the property or field name
+	 */
+	String name() default "";
+	/**
+	 * Whether the property is a unique key. This is a shortcut for the UniqueConstraint
+	 * annotation at the table level and is useful for when the unique key constraint is
+	 * only a single field. This constraint applies in addition to any constraint entailed
+	 * by primary key mapping and to constraints specified at the table level.
+	 */
+	boolean unique() default false;
+	/**
+	 * Whether the database column is nullable
+	 */
+	boolean nullable() default true;
+	/**
+	 * Whether the column is included in SQL INSERT statements generated by the persistence provider.
+	 */
+	boolean insertable() default true;
+	/**
+	 * Whether the column is included in SQL UPDATE statements generated by the persistence provider.
+	 */
+	boolean updatable() default true;
+	/**
+	 * The SQL fragment that is used when generating the DDL for the column.
+	 * Defaults to the generated SQL to create a column of the inferred type.
+	 */
+	String columnDefinition() default "";
+	/**
+	 * The name of the table that contains the column. If absent the column is assumed to
+	 * be in the primary table.
+	 */
+	String table() default "";
+	/**
+	 * The column length. (Applies only if a string-valued column is used.)
+	 */
+	int length() default 255;
+	/**
+	 * The precision for a decimal (exact numeric) column. (Applies only if a decimal column is used.)
+	 * Value must be set by developer if used when generating the DDL for the column.
+	 */
+	int precision() default 0;
+	/**
+	 * The scale for a decimal (exact numeric) column. (Applies only if a decimal column is used.)
+	 */
+	int scale() default 0;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ColumnResult.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ColumnResult.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ColumnResult.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,22 @@
+//$Id: ColumnResult.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * References name of a column in the SELECT clause of a SQL query - i.e.,
+ * column alias, if applicable. Scalar result types can be included in the query
+ * result by specifying this annotation in the metadata.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({}) @Retention(RetentionPolicy.RUNTIME)
+public @interface ColumnResult {
+	/**
+	 * The name of a column in the SELECT clause of a SQL query
+	 */
+	String name();
+}
\ No newline at end of file

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorColumn.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorColumn.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorColumn.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,47 @@
+//$Id: DiscriminatorColumn.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static javax.persistence.DiscriminatorType.STRING;
+
+/**
+ * Is used to define the discriminator column for the SINGLE_TABLE and JOINED inheritance
+ * mapping strategies.
+ *
+ * The strategy and the discriminator column are only specified in the root of an entity
+ * class hierarchy or subhierarchy in which a different inheritance strategy is applied
+ *
+ * If the DiscriminatorColumn annotation is missing, and a discriminator column is required,
+ * the name of the discriminator column defaults to "DTYPE" and the discriminator type to
+ * DiscriminatorType.STRING.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface DiscriminatorColumn {
+	/**
+	 * The name of column to be used for the discriminator.
+	 */
+	String name() default "DTYPE";
+	/**
+	 * The type of object/column to use as a class discriminator.
+	 * Defaults to DiscriminatorType.STRING
+	 */
+	DiscriminatorType discriminatorType() default STRING;
+	/**
+	 * The SQL fragment that is used when generating the DDL for the discriminator column.
+	 * Defaults to the provider-generated SQL to create a column of the specified
+	 * discriminator type.
+	 */
+	String columnDefinition() default "";
+	/**
+	 * The column length for String-based discriminator types. Ignored for other
+	 * discriminator types.
+	 */
+	int length() default 31;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,23 @@
+//$Id: DiscriminatorType.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+/**
+ * Defines supported types of the discriminator column
+ *
+ * @author Emmanuel Bernard
+ */
+public enum DiscriminatorType {
+	/**
+	 * String as the discriminator type
+	 */
+	STRING,
+	/**
+	 * Single character as the discriminator type
+	 */
+	CHAR,
+	/**
+	 * Integer as the discriminator type
+	 */
+	INTEGER
+};

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorValue.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorValue.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/DiscriminatorValue.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,33 @@
+//$Id: DiscriminatorValue.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+
+/**
+ * Is used to specify the value of the discriminator column for entities of the given type.
+ * The DiscriminatorValue annotation can only be specified on a concrete entity class.
+ * If the DiscriminatorValue annotation is not specified and a discriminator column is used,
+ * a provider-specific function will be used to generate a value representing the entity type.
+ * If the DiscriminatorType is STRING, the discriminator value default is the entity name.
+ *
+ * The inheritance strategy and the discriminator column are only specified in the root
+ * of an entity class hierarchy or subhierarchy in which a different inheritance strategy
+ * is applied. The discriminator value, if not defaulted, should be specified for each entity
+ * class in the hierarchy.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface DiscriminatorValue {
+	/**
+	 * The value that indicates that the row is an entity of the annotated entity type.
+	 * 
+	 * If the DiscriminatorValue annotation is not specified and a discriminator column is used,
+	 * a provider-specific function will be used to generate a value representing the entity type.
+	 * If the DiscriminatorType is STRING, the discriminator value default is the entity name.
+	 */
+	String value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embeddable.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embeddable.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embeddable.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,22 @@
+//$Id: Embeddable.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB Specification Copyright 2004 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * Defines a class whose instances are stored as an intrinsic part of an owning entity and share
+ * the identity of the entity. Each of the persistent properties or fields of the embedded object
+ * is mapped to the database table for the entity. Only Basic, Column, Lob, Temporal, and
+ * Enumerated mapping annotations may portably be used to map the persistent fields or properties
+ * of classes annotated as Embeddable.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface Embeddable {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embedded.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embedded.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Embedded.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,18 @@
+//$Id: Embedded.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB Specification Copyright 2004 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Defines a persistent field or property of an entity whose value is an instance of
+ * an embeddable class. The embeddable class must be annotated as Embeddable.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Embedded {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EmbeddedId.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EmbeddedId.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EmbeddedId.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,19 @@
+//$Id: EmbeddedId.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Is applied to a persistent field or property of an entity class or mapped superclass to denote
+ * a composite primary key that is an embeddable class. The embeddable class must be annotated
+ * as Embeddable.
+ * 
+ * @author Emmanuel Bernard
+ */
+ at Target({ElementType.METHOD, ElementType.FIELD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface EmbeddedId {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Entity.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Entity.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Entity.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,23 @@
+//$Id: Entity.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies that the class is an entity. This annotation is applied to the entity class.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target(TYPE) @Retention(RUNTIME)
+public @interface Entity {
+	/**
+	 * The name of an entity. Defaults to the unqualified name of the entity class.
+	 * This name is used to refer to the entity in queries. The name must not be a
+	 * reserved literal in the Java Persistence query language.
+	 */
+	String name() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityExistsException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityExistsException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityExistsException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,45 @@
+//$Id: $
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when EntityManager.persist(Object) is called and the
+ * entity already exists. The current transaction, if one is active, will be marked for rollback.
+ *
+ * @author Emmanuel Bernard
+ */
+public class EntityExistsException extends PersistenceException {
+	/**
+	 * Constructs a new EntityExistsException exception with null as its detail message.
+	 */
+	public EntityExistsException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new EntityExistsException exception with the specified cause.
+	 *
+	 * @param cause the cause
+	 */
+	public EntityExistsException(Throwable cause) {
+		super( cause );
+	}
+
+	/**
+	 * Constructs a new EntityExistsException exception with the specified detail message.
+	 *
+	 * @param message the detail message.
+	 */
+	public EntityExistsException(String message) {
+		super( message );
+	}
+
+	/**
+	 * Constructs a new EntityExistsException exception with the specified detail message and cause.
+	 *
+	 * @param message the detail message.
+	 * @param cause the cause.
+	 */
+	public EntityExistsException(String message, Throwable cause) {
+		super( message, cause );
+	}
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityListeners.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityListeners.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityListeners.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * Specifies the callback listener classes to be used for an entity or mapped superclass.
+ * This annotation may be applied to an entity class or mapped superclass.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface EntityListeners {
+	/**
+	 * The callback listener classes
+	 */
+   Class[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManager.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManager.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManager.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,298 @@
+// $Id: EntityManager.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Interface used to interact with the persistence context.
+ *
+ * An EntityManager instance is associated with a persistence context. A persistence context is a set of
+ * entity instances in which for any persistent entity identity there is a unique entity instance.
+ * Within the persistence context, the entity instances and their lifecycle are managed. This interface
+ * defines the methods that are used to interact with the persistence context. The EntityManager API is
+ * used to create and remove persistent entity instances, to find entities by their primary key, and to
+ * query over entities.
+ *
+ * The set of entities that can be managed by a given EntityManager instance is defined by a persistence unit.
+ * A persistence unit defines the set of all classes that are related or grouped by the application, and
+ * which must be colocated in their mapping to a single database.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface EntityManager {
+	/**
+	 * Make an entity instance managed and persistent.
+	 *
+	 * @param entity
+	 * @throws EntityExistsException		if the entity already exists.
+	 *                                      (The EntityExistsException may be thrown when the persist
+	 *                                      operation is invoked, or the EntityExistsException or
+	 *                                      another PersistenceException may be thrown at commit
+	 *                                      time.)
+	 * @throws IllegalStateException if this EntityManager has been closed.
+	 * @throws IllegalArgumentException	 if not an entity
+	 * @throws TransactionRequiredException if invoked on a
+	 *                                      container-managed entity manager of type
+	 *                                      PersistenceContextType.TRANSACTION and there is
+	 *                                      no transaction.
+	 */
+	public void persist(Object entity);
+
+	/**
+	 * Merge the state of the given entity into the
+	 * current persistence context.
+	 *
+	 * @param entity
+	 * @return the instance that the state was merged to
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException	 if instance is not an
+	 *                                      entity or is a removed entity
+	 * @throws TransactionRequiredException if invoked on a
+	 *                                      container-managed entity manager of type
+	 *                                      PersistenceContextType.TRANSACTION and there is
+	 *                                      no transaction.
+	 */
+	public <T> T merge(T entity);
+
+	/**
+	 * Remove the entity instance.
+	 *
+	 * @param entity
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException	 if not an entity
+	 *                                      or if a detached entity
+	 * @throws TransactionRequiredException if invoked on a
+	 *                                      container-managed entity manager of type
+	 *                                      PersistenceContextType.TRANSACTION and there is
+	 *                                      no transaction.
+	 */
+	public void remove(Object entity);
+
+	/**
+	 * Find by primary key.
+	 *
+	 * @param entityClass
+	 * @param primaryKey
+	 * @return the found entity instance or null
+	 *         if the entity does not exist
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException if the first argument does
+	 *                                  not denote an entity type or the second
+	 *                                  argument is not a valid type for that
+	 *                                  entity’s primary key
+	 */
+	public <T> T find(Class<T> entityClass, Object primaryKey);
+
+	/**
+	 * Get an instance, whose state may be lazily fetched.
+	 * If the requested instance does not exist in the database,
+	 * the EntityNotFoundException is thrown when the instance
+	 * state is first accessed. (The persistence provider runtime is
+	 * permitted to throw the EntityNotFoundException when
+	 * getReference is called.)
+	 * The application should not expect that the instance state will
+	 * be available upon detachment, unless it was accessed by the
+	 * application while the entity manager was open.
+	 *
+	 * @param entityClass
+	 * @param primaryKey
+	 * @return the found entity instance
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException if the first argument does
+	 *                                  not denote an entity type or the second
+	 *                                  argument is not a valid type for that
+	 *                                  entity’s primary key
+	 * @throws EntityNotFoundException  if the entity state
+	 *                                  cannot be accessed
+	 */
+	public <T> T getReference(Class<T> entityClass, Object primaryKey);
+
+	/**
+	 * Synchronize the persistence context to the
+	 * underlying database.
+	 *
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws TransactionRequiredException if there is
+	 *                                      no transaction
+	 * @throws PersistenceException		 if the flush fails
+	 */
+	public void flush();
+
+	/**
+	 * Set the flush mode that applies to all objects contained
+	 * in the persistence context.
+	 *
+	 * @param flushMode
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 */
+	public void setFlushMode(FlushModeType flushMode);
+
+	/**
+	 * Get the flush mode that applies to all objects contained
+	 * in the persistence context.
+	 *
+	 * @return flushMode
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 */
+	public FlushModeType getFlushMode();
+
+	/**
+	 * Set the lock mode for an entity object contained
+	 * in the persistence context.
+	 *
+	 * @param entity
+	 * @param lockMode
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws PersistenceException		 if an unsupported lock call
+	 *                                      is made
+	 * @throws IllegalArgumentException	 if the instance is not
+	 *                                      an entity or is a detached entity
+	 * @throws TransactionRequiredException if there is no
+	 *                                      transaction
+	 */
+	public void lock(Object entity, LockModeType lockMode);
+
+	/**
+	 * Refresh the state of the instance from the database,
+	 * overwriting changes made to the entity, if any.
+	 *
+	 * @param entity
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException	 if not an entity
+	 *                                      or entity is not managed
+	 * @throws TransactionRequiredException if invoked on a
+	 *                                      container-managed entity manager of type
+	 *                                      PersistenceContextType.TRANSACTION and there is
+	 *                                      no transaction.
+	 * @throws EntityNotFoundException	  if the entity no longer
+	 *                                      exists in the database
+	 */
+	public void refresh(Object entity);
+
+	/**
+	 * Clear the persistence context, causing all managed
+	 * entities to become detached. Changes made to entities that
+	 * have not been flushed to the database will not be
+	 * persisted.
+	 *
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 */
+	public void clear();
+
+	/**
+	 * Check if the instance belongs to the current persistence
+	 * context.
+	 *
+	 * @param entity
+	 * @return <code>true</code> if the instance belongs to the current persistence context.
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException if not an entity
+	 */
+	public boolean contains(Object entity);
+
+	/**
+	 * Create an instance of Query for executing an
+	 * EJB QL statement.
+	 *
+	 * @param ejbqlString an EJB QL query string
+	 * @return the new query instance
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException if query string is not valid
+	 */
+	public Query createQuery(String ejbqlString);
+
+	/**
+	 * Create an instance of Query for executing a
+	 * named query (in EJB QL or native SQL).
+	 *
+	 * @param name the name of a query defined in metadata
+	 * @return the new query instance
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws IllegalArgumentException if a query has not been
+	 *                                  defined with the given name
+	 */
+	public Query createNamedQuery(String name);
+
+	/**
+	 * Create an instance of Query for executing
+	 * a native SQL statement, e.g., for update or delete.
+	 *
+	 * @param sqlString a native SQL query string
+	 * @return the new query instance
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 */
+	public Query createNativeQuery(String sqlString);
+
+	/**
+	 * Create an instance of Query for executing
+	 * a native SQL query.
+	 *
+	 * @param sqlString   a native SQL query string
+	 * @param resultClass the class of the resulting instance(s)
+	 * @return the new query instance
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 */
+	public Query createNativeQuery(String sqlString, Class resultClass);
+
+	/**
+	 * Create an instance of Query for executing
+	 * a native SQL query.
+	 *
+	 * @param sqlString		a native SQL query string
+	 * @param resultSetMapping the name of the result set mapping
+	 * @return the new query instance
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 */
+	public Query createNativeQuery(String sqlString, String resultSetMapping);
+
+	/**
+	 * Indicate to the EntityManager that a JTA transaction is
+	 * active. This method should be called on a JTA application
+	 * managed EntityManager that was created outside the scope
+	 * of the active transaction to associate it with the current
+	 * JTA transaction.
+	 *
+	 * @throws IllegalStateException if this EntityManager has been closed
+	 * @throws TransactionRequiredException if there is
+	 *                                      no transaction.
+	 */
+	public void joinTransaction();
+
+   /**
+    * Return the underlying provider object for the EntityManager, if available.
+    * The result of this method is implementation specific
+    *
+    * @throws IllegalStateException if this EntityManager has been closed
+    */
+   public Object getDelegate();
+
+   /**
+	 * Close an application-managed EntityManager.
+	 * After the close method has been invoked, all methods
+	 * on the EntityManager instance and any Query objects obtained
+	 * from it will throw the IllegalStateException except
+	 * for getTransaction and isOpen (which will return false).
+	 * If this method is called when the EntityManager is
+	 * associated with an active transaction, the persistence
+	 * context remains managed until the transaction completes.
+	 *
+	 * @throws IllegalStateException if the EntityManager is container-managed or has been already closed
+	 */
+	public void close();
+
+	/**
+	 * Determine whether the EntityManager is open.
+	 *
+	 * @return true until the EntityManager has been closed.
+	 */
+	public boolean isOpen();
+
+	/**
+	 * Return the resource-level transaction object.
+	 * The EntityTransaction instance may be used serially to
+	 * begin and commit multiple transactions.
+	 *
+	 * @return EntityTransaction instance
+	 * @throws IllegalStateException if invoked on a JTA
+	 *                               EntityManager.
+	 */
+	public EntityTransaction getTransaction();
+}
\ No newline at end of file


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManager.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManagerFactory.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManagerFactory.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManagerFactory.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,49 @@
+//$Id: EntityManagerFactory.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.util.Map;
+
+/**
+ * The EntityManagerFactory interface is used by the application to obtain an
+ * application-managed entity manager. When the application has finished using
+ * the entity manager factory, and/or at application shutdown, the application
+ * should close the entity manager factory. Once an EntityManagerFactory has been
+ * closed, all its entity managers are considered to be in the closed state.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface EntityManagerFactory {
+
+	/**
+	 * Create a new EntityManager.
+	 * This method returns a new EntityManager instance each time
+	 * it is invoked.
+	 * The isOpen method will return true on the returned instance.
+	 */
+	EntityManager createEntityManager();
+
+	/**
+	 * Create a new EntityManager with the specified Map of
+	 * properties.
+	 * This method returns a new EntityManager instance each time
+	 * it is invoked.
+	 * The isOpen method will return true on the returned instance.
+	 */
+	EntityManager createEntityManager(Map map);
+
+	/**
+	 * Close the factory, releasing any resources that it holds.
+	 * After a factory instance is closed, all methods invoked on
+	 * it will throw an IllegalStateException, except for isOpen,
+	 * which will return false. Once an EntityManagerFactory has
+	 * been closed, all its entity managers are considered to be
+	 * in the closed state.
+	 */
+	void close();
+
+	/**
+	 * Indicates whether or not this factory is open. Returns
+	 * true until a call to close has been made.
+	 */
+	public boolean isOpen();
+}
\ No newline at end of file


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityManagerFactory.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityNotFoundException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityNotFoundException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityNotFoundException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,29 @@
+//$Id: EntityNotFoundException.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an entity reference obtained by
+ * EntityManager.getReference(Class,Object)  is accessed but the entity does not exist.
+ * Also thrown when EntityManager.refresh(Object) is called and the object no longer exists
+ * in the database. The current transaction, if one is active, will be marked for rollback.
+ *
+ * @author Gavin King
+ */
+public class EntityNotFoundException extends PersistenceException {
+	/**
+	 * Constructs a new EntityNotFoundException exception with null as its detail message.
+	 */
+	public EntityNotFoundException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new EntityNotFoundException exception with the specified detail message.
+	 *
+	 * @param message the detail message
+	 */
+	public EntityNotFoundException(String message) {
+		super( message );
+	}
+
+}


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityNotFoundException.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityResult.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityResult.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityResult.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,33 @@
+//$Id: EntityResult.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * References an entity in the SELECT clause of a SQL query. If this annotation is used,
+ * the SQL statement should select all of the columns that are mapped to the entity object.
+ * This should include foreign key columns to related entities. The results obtained when
+ * insufficient data is available are undefined.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({}) @Retention(RetentionPolicy.RUNTIME)
+public @interface EntityResult {
+	/**
+	 * The class of the result
+	 */
+	Class entityClass();
+	/**
+	 * Maps the columns specified in the SELECT list of the query to the properties or
+	 * fields of the entity class.
+	 */
+	FieldResult[] fields() default {};
+	/**
+	 * Specifies the column name (or alias) of the column in the SELECT list that is used to
+	 * determine the type of the entity instance.
+	 */
+	String discriminatorColumn() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityTransaction.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityTransaction.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityTransaction.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,60 @@
+//$Id: EntityTransaction.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * The EntityTransaction interface is used to control resource transactions
+ * on resource-local entity managers. The EntityManager.getTransaction()
+ * method returns the EntityTransaction interface.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface EntityTransaction {
+	/**
+	 * Start a resource transaction.
+	 *
+	 * @throws IllegalStateException if isActive() is true.
+	 */
+	public void begin();
+
+	/**
+	 * Commit the current transaction, writing any unflushed
+	 * changes to the database.
+	 *
+	 * @throws IllegalStateException if isActive() is false.
+	 * @throws RollbackException	 if the commit fails.
+	 */
+	public void commit();
+
+	/**
+	 * Roll back the current transaction.
+	 *
+	 * @throws IllegalStateException if isActive() is false.
+	 * @throws PersistenceException  if an unexpected error
+	 *                               condition is encountered.
+	 */
+	public void rollback();
+
+	/**
+	 * Mark the current transaction so that the only possible
+	 * outcome of the transaction is for the transaction to be
+	 * rolled back.
+	 *
+	 * @throws IllegalStateException if isActive() is false.
+	 */
+	public void setRollbackOnly();
+
+	/**
+	 * Determine whether the current transaction has been marked
+	 * for rollback.
+	 *
+	 * @throws IllegalStateException if isActive() is false.
+	 */
+	public boolean getRollbackOnly();
+
+	/**
+	 * Indicate whether a transaction is in progress.
+	 * @throws PersistenceException if an unexpected error
+	 * condition is encountered.
+	 */
+	public boolean isActive();
+}
\ No newline at end of file


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EntityTransaction.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EnumType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EnumType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/EnumType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,19 @@
+//$Id: EnumType.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Defines mapping for the enumerated types. The constants of this enumerated type specify how persistent
+ * property or field should be persisted as a enumerated type.
+ *
+ * @author Emmanuel Bernard
+ */
+public enum EnumType {
+	/**
+	 * Persist enumerated type property or field as an integer
+	 */
+	ORDINAL,
+	/**
+	 * Persist enumerated type property or field as a string
+	 */
+	STRING
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Enumerated.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Enumerated.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Enumerated.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,24 @@
+//$Id: Enumerated.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.*;
+import static java.lang.annotation.ElementType.*;
+import static javax.persistence.EnumType.*;
+
+/**
+ * Specifies that a persistent property or field should be persisted as a enumerated type.
+ * It may be used in conjunction with the Basic annotation.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface Enumerated {
+	/**
+	 * The type used in mapping an enum type
+	 */
+	EnumType value() default ORDINAL;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeDefaultListeners.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeDefaultListeners.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeDefaultListeners.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,17 @@
+//$Id: ExcludeDefaultListeners.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies that the invocation of default listeners is to be excluded for the entity class
+ * (or mapped superclass) and its subclasses.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target(TYPE) @Retention(RUNTIME)
+public @interface ExcludeDefaultListeners {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeSuperclassListeners.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeSuperclassListeners.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ExcludeSuperclassListeners.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,17 @@
+//$Id: ExcludeSuperclassListeners.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+
+/**
+ * Specifies that the invocation of superclass listeners is to be excluded for the
+ * entity class (or mapped superclass) and its subclasses.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target(TYPE) @Retention(RUNTIME)
+public @interface ExcludeSuperclassListeners {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FetchType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FetchType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FetchType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,24 @@
+//$Id: FetchType.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+/**
+ * Defines strategies for fetching data from the database.
+ * The EAGER strategy is a requirement on the persistence provider runtime that data must
+ * be eagerly fetched. The LAZY strategy is a hint to the persistence provider runtime that
+ * data should be fetched lazily when it is first accessed. The implementation is permitted to
+ * eagerly fetch data for which the LAZY strategy hint has been specified. In particular, lazy
+ * fetching might only be available for Basic mappings for which property-based access is used.
+ *
+ * @author Emmanuel Bernard
+ */
+public enum FetchType {
+	/**
+	 * Defines that data must be lazily fetched
+	 */
+	LAZY,
+	/**
+	 * Defines that data must be eagerly fetched
+	 */
+	EAGER
+};

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FieldResult.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FieldResult.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FieldResult.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+//$Id: FieldResult.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Is used to map the columns specified in the SELECT list of the query to the properties
+ * or fields of the entity class.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({}) @Retention(RetentionPolicy.RUNTIME)
+public @interface FieldResult {
+	/**
+	 * Name of the persistent field or property of the class.
+	 */
+	String name();
+	/**
+	 * Name of the column in the SELECT clause - i.e., column aliases, if applicable.
+	 */
+	String column();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FlushModeType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FlushModeType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FlushModeType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,29 @@
+//$Id: FlushModeType.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Flush mode setting.
+ *
+ * When queries are executed within a transaction, if FlushModeType.AUTO is set on the Query object,
+ * or if the flush mode setting for the persistence context is AUTO (the default) and a flush mode
+ * setting has not been specified for the Query object, the persistence provider is responsible for
+ * ensuring that all updates to the state of all entities in the persistence context which could
+ * potentially affect the result of the query are visible to the processing of the query.
+ * The persistence provider implementation may achieve this by flushing those entities to the database
+ * or by some other means. If FlushModeType.COMMIT is set, the effect of updates made to entities in the
+ * persistence context upon queries is unspecified.
+ *
+ * If there is no transaction active, the persistence provider must not flush to the database.
+ *
+ * @author Gavin King
+ */
+public enum FlushModeType {
+	/**
+	 * Flushing must occur only at transaction commit
+	 */
+	COMMIT,
+	/**
+	 * (Default) Flushing to occur at query execution
+	 */
+	AUTO
+}


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/FlushModeType.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GeneratedValue.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GeneratedValue.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GeneratedValue.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,32 @@
+//$Id: GeneratedValue.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+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;
+
+/**
+ * Provides for the specification of generation strategies for the values of primary keys.
+ * The GeneratedValue annotation may be applied to a primary key property or field of an entity
+ * or mapped superclass in conjunction with the Id annotation.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface GeneratedValue {
+	/**
+	 * The primary key generation strategy that the persistence provider must use
+	 * to generate the annotated entity primary key.
+	 */
+	GenerationType strategy() default GenerationType.AUTO;
+	/**
+	 * The name of the primary key generator to use as specified in the SequenceGenerator or
+	 * TableGenerator annotation.
+	 *
+	 * Defaults to the id generator supplied by persistence provider. 
+	 */
+	String generator() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GenerationType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GenerationType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/GenerationType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,34 @@
+//$Id: GenerationType.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+/**
+ * Defines the types of primary key generation.
+ *
+ * @author Emmanuel Bernard
+ */
+public enum GenerationType {
+	/**
+	 * Indicates that the persistence provider must assign primary keys for the entity using an underlying
+	 * database table to ensure uniqueness.
+	 */
+	TABLE,
+	/**
+	 * Indicates that the persistence provider must assign primary keys for the entity using database
+	 * sequence column.
+	 */
+	SEQUENCE,
+	/**
+	 * Indicates that the persistence provider must assign primary keys for the entity using
+	 * database identity column.
+	 */
+	IDENTITY,
+	/**
+	 * Indicates that the persistence provider should pick an appropriate strategy for the
+	 * particular database. The AUTO generation strategy may expect a database resource
+	 * to exist, or it may attempt to create one. A vendor may provide documentation on how
+	 * to create such resources in the event that it does not support schema generation or cannot
+	 * create the schema resource at runtime.
+	 */
+	AUTO
+};

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Id.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Id.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Id.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,18 @@
+//$Id: Id.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+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;
+
+
+/**
+ * Specifies the primary key property or field of an entity.
+ * 
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Id {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/IdClass.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/IdClass.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/IdClass.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,26 @@
+//$Id: IdClass.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a composite primary key class that is mapped to multiple fields or properties
+ * of the entity.
+ *
+ * The names of the fields or properties in the primary key class and the primary key fields
+ * or properties of the entity must correspond and their types must be the same.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface IdClass {
+	/**
+	 * Primary key class
+	 */
+	Class value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Inheritance.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Inheritance.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Inheritance.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,23 @@
+//$Id: Inheritance.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import static javax.persistence.InheritanceType.SINGLE_TABLE;
+
+/**
+ * Defines the inheritance strategy to be used for an entity class hierarchy. It is specified
+ * on the entity class that is the root of the entity class hierarchy.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface Inheritance {
+	/**
+	 * The strategy to be used
+	 */
+	InheritanceType strategy() default SINGLE_TABLE;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/InheritanceType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/InheritanceType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/InheritanceType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+//$Id: InheritanceType.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+/**
+ * Defines inheritance strategy options.
+ *
+ * @author Emmanuel Bernard
+ */
+public enum InheritanceType
+{
+	/**
+	 * A single table per class hierarchy
+	 */
+	SINGLE_TABLE,
+	/**
+	 * A table per concrete entity class
+	 */
+	TABLE_PER_CLASS,
+	/**
+	 * A strategy in which fields that are specific to a subclass are mapped to a separate
+	 * table than the fields that are common to the parent class, and a join is performed
+	 * to instantiate the subclass.
+	 */
+	JOINED };

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumn.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumn.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumn.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,67 @@
+//$Id: JoinColumn.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Is used to specify a mapped column for joining an entity association.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface JoinColumn {
+	/**
+	 * The name of the foreign key column.
+	 * The table in which it is found depends upon the context. If the join is for a OneToOne
+	 * or Many- ToOne mapping, the foreign key column is in the table of the source entity.
+	 * If the join is for a ManyToMany, the foreign key is in a join table. Default (only applies
+	 * if a single join column is used): The concatenation of the following: the name of the referencing
+	 * relationship property or field of the referencing entity; "_"; the name of the referenced primary
+	 * key column. If there is no such referencing relationship property or field in the entity, the join
+	 * column name is formed as the concatenation of the following: the name of the entity; "_"; the name
+	 * of the referenced primary key column.
+	 */
+	String name() default "";
+	/**
+	 * The name of the column referenced by this foreign key column. When used with relationship mappings,
+	 * the referenced column is in the table of the target entity. When used inside a JoinTable annotation,
+	 * the referenced key column is in the entity table of the owning entity, or inverse entity if the join
+	 * is part of the inverse join definition. Default (only applies if single join column is being used):
+	 * The same name as the primary key column of the referenced table.
+	 */
+	String referencedColumnName() default "";
+	/**
+	 * Whether the property is a unique key. This is a shortcut for the UniqueConstraint annotation at the
+	 * table level and is useful for when the unique key constraint is only a single field. It is not
+	 * necessary to explicitly specify this for a join column that corresponds to a primary key that is part
+	 * of a foreign key.
+	 */
+	boolean unique() default false;
+	/**
+	 * Whether the foreign key column is nullable
+	 */
+	boolean nullable() default true;
+	/**
+	 * Whether the column is included in SQL INSERT statements generated by the persistence provider
+	 */
+	boolean insertable() default true;
+	/**
+	 * Whether the column is included in SQL UPDATE statements generated by the persistence provider
+	 */
+	boolean updatable() default true;
+	/**
+	 * The SQL fragment that is used when generating the DDL for the column.
+	 * Defaults to the generated SQL for the column.
+	 */
+	String columnDefinition() default "";
+	/**
+	 * The name of the table that contains the column. If a table is not specified, the column is
+	 * assumed to be in the primary table of the applicable entity
+	 */
+	String table() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumns.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumns.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinColumns.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,23 @@
+//$Id: JoinColumns.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Defines mapping for the composite foreign keys.
+ * This annotation groups JoinColumn annotations for the same relationship.
+ *
+ * When the JoinColumns annotation is used, both the name and the referencedColumnName
+ * elements must be specified in each such JoinColumn annotation.
+
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface JoinColumns {
+    JoinColumn[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinTable.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinTable.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/JoinTable.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,63 @@
+//$Id: JoinTable.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * This annotation is used in the mapping of associations. It is specified on the owning
+ * side of a many-to-many association, or in a unidirectional one-to-many association.
+ *
+ * If the JoinTable annotation is missing, the default values of the annotation elements apply.
+ * The name of the join table is assumed to be the table names of the associated primary tables
+ * concatenated together (owning side first) using an underscore.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD})  @Retention(RUNTIME)
+public @interface JoinTable {
+	/**
+	 * The name of the join table.
+	 *
+	 * Defaults to the concatenated names of the two associated primary entity tables,
+	 * separated by an underscore
+	 */
+	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 "";
+	/**
+	 * The foreign key columns of the join table which reference the primary table of the
+	 * entity owning the association (i.e. the owning side of the association).
+	 *
+	 * Uses the same defaults as for JoinColumn.
+	 */
+	JoinColumn[] joinColumns() default {};
+	/**
+	 * The foreign key columns of the join table which reference the primary table of the entity
+	 * that does not own the association (i.e. the inverse side of the association).
+	 *
+	 * Uses the same defaults as for JoinColumn
+	 */
+	JoinColumn[] inverseJoinColumns() default {};
+	/**
+	 * Unique constraints that are to be placed on the table. These are only used if table
+	 * generation is in effect.
+	 *
+	 * Defaults to no additional constraints
+	 */
+	UniqueConstraint[] uniqueConstraints() default {};
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Lob.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Lob.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Lob.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+//$Id: Lob.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.METHOD;
+
+import static java.lang.annotation.ElementType.FIELD;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+
+/**
+ * Specifies that a persistent property or field should be persisted as a large object to a
+ * database-supported large object type. The Lob annotation may be used in conjunction with
+ * the Basic annotation. A Lob may be either a binary or character type.
+ *
+ * The Lob type is inferred from the type of the persistent field or property, and except
+ * for string and character-based types defaults to Blob.
+ *  
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Lob {}
\ No newline at end of file

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/LockModeType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/LockModeType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/LockModeType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,40 @@
+//$Id: LockModeType.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Lock modes that can be specified by means of the EntityManager.lock() method.
+ *
+ * The semantics of requesting locks of type LockModeType.READ and LockModeType.WRITE are t
+ * he following.
+ *
+ * If transaction T1 calls lock(entity, LockModeType.READ) on a versioned object, the entity
+ * manager must ensure that neither of the following phenomena can occur:
+ *
+ * * P1 (Dirty read): Transaction T1 modifies a row. Another transaction T2 then reads
+ * that row and obtains the modified value, before T1 has committed or rolled back.
+ * Transaction T2 eventually commits successfully; it does not matter whether T1 commits or rolls
+ * back and whether it does so before or after T2 commits.
+ *
+ * * P2 (Non-repeatable read): Transaction T1 reads a row. Another transaction T2 then modifies
+ * or deletes that row, before T1 has committed. Both transactions eventually commit successfully.
+ *
+ * Lock modes must always prevent the phenomena P1 and P2.
+ * In addition, calling lock(entity, LockModeType.WRITE) on a versioned object,
+ * will also force an update (increment) to the entity's version column.
+ *
+ * The persistence implementation is not required to support calling EntityManager.lock()
+ * on a non-versioned object. When it cannot support a such lock call, it must
+ * throw the PersistenceException.
+ *
+ * @author Emmanuel Bernard
+ */
+public enum LockModeType {
+	/**
+	 * Read lock
+	 */
+	READ,
+	/**
+	 * Write lock
+	 */
+	WRITE
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToMany.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToMany.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToMany.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,51 @@
+//$Id: ManyToMany.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static javax.persistence.FetchType.*;
+
+/**
+ * Defines a many-valued association with many-to-many multiplicity. If the Collection is
+ * defined using generics to specify the element type, the associated target entity class
+ * does not need to be specified; otherwise it must be specified.
+ *
+ * Every many-to-many association has two sides, the owning side and the non-owning, or inverse,
+ * side. The join table is specified on the owning side. If the association is bidirectional,
+ * either side may be designated as the owning side.
+ *
+ * The same annotation elements for the OneToMany annotation apply to the ManyToMany annotation.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface ManyToMany {
+	/**
+	 * The entity class that is the target of the association. Optional only if the
+	 * collection property is defined using Java generics. Must be specified otherwise.
+	 *
+	 * Defaults to the parameterized type of the collection when defined using generics.
+	 */
+	Class targetEntity() default void.class;
+	/**
+	 * The operations that must be cascaded to the target of the association.
+	 *
+	 * Defaults to no operations being cascaded.
+	 */
+	CascadeType[] cascade() default {};
+	/**
+	 * Whether the association should be lazily loaded or must be eagerly fetched.
+	 * The EAGER strategy is a requirement on the persistenceprovider runtime that
+	 * the associatedentities must be eagerly fetched. The LAZY strategy is a hint
+	 * to the persistence provider runtime.
+	 */
+	FetchType fetch() default LAZY;
+	/**
+	 * The field that owns the relationship. Required unless the relationship is unidirectional.
+	 */
+	String mappedBy() default "";
+}
\ No newline at end of file

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToOne.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToOne.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/ManyToOne.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,44 @@
+//$Id: ManyToOne.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static javax.persistence.FetchType.*;
+
+/**
+ * This annotation defines a single-valued association to another entity class that has
+ * many-to-one multiplicity. It is not normally necessary to specify the target entity
+ * explicitly since it can usually be inferred from the type of the object being referenced.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface ManyToOne {
+	/**
+	 * The entity class that is the target of the association.
+	 *
+	 * Defaults to the type of the field or property that stores the association
+	 */
+	Class targetEntity() default void.class;
+	/**
+	 * The operations that must be cascaded to the target of the association.
+	 *
+	 * By default no operations are cascaded.
+	 */
+	CascadeType[] cascade() default {};
+	/**
+	 * Whether the association should be lazily loaded or must be eagerly fetched.
+	 * The EAGER strategy is a requirement on the persistence provider runtime that
+	 * the associated entity must be eagerly fetched. The LAZY strategy is a hint to
+	 * the persistence provider runtime.
+	 */
+	FetchType fetch() default EAGER;
+	/**
+	 * Whether the association is optional. If set to false then a non-null relationship must always exist.
+	 */
+	boolean optional() default true;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MapKey.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MapKey.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MapKey.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+
+/**
+ * Is used to specify the map key for associations of type Map.
+ * If a persistent field or property other than the primary key is used as a map key then it
+ * is expected to have a uniqueness constraint associated with it.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface MapKey {
+	/**
+	 * The name of the persistent field or property of the associated entity that is used as the map key.
+	 * If the name element is not specified, the primary key of the associated entity is used as the map key.
+	 * If the primary key is a composite primary key and is mapped as IdClass, an instance of the primary key
+	 * class is used as the key.
+	 */
+	String name() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MappedSuperclass.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MappedSuperclass.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/MappedSuperclass.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+//$Id: MappedSuperclass.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Designates a class whose mapping information is applied to the entities that inherit
+ * from it. A mapped superclass has no separate table defined for it.
+ *
+ * A class designated with the MappedSuperclass annotation can be mapped in the same way as
+ * an entity except that the mappings will apply only to its subclasses since no table exists
+ * for the mapped superclass itself. When applied to the subclasses the inherited mappings will
+ * apply in the context of the subclass tables. Mapping information may be overridden in such
+ * subclasses by using the AttributeOverride and AssociationOverride annotations or corresponding *
+ * XML elements.
+ *  
+ * @author Emmanuel Bernard
+ */
+ at Target(TYPE) @Retention(RUNTIME)
+public @interface MappedSuperclass {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQueries.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQueries.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQueries.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,21 @@
+//$Id: NamedNativeQueries.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Is used to specify an array of native SQL named queries. Query names are scoped to the persistence unit
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface NamedNativeQueries {
+	/**
+	 * Array of native SQL named queries
+	 */
+	NamedNativeQuery [] value ();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQuery.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQuery.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedNativeQuery.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,39 @@
+//$Id: NamedNativeQuery.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Is used to specify a native SQL named query. Query names are scoped to the persistence unit.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE})
+ at Retention(RUNTIME)
+public @interface NamedNativeQuery {
+	/**
+	 * Is used to refer to the query when using the EntityManager methods that create query objects
+	 */
+	String name();
+	/**
+	 * The SQL query string
+	 */
+	String query();
+
+	/**
+	 * Vendor-specific query hints
+	 */
+	QueryHint[] hints() default {};
+	/**
+	 * The class of the result
+	 */
+	Class resultClass() default void.class;
+	/**
+	 * The name of a SqlResultSetMapping, as defined in metadata
+	 */
+	String resultSetMapping() default ""; // name of SQLResultSetMapping
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQueries.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQueries.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQueries.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,21 @@
+//$Id: NamedQueries.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies an array of named Java Persistence query language queries. Query names are scoped to the persistence unit.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface NamedQueries {
+	/**
+	 * An array of named Java Persistence query language queries.
+	 */
+	NamedQuery [] value ();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQuery.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQuery.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NamedQuery.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,31 @@
+//$Id: NamedQuery.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.*;
+import static java.lang.annotation.ElementType.*;
+
+/**
+ * Is used to specify a named query in the Java Persistence query language, which is a static
+ * query expressed in metadata. Query names are scoped to the persistence unit.
+ *
+ * @author Emmanuel Bernard
+ */
+//TODO remove the mackage target
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface NamedQuery {
+	/**
+	 * Refers to the query when using the EntityManager methods that create query objects.
+	 */
+	String name();
+	/**
+	 * The query string in the Java Persistence query language
+	 */
+	String query();
+	/**
+	 * Vendor-specific query hints
+	 */
+	QueryHint[] hints() default {};
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NoResultException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NoResultException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NoResultException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,27 @@
+//$Id: NoResultException.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when getSingleResult() is executed on a query and there is no result to return.
+ * This exception will not cause the current transaction, if one is active, to be marked for roll back.
+ * 
+ * @author Emmanuel Bernard
+ */
+public class NoResultException extends PersistenceException {
+
+	/**
+	 * Constructs a new NoResultException exception with null as its detail message
+	 */
+	public NoResultException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new NoResultException exception with the specified detail message.
+	 * 
+	 * @param message
+	 */
+	public NoResultException(String message) {
+		super( message );
+	}
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NonUniqueResultException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NonUniqueResultException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NonUniqueResultException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,29 @@
+//$Id: NonUniqueResultException.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when getSingleResult() is executed on a query and there is more than
+ * one result from the query. This exception will not cause the current transaction, if one is active, to be
+ * marked for roll back.
+ *
+ * @author Gavin King
+ */
+public class NonUniqueResultException extends PersistenceException {
+
+	/**
+	 * Constructs a new NonUniqueResultException exception with null as its detail message
+	 */
+	public NonUniqueResultException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new NonUniqueResultException exception with the specified detail message
+	 * 
+	 * @param message
+	 */
+	public NonUniqueResultException(String message) {
+		super( message );
+	}
+
+}


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/NonUniqueResultException.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToMany.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToMany.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToMany.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,47 @@
+//$Id: OneToMany.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static javax.persistence.FetchType.*;
+
+/**
+ * Defines a many-valued association with one-to-many multiplicity.
+ *
+ * If the collection is defined using generics to specify the element type,
+ * the associated target entity type need not be specified; otherwise the target
+ * entity class must be specified.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface OneToMany {
+	/**
+	 * The entity class that is the target of the association. Optional only if the collection
+	 * property is defined using Java generics. Must be specified otherwise.
+	 *
+	 * Defaults to the parameterized type of the collection when defined using generics.
+	 */
+	Class targetEntity() default void.class;
+	/**
+	 * The operations that must be cascaded to the target of the association.
+	 *
+	 * Defaults to no operations being cascaded.
+	 */
+	CascadeType[] cascade() default {};
+	/**
+	 * Whether the association should be lazily loaded or must be eagerly fetched.
+	 * The EAGER strategy is a requirement on the persistenceprovider runtime that the
+	 * associatedentities must be eagerly fetched. The LAZY strategy is a hint to the
+	 * persistence provider runtime.
+	 */
+	FetchType fetch() default LAZY;
+	/**
+	 * The field that owns the relationship. Required unless the relationship is unidirectional.
+	 */
+	String mappedBy() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToOne.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToOne.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OneToOne.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,51 @@
+//$Id: OneToOne.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static javax.persistence.FetchType.*;
+
+/**
+ * This annotation defines a single-valued association to another entity that has
+ * one-to-one multiplicity. It is not normally necessary to specify the associated
+ * target entity explicitly since it can usually be inferred from the type of the object
+ * being referenced.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface OneToOne {
+	/**
+	 * The entity class that is the target of the association.
+	 *
+	 * Defaults to the type of the field or property that stores the association.
+	 */
+	Class targetEntity() default void.class;
+	/**
+	 * The operations that must be cascaded to the target of the association.
+	 *
+	 * By default no operations are cascaded.
+	 */
+	CascadeType[] cascade() default {};
+	/**
+	 * Whether the association should be lazily loaded or must be eagerly fetched.
+	 * The EAGER strategy is a requirement on the persistence provider runtime that
+	 * the associated entity must be eagerly fetched. The LAZY strategy is a hint to
+	 * the persistence provider runtime.
+	 */
+	FetchType fetch() default EAGER;
+	/**
+	 * Whether the association is optional. If set to false then a non-null relationship must
+	 * always exist.
+	 */
+	boolean optional() default true;
+	/**
+	 * The field that owns the relationship. This element is only specified on the
+	 * inverse (non-owning) side of the association.
+	 */
+	String mappedBy() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OptimisticLockException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OptimisticLockException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OptimisticLockException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,42 @@
+//$Id: $
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an optimistic locking conflict occurs.
+ * This exception may be thrown as part of an API call, a flush or at commit time.
+ * The current transaction, if one is active, will be marked for rollback.
+ *
+ * @author Emmanuel Bernard
+ */
+public class OptimisticLockException extends PersistenceException {
+	private Object entity;
+
+	public OptimisticLockException() {
+		super();
+	}
+
+	public OptimisticLockException(Object entity) {
+		this.entity = entity;
+	}
+
+	public OptimisticLockException(Throwable cause) {
+		super( cause );
+	}
+
+	public OptimisticLockException(String message) {
+		super( message );
+	}
+
+	public OptimisticLockException(String message, Throwable cause) {
+		super( message, cause );
+	}
+
+	public OptimisticLockException(String message, Throwable cause, Object entity) {
+		super( message, cause );
+		this.entity = entity;
+	}
+
+	public Object getEntity() {
+		return entity;
+	}
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OrderBy.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OrderBy.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/OrderBy.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,39 @@
+//$Id: OrderBy.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * This annotation specifies the ordering of the elements of a collection valued association at the
+ * point when the association is retrieved.
+ *
+ * The syntax of the value ordering element is an orderby_list, as follows:
+ *   <code>orderby_list::= orderby_item [,orderby_item]*
+ *  orderby_item::= property_or_field_name [ASC | DESC]</code>
+ *
+ * If ASC or DESC is not specified, ASC (ascending order) is assumed.
+ *
+ * If the ordering element is not specified, ordering by the primary key of the associated
+ * entity is assumed.
+ *
+ * The property or field name must correspond to that of a persistent property or field of the
+ * associated class. The properties or fields used in the ordering must correspond to columns
+ * for which comparison operators are supported.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface OrderBy {
+	/**
+	 * An orderby_list, specified as follows:
+	 * orderby_list::= orderby_item [,orderby_item]* orderby_item::= property_or_field_name [ASC | DESC]
+	 *
+	 * If ASC or DESC is not specified, ASC (ascending order) is assumed.
+	 *
+	 */
+	String value() default "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Persistence.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Persistence.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Persistence.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,110 @@
+// $Id: Persistence.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import javax.persistence.spi.PersistenceProvider;
+
+/**
+ * Bootstrap class that provides access to an EntityManagerFactory.
+ */
+public class Persistence {
+
+	public static String PERSISTENCE_PROVIDER = PersistenceProvider.class.getName();
+
+	protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
+
+	/**
+	 * Create and return an EntityManagerFactory for the named persistence unit.
+	 *
+	 * @param persistenceUnitName The name of the persistence unit
+	 * @return The factory that creates EntityManagers configured according to the specified persistence unit
+	 */
+	public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName) {
+		return createEntityManagerFactory( persistenceUnitName, null );
+	}
+
+	/**
+	 * Create and return an EntityManagerFactory for the named persistence unit using the given properties.
+	 *
+	 * @param persistenceUnitName The name of the persistence unit
+	 * @param properties Additional properties to use when creating the factory. The values of these properties override
+	 * any values that may have been configured elsewhere
+	 * @return The factory that creates EntityManagers configured according to the specified persistence unit
+	 */
+	public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map properties) {
+		EntityManagerFactory emf = null;
+
+		if ( providers.size() == 0 ) {
+			findAllProviders();
+		}
+		for ( PersistenceProvider provider : providers ) {
+			emf = provider.createEntityManagerFactory( persistenceUnitName, properties );
+			if ( emf != null ) break;
+		}
+		if ( emf == null ) {
+			throw new PersistenceException( "No Persistence provider for EntityManager named " + persistenceUnitName );
+		}
+		return emf;
+	}
+
+	// Helper methods
+
+	private static void findAllProviders() {
+		try {
+			ClassLoader loader = Thread.currentThread().getContextClassLoader();
+			Enumeration<URL> resources = loader.getResources( "META-INF/services/" + PersistenceProvider.class.getName() );
+			Set<String> names = new HashSet<String>();
+			while ( resources.hasMoreElements() ) {
+				URL url = resources.nextElement();
+				InputStream is = url.openStream();
+				try {
+					names.addAll( providerNamesFromReader( new BufferedReader( new InputStreamReader( is ) ) ) );
+				}
+				finally {
+					is.close();
+				}
+			}
+			for ( String s : names ) {
+				Class providerClass = loader.loadClass( s );
+				providers.add( (PersistenceProvider) providerClass.newInstance() );
+			}
+		}
+		catch (IOException e) {
+			throw new PersistenceException( e );
+		}
+		catch (InstantiationException e) {
+			throw new PersistenceException( e );
+		}
+		catch (IllegalAccessException e) {
+			throw new PersistenceException( e );
+		}
+		catch (ClassNotFoundException e) {
+			throw new PersistenceException( e );
+		}
+	}
+
+	private static final Pattern nonCommentPattern = Pattern.compile( "^([^#]+)" );
+
+	private static Set<String> providerNamesFromReader(BufferedReader reader) throws IOException {
+		Set<String> names = new HashSet<String>();
+		String line;
+		while ( ( line = reader.readLine() ) != null ) {
+			line = line.trim();
+			Matcher m = nonCommentPattern.matcher( line );
+			if ( m.find() ) {
+				names.add( m.group().trim() );
+			}
+		}
+		return names;
+	}
+}


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Persistence.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContext.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContext.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContext.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,43 @@
+/* $Id: PersistenceContext.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Expresses a dependency on an EntityManager persistence context.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PersistenceContext {
+	/**
+	 * The name by which the entity manager 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. If the unitName element is specified, the persistence unit
+	 * for the entity manager that is accessible in JNDI must have the same name.
+	 */
+	String unitName() default "";
+	/**
+	 * Used to specify properties for the container or persistence provider. Vendor specific
+	 * properties may be included in this set of properties. Properties that are not
+	 * recognized by a vendor are ignored.
+	 */
+	PersistenceProperty[] properties() default {};
+	/**
+	 * Specifies whether this is a transaction-scoped persistence context or
+	 * an extended persistence context.
+	 */
+	PersistenceContextType type() default PersistenceContextType.TRANSACTION;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContextType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContextType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContextType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,18 @@
+//$Id: PersistenceContextType.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Specifies whether a transaction-scoped or extended persistence context is to be used in
+ * PersistenceContext. If the type element is not specified, a transaction-scoped persistence
+ * context is used.
+ */
+public enum PersistenceContextType {
+	/**
+	 * Transaction-scoped persistence context
+	 */
+	TRANSACTION,
+	/**
+	 * Extended persistence context
+	 */
+	EXTENDED
+}


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContextType.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContexts.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContexts.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceContexts.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,27 @@
+/* $Id: PersistenceContexts.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Declares one or more PersistenceContext annotations. It is used to express a dependency on
+ * container-managed entity manager persistence contexts.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PersistenceContexts {
+	/**
+	 * One or more persistence context
+	 */
+	PersistenceContext[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,50 @@
+/* $Id: PersistenceException.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss, Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+/**
+ * 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>
+ */
+public class PersistenceException extends RuntimeException {
+	/**
+	 * Constructs a new PersistenceException exception with null as its detail message.
+	 */
+	public PersistenceException() {
+	}
+
+	/**
+	 * Constructs a new PersistenceException exception with the specified detail message.
+	 *
+	 * @param message the detail message
+	 */
+	public PersistenceException(String message) {
+		super( message );
+	}
+
+	/**
+	 * 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 );
+	}
+
+	/**
+	 * Constructs a new PersistenceException exception with the specified cause
+	 *
+	 * @param cause the cause
+	 */
+	public PersistenceException(Throwable cause) {
+		super( cause );
+	}
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceProperty.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceProperty.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceProperty.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,27 @@
+//$Id: $
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Describes a single container or persistence provider property.
+ * Vendor specific properties may be included in the set of properties, and are passed to the persistence
+ * provider by the container when the entity manager is created.
+ * Properties that are not recognized by a vendor will be ignored.
+ *  
+ * @author Emmanuel Bernard
+ */
+ at Target({})
+ at 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

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnit.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnit.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnit.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,33 @@
+/* $Id: PersistenceUnit.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Expresses a dependency on an EntityManagerFactory.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
+ at Retention(RetentionPolicy.RUNTIME)
+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 "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnits.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnits.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PersistenceUnits.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,26 @@
+/* $Id: PersistenceUnits.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Declares one or more PersistenceUnit annotations
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PersistenceUnits {
+	/**
+	 * One or more PersistenceUnit annotations
+	 */
+	PersistenceUnit[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostLoad.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostLoad.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostLoad.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,24 @@
+/* $Id: PostLoad.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PostLoad {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostPersist.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostPersist.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostPersist.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+/* $Id: PostPersist.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PostPersist {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostRemove.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostRemove.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostRemove.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+/* $Id: PostRemove.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PostRemove {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostUpdate.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostUpdate.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PostUpdate.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+/* $Id: PostUpdate.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PostUpdate {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrePersist.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrePersist.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrePersist.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+/* $Id: PrePersist.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PrePersist {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreRemove.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreRemove.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreRemove.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+/* $Id: PreRemove.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PreRemove {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreUpdate.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreUpdate.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PreUpdate.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+/* $Id: PreUpdate.java 11282 2007-03-14 22:05:59Z epbernard $
+ * JBoss Inc
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package javax.persistence;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * 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>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface PreUpdate {
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumn.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumn.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumn.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,53 @@
+//$Id: PrimaryKeyJoinColumn.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+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
+ */
+ at 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 "";
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumns.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumns.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/PrimaryKeyJoinColumns.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,22 @@
+//$Id: PrimaryKeyJoinColumns.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * This annotation groups PrimaryKeyJoinColumn annotations. It is used to map composite foreign keys.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+public @interface PrimaryKeyJoinColumns {
+	/**
+	 * One or more PrimaryKeyJoinColumn annotations
+	 */
+	PrimaryKeyJoinColumn[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Query.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Query.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Query.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,148 @@
+// $Id: Query.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * Interface used to control query execution.
+ */
+public interface Query
+{
+   /**
+    * Execute the query and return the query results as a List.
+    *
+    * @return a list of the results
+    * @throws IllegalStateException f called for a Java Persistence query language UPDATE or DELETE statement
+    */
+   public List getResultList();
+
+   /**
+    * Execute a SELECT query that returns a single result.
+    *
+    * @return the result
+    * @throws NoResultException        if there is no result
+    * @throws NonUniqueResultException if more than one result
+    * @throws IllegalStateException    if called for a Java
+    *                                  Persistence query language UPDATE or DELETE statement
+    */
+   public Object getSingleResult();
+
+   /**
+    * Execute an update or delete statement.
+    *
+    * @return the number of entities updated or deleted
+    * @throws IllegalStateException        if called for a Java Persistence query language SELECT statement
+    * @throws TransactionRequiredException if there is no transaction
+    */
+   public int executeUpdate();
+
+   /**
+    * Set the maximum number of results to retrieve.
+    *
+    * @param maxResult
+    * @return the same query instance
+    * @throws IllegalArgumentException if argument is negative
+    */
+   public Query setMaxResults(int maxResult);
+
+   /**
+    * Set the position of the first result to retrieve.
+    *
+    * @param startPosition position of the first result, numbered from 0
+    * @return the same query instance
+    * @throws IllegalArgumentException if argument is negative
+    */
+   public Query setFirstResult(int startPosition);
+
+   /**
+    * Set an implementation-specific hint. If the hint name is not recognized, it is silently
+    * ignored.
+    *
+    * @param hintName
+    * @param value
+    * @return the same query instance
+    * @throws IllegalArgumentException if the second argument is not valid for the implementation
+    */
+   public Query setHint(String hintName, Object value);
+
+   /**
+    * Bind an argument to a named parameter.
+    *
+    * @param name  the parameter name
+    * @param value
+    * @return the same query instance
+    * @throws IllegalArgumentException if parameter name does not correspond to parameter in query
+    *                                  string or argument is of incorrect type
+    */
+   public Query setParameter(String name, Object value);
+
+   /**
+    * Bind an instance of java.util.Date to a named parameter.
+    *
+    * @param name
+    * @param value
+    * @param temporalType
+    * @return the same query instance
+    * @throws IllegalArgumentException if parameter name does not correspond to parameter in query
+    *                                  string
+    */
+   public Query setParameter(String name, Date value, TemporalType temporalType);
+
+   /**
+    * Bind an instance of java.util.Calendar to a named parameter.
+    *
+    * @param name
+    * @param value
+    * @param temporalType
+    * @return the same query instance
+    * @throws IllegalArgumentException if parameter name does not correspond to parameter in query
+    *                                  string
+    */
+   public Query setParameter(String name, Calendar value, TemporalType temporalType);
+
+   /**
+    * Bind an argument to a positional parameter.
+    *
+    * @param position
+    * @param value
+    * @return the same query instance
+    * @throws IllegalArgumentException if position does not correspond to positional parameter of
+    *                                  query or argument is of incorrect type
+    */
+   public Query setParameter(int position, Object value);
+
+   /**
+    * Bind an instance of java.util.Date to a positional parameter.
+    *
+    * @param position
+    * @param value
+    * @param temporalType
+    * @return the same query instance
+    * @throws IllegalArgumentException if position does not correspond to positional parameter of
+    *                                  query
+    */
+   public Query setParameter(int position, Date value, TemporalType temporalType);
+
+   /**
+    * Bind an instance of java.util.Calendar to a positional parameter.
+    *
+    * @param position
+    * @param value
+    * @param temporalType
+    * @return the same query instance } correspond to positional parameter of query
+    */
+   public Query setParameter(int position, Calendar value, TemporalType temporalType);
+
+   /**
+    * Set the flush mode type to be used for the query execution.
+    * The flush mode type applies to the query regardless of the
+    * flush mode type in use for the entity manager.
+    *
+    * @param flushMode
+    */
+   public Query setFlushMode(FlushModeType flushMode);
+
+}
\ No newline at end of file


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Query.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/QueryHint.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/QueryHint.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/QueryHint.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,25 @@
+//$Id: QueryHint.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * An implementation-specific Query hint
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({})
+ at Retention(RUNTIME)
+public @interface QueryHint {
+	/**
+	 * Name of the hint
+	 */
+	String name();
+
+	/**
+	 * Value of the hint
+	 */
+	String value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/RollbackException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/RollbackException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/RollbackException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,44 @@
+//$Id: $
+package javax.persistence;
+
+/**
+ * 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 );
+	}
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTable.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTable.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTable.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,53 @@
+//$Id: SecondaryTable.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+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
+ */
+ at 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 {};
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTables.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTables.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SecondaryTables.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,21 @@
+//$Id: SecondaryTables.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+/**
+ * This annotation is used to specify multiple secondary tables for an entity.
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface SecondaryTables {
+	/**
+	 * The secondary tables for an entity.
+	 */
+	SecondaryTable[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SequenceGenerator.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SequenceGenerator.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SequenceGenerator.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,38 @@
+//$Id: SequenceGenerator.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * This annotation defines a primary key generator that may be referenced by name when a generator
+ * element is specified for the GeneratedValue annotation. A sequence generator may be specified on
+ * the entity class or on the primary key field or property. The scope of the generator name is global
+ * to the persistence unit (across all generator types).
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+public @interface SequenceGenerator {
+	/**
+	 * A unique generator name that can be referenced by one or more classes to be the generator for primary key values
+	 */
+	String name();
+	/**
+	 * The name of the database sequence object from which to obtain primary key values
+	 * Defaults to a provider-chosen value
+	 */
+	String sequenceName() default "";
+	/**
+	 * The value from which the sequence object is to start generating
+	 */
+	int initialValue() default 1;
+	/**
+	 * The amount to increment by when allocating sequence numbers from the sequence
+	 */
+	int allocationSize() default 50;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMapping.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMapping.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMapping.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,29 @@
+//$Id: SqlResultSetMapping.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * This annotation is used to specify the mapping of the result of a native SQL query
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
+public @interface SqlResultSetMapping {
+	/**
+	 * The name given to the result set mapping, and used to refer to it in the methods of the Query API
+	 */
+	String name();
+	/**
+	 * Specifies the result set mapping to entities
+	 */
+	EntityResult[] entities() default {};
+	/**
+	 * Specifies the result set mapping to scalar values
+	 */
+	ColumnResult[] columns() default {};
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMappings.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMappings.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/SqlResultSetMappings.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,19 @@
+//$Id: SqlResultSetMapping.java 9044 2006-01-12 20:58:41 -0500 (jeu., 12 janv. 2006) epbernard $
+//EJB3 Specification Copyright 2004 - 2006 Sun Microsystems, Inc.
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * This annotation is used to define one or more SqlResultSetMapping
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
+public @interface SqlResultSetMappings {
+	SqlResultSetMapping[] value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Table.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Table.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Table.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,48 @@
+//$Id: Table.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+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
+ */
+ at 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 {};
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TableGenerator.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TableGenerator.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TableGenerator.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,67 @@
+//$Id: TableGenerator.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation defines a primary key generator that may be referenced by name when a generator
+ * element is specified for the GeneratedValue annotation. A table generator may be specified on the
+ * entity class or on the primary key field or property. The scope of the generator name is global to
+ * the persistence unit (across all generator types).
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({TYPE, METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface TableGenerator {
+	/**
+	 * A unique generator name that can be referenced by one or more classes to be the generator for id values
+	 */
+	String name();
+	/**
+	 * Name of table that stores the generated id values. Defaults to a name chosen by persistence provider.
+	 */
+	String table() 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 "";
+	/**
+	 * Name of the primary key column in the table
+	 * Defaults to a provider-chosen name
+	 */
+	String pkColumnName() default "";
+	/**
+	 * Name of the column that stores the last value generated
+	 * Defaults to a provider-chosen name
+	 */
+	String valueColumnName() default "";
+	/**
+	 * The primary key value in the generator table that distinguishes this set of generated values from others that may be stored in the table
+	 * Defaults to a provider-chosen value to store in the primary key column of the generator table
+	 */
+	String pkColumnValue() default "";
+	/**
+	 * The initial value to be used when allocating id numbers from the generator
+	 */
+	int initialValue() default 0;
+	/**
+	 * The amount to increment by when allocating id numbers from the generator
+	 */
+	int allocationSize() default 50;
+	/**
+	 * 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 primary key constraints
+	 * Defaults to no additional constraints
+	 */
+	UniqueConstraint[] uniqueConstraints() default {};
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Temporal.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Temporal.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Temporal.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,26 @@
+//$Id: Temporal.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+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;
+
+/**
+ * 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
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface Temporal {
+	/**
+	 * The type used in mapping java.util.Date or java.util.Calendar
+	 */
+	TemporalType value();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TemporalType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TemporalType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TemporalType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,21 @@
+//$Id: TemporalType.java 11282 2007-03-14 22:05:59Z epbernard $
+//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 {
+	/**
+	 * Map as java.sql.Date
+	 */
+	DATE,
+	/**
+	 * Map as java.sql.Time
+	 */
+	TIME,
+	/**
+	 * Map as java.sql.Timestamp
+	 */
+	TIMESTAMP
+}
\ No newline at end of file


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TemporalType.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TransactionRequiredException.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TransactionRequiredException.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TransactionRequiredException.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,26 @@
+//$Id: TransactionRequiredException.java 11282 2007-03-14 22:05:59Z epbernard $
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when a transaction is required but is not active.
+ * @author Gavin King
+ */
+public class TransactionRequiredException extends PersistenceException {
+
+	/**
+	 * Constructs a new TransactionRequiredException exception with null as its detail message
+	 */
+	public TransactionRequiredException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new TransactionRequiredException exception with the specified detail message
+	 * 
+	 * @param message
+	 */
+	public TransactionRequiredException(String message) {
+		super( message );
+	}
+
+}


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/TransactionRequiredException.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Transient.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Transient.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Transient.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,18 @@
+//$Id: Transient.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+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
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Transient {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/UniqueConstraint.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/UniqueConstraint.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/UniqueConstraint.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,21 @@
+//$Id: UniqueConstraint.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation is used to specify that a unique constraint is to be included in the generated DDL
+ * for a primary or secondary table
+ *
+ * @author Emmanuel Bernard
+ */
+ at Target({}) @Retention(RUNTIME)
+public @interface UniqueConstraint {
+	/**
+	 * An array of the column names that make up the constraint
+	 */
+	String[] columnNames();
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Version.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Version.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/Version.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,28 @@
+//$Id: Version.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+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
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface Version {}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/package-info.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/package-info.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/package-info.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,9 @@
+//$Id:$
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+
+/**
+ * The javax.persistence package contains the classes and interfaces that define the contracts
+ * between a persistence provider and the managed classes and the clients of the Java Persistence API.
+ */
+package javax.persistence;
+

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/ClassTransformer.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/ClassTransformer.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/ClassTransformer.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,39 @@
+//$Id: ClassTransformer.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence.spi;
+
+import java.security.ProtectionDomain;
+import java.lang.instrument.IllegalClassFormatException;
+
+/**
+ * A persistence provider provides an instance of this interface
+ * to the PersistenceUnitInfo.addTransformer method.
+ * The supplied transformer instance will get called to transform
+ * entity class files when they are loaded and redefined.  The transformation
+ * occurs before the class is defined by the JVM
+ *
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 11282 $
+ */
+public interface ClassTransformer
+{
+   /**
+    * Invoked when a class is being loaded or redefined to add hooks for persistence bytecode manipulation
+    *
+    * @param loader the defining class loaderof the class being transformed.  It may be null if using bootstrap loader
+    * @param classname The name of the class being transformed
+    * @param classBeingRedefined If an already loaded class is being redefined, then pass this as a parameter
+    * @param protectionDomain ProtectionDomain of the class being (re)-defined
+    * @param classfileBuffer The input byte buffer in class file format
+    * @return A well-formed class file that can be loaded
+    *
+    * @throws IllegalClassFormatException
+    */
+   byte[] transform(ClassLoader loader,
+                    String classname,
+                    Class<?> classBeingRedefined,
+                    ProtectionDomain protectionDomain,
+                    byte[] classfileBuffer)
+   throws IllegalClassFormatException;
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceProvider.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceProvider.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceProvider.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,43 @@
+//$Id: PersistenceProvider.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence.spi;
+
+import java.util.Map;
+import javax.persistence.EntityManagerFactory;
+
+/**
+ * Interface implemented by the persistence provider.
+ * This interface is used to create an EntityManagerFactory.
+ * It is invoked by the container in Java EE environments and
+ * by the Persistence class in Java SE environments.
+ */
+public interface PersistenceProvider {
+	/**
+	 * Called by Persistence class when an EntityManagerFactory
+	 * is to be created.
+	 *
+	 * @param emName The name of the persistence unit
+	 * @param map	A Map of properties for use by the
+	 *               persistence provider. These properties may be used to
+	 *               override the values of the corresponding elements in
+	 *               the persistence.xml file or specify values for
+	 *               properties not specified in the persistence.xml
+	 *               (and may be null if no properties are specified).
+	 * @return EntityManagerFactory for the persistence unit,
+	 *         or null if the provider is not the right provider
+	 */
+	public EntityManagerFactory createEntityManagerFactory(String emName, Map map);
+
+	/**
+	 * Called by the container when an EntityManagerFactory
+	 * is to be created.
+	 *
+	 * @param info Metadata for use by the persistence provider
+	 * @param map  A Map of integration-level properties for use
+	 *             by the persistence provider (may be null if no properties
+	 *             are specified).
+	 * @return EntityManagerFactory for the persistence unit
+	 *         specified by the metadata
+	 */
+	public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map);
+}
\ No newline at end of file


Property changes on: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceProvider.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitInfo.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitInfo.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitInfo.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,142 @@
+//$Id: PersistenceUnitInfo.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.package javax.persistence.spi;
+package javax.persistence.spi;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Properties;
+import javax.sql.DataSource;
+
+/**
+ * Interface implemented by the container and used by the
+ * persistence provider when creating an EntityManagerFactory.
+ */
+public interface PersistenceUnitInfo {
+	/**
+	 * @return The name of the persistence unit.
+	 *         Corresponds to the <name> element in the persistence.xml file.
+	 */
+	public String getPersistenceUnitName();
+
+	/**
+	 * @return The fully qualified name of the persistence provider
+	 *         implementation class.
+	 *         Corresponds to the <provider> element in the persistence.xml
+	 *         file.
+	 */
+	public String getPersistenceProviderClassName();
+
+	/**
+	 * @return The transaction type of the entity managers created
+	 *         by the EntityManagerFactory.
+	 *         The transaction type corresponds to the transaction-type
+	 *         attribute in the persistence.xml file.
+	 */
+	public PersistenceUnitTransactionType getTransactionType();
+
+	/**
+	 * @return The JTA-enabled data source to be used by the
+	 *         persistence provider.
+	 *         The data source corresponds to the <jta-data-source>
+	 *         element in the persistence.xml file or is provided at
+	 *         deployment or by the container.
+	 */
+	public DataSource getJtaDataSource();
+
+	/**
+	 * @return The non-JTA-enabled data source to be used by the
+	 *         persistence provider for accessing data outside a JTA
+	 *         transaction.
+	 *         The data source corresponds to the named <non-jta-data-source>
+	 *         element in the persistence.xml file or provided at
+	 *         deployment or by the container.
+	 */
+	public DataSource getNonJtaDataSource();
+
+	/**
+	 * @return The list of mapping file names that the persistence
+	 *         provider must load to determine the mappings for the entity
+	 *         classes. The mapping files must be in the standard XML
+	 *         mapping format, be uniquely named and be resource-loadable
+	 *         from the application classpath.
+	 *         Each mapping file name corresponds to a <mapping-file>
+	 *         element in the persistence.xml file.
+	 */
+	public List<String> getMappingFileNames();
+
+	/**
+	 * @return The list of JAR file URLs that the persistence
+	 *         provider must examine for managed classes of the persistence
+	 *         unit. Each jar file URL corresponds to a named <jar-file>
+	 *         element in the persistence.xml file.
+	 */
+	public List<URL> getJarFileUrls();
+
+	/**
+	 * @return The URL for the jar file or directory that is the
+	 *         root of the persistence unit. (If the persistence unit is
+	 *         rooted in the WEB-INF/classes directory, this will be the
+	 *         URL of that directory.)
+	 */
+	public URL getPersistenceUnitRootUrl();
+
+	/**
+	 * @return The list of the names of the classes that the
+	 *         persistence provider must add it to its set of managed
+	 *         classes. Each name corresponds to a named <class> element
+	 *         in the persistence.xml file.
+	 */
+	public List<String> getManagedClassNames();
+
+	/**
+	 * @return Whether classes in the root of the persistence
+	 *         unit that have not been explicitly listed are to be
+	 *         included in the set of managed classes.
+	 *         This value corresponds to the <exclude-unlisted-classes>
+	 *         element in the persistence.xml file.
+	 */
+	public boolean excludeUnlistedClasses();
+
+	/**
+	 * @return Properties object. Each property corresponds
+	 *         to a <property> element in the persistence.xml file
+	 */
+	public Properties getProperties();
+
+	/**
+	 * @return ClassLoader that the provider may use to load any
+	 *         classes, resources, or open URLs.
+	 */
+	public ClassLoader getClassLoader();
+
+	/**
+	 * Add a transformer supplied by the provider that will be
+	 * called for every new class definition or class redefinition
+	 * that gets loaded by the loader returned by the
+	 * PersistenceInfo.getClassLoader method. The transformer
+	 * has no effect on the result returned by the
+	 * PersistenceInfo.getTempClassLoader method.
+	 * Classes are only transformed once within the same classloading
+	 * scope, regardless of how many persistence units they may be
+	 * a part of.
+	 *
+	 * @param transformer A provider-supplied transformer that the
+	 *                    Container invokes at class-(re)definition time
+	 */
+	public void addTransformer(ClassTransformer transformer);
+
+	/**
+	 * Return a new instance of a ClassLoader that the provider
+	 * may use to temporarily load any classes, resources, or
+	 * open URLs. The scope and classpath of this loader is
+	 * exactly the same as that of the loader returned by
+	 * PersistenceInfo.getClassLoader. None of the classes loaded
+	 * by this class loader will be visible to application
+	 * components. The container does not use or maintain references
+	 * to this class loader after returning it to the provider.
+	 *
+	 * @return Temporary ClassLoader with same visibility as current
+	 * loader
+	 */
+	public ClassLoader getNewTempClassLoader();
+}
\ No newline at end of file

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitTransactionType.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitTransactionType.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/PersistenceUnitTransactionType.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,20 @@
+//$Id: PersistenceUnitTransactionType.java 11282 2007-03-14 22:05:59Z epbernard $
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+package javax.persistence.spi;
+
+/**
+ * This enum class defines whether the entity managers created by the EntityManagerFactory will be
+ * JTA or resource-local entity managers.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public enum PersistenceUnitTransactionType {
+	/**
+	 * JTA entity manager
+	 */
+	JTA,
+	/**
+	 * Resource-local entity manager
+	 */
+	RESOURCE_LOCAL
+}

Added: projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/package-info.java
===================================================================
--- projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/package-info.java	                        (rev 0)
+++ projects/javaee/trunk/jboss-persistence-api/src/main/javax/persistence/spi/package-info.java	2007-03-21 11:39:58 UTC (rev 61536)
@@ -0,0 +1,10 @@
+//$Id:$
+//EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc.
+
+/**
+ * The javax.persistence.spi package defines the classes and interfaces that are implemented by the
+ * persistence provider and the Java EE container for use by the container, provider, and/or Persistence
+ * bootstrap class in deployment and bootstrapping.
+ */
+package javax.persistence.spi;
+




More information about the jboss-cvs-commits mailing list