[javax.persistence] 01/02: Imported Upstream version 2.1.0.v201304241213

Andrew Ross rockclimb-guest at alioth.debian.org
Fri Oct 4 18:54:52 UTC 2013


This is an automated email from the git hooks/post-receive script.

rockclimb-guest pushed a commit to branch master
in repository javax.persistence.

commit 131e7a74336b664b02aa346d82a3dd3b1992a666
Author: Andrew Ross <ubuntu at rossfamily.co.uk>
Date:   Fri Oct 4 19:49:46 2013 +0100

    Imported Upstream version 2.1.0.v201304241213
---
 .classpath                                         |    7 +
 .gitignore                                         |    6 +
 .project                                           |   28 +
 .settings/org.eclipse.jdt.core.prefs               |  324 +++
 .settings/org.eclipse.jdt.ui.prefs                 |    9 +
 .settings/org.eclipse.pde.core.prefs               |    5 +
 META-INF/MANIFEST.MF                               |   24 +
 META-INF/eclipse.inf                               |    1 +
 build.properties                                   |    4 +
 build.xml                                          |  282 +++
 changes                                            |  136 ++
 pom.xml                                            |  200 ++
 readme.txt                                         |   16 +
 resource/about.html                                |   40 +
 resource/license.html                              |  287 +++
 resource/readme.html                               |   40 +
 src/javax/persistence/Access.java                  |   41 +
 src/javax/persistence/AccessType.java              |   34 +
 src/javax/persistence/AssociationOverride.java     |  174 ++
 src/javax/persistence/AssociationOverrides.java    |   75 +
 src/javax/persistence/AttributeConverter.java      |   52 +
 src/javax/persistence/AttributeNode.java           |   56 +
 src/javax/persistence/AttributeOverride.java       |  153 ++
 src/javax/persistence/AttributeOverrides.java      |   55 +
 src/javax/persistence/Basic.java                   |   81 +
 src/javax/persistence/Cache.java                   |   68 +
 src/javax/persistence/CacheRetrieveMode.java       |   39 +
 src/javax/persistence/CacheStoreMode.java          |   47 +
 src/javax/persistence/Cacheable.java               |   44 +
 src/javax/persistence/CascadeType.java             |   50 +
 src/javax/persistence/CollectionTable.java         |  171 ++
 src/javax/persistence/Column.java                  |  122 +
 src/javax/persistence/ColumnResult.java            |   74 +
 src/javax/persistence/ConstraintMode.java          |   32 +
 src/javax/persistence/ConstructorResult.java       |   81 +
 src/javax/persistence/Convert.java                 |  208 ++
 src/javax/persistence/Converter.java               |   65 +
 src/javax/persistence/Converts.java                |   40 +
 src/javax/persistence/DiscriminatorColumn.java     |   84 +
 src/javax/persistence/DiscriminatorType.java       |   39 +
 src/javax/persistence/DiscriminatorValue.java      |   81 +
 src/javax/persistence/ElementCollection.java       |   68 +
 src/javax/persistence/Embeddable.java              |   80 +
 src/javax/persistence/Embedded.java                |   57 +
 src/javax/persistence/EmbeddedId.java              |   81 +
 src/javax/persistence/Entity.java                  |   42 +
 src/javax/persistence/EntityExistsException.java   |   77 +
 src/javax/persistence/EntityGraph.java             |  226 ++
 src/javax/persistence/EntityListeners.java         |   36 +
 src/javax/persistence/EntityManager.java           |  895 ++++++++
 src/javax/persistence/EntityManagerFactory.java    |  223 ++
 src/javax/persistence/EntityNotFoundException.java |   60 +
 src/javax/persistence/EntityResult.java            |   70 +
 src/javax/persistence/EntityTransaction.java       |   76 +
 src/javax/persistence/EnumType.java                |   31 +
 src/javax/persistence/Enumerated.java              |   61 +
 src/javax/persistence/ExcludeDefaultListeners.java |   33 +
 .../persistence/ExcludeSuperclassListeners.java    |   34 +
 src/javax/persistence/FetchType.java               |   49 +
 src/javax/persistence/FieldResult.java             |   63 +
 src/javax/persistence/FlushModeType.java           |   52 +
 src/javax/persistence/ForeignKey.java              |   95 +
 src/javax/persistence/GeneratedValue.java          |   79 +
 src/javax/persistence/GenerationType.java          |   56 +
 src/javax/persistence/Id.java                      |   55 +
 src/javax/persistence/IdClass.java                 |   53 +
 src/javax/persistence/Index.java                   |   68 +
 src/javax/persistence/Inheritance.java             |   52 +
 src/javax/persistence/InheritanceType.java         |   38 +
 src/javax/persistence/JoinColumn.java              |  182 ++
 src/javax/persistence/JoinColumns.java             |   70 +
 src/javax/persistence/JoinTable.java               |  155 ++
 src/javax/persistence/Lob.java                     |   62 +
 src/javax/persistence/LockModeType.java            |  188 ++
 src/javax/persistence/LockTimeoutException.java    |   97 +
 src/javax/persistence/ManyToMany.java              |  143 ++
 src/javax/persistence/ManyToOne.java               |  118 +
 src/javax/persistence/MapKey.java                  |   99 +
 src/javax/persistence/MapKeyClass.java             |   99 +
 src/javax/persistence/MapKeyColumn.java            |  132 ++
 src/javax/persistence/MapKeyEnumerated.java        |   65 +
 src/javax/persistence/MapKeyJoinColumn.java        |  194 ++
 src/javax/persistence/MapKeyJoinColumns.java       |   61 +
 src/javax/persistence/MapKeyTemporal.java          |   54 +
 src/javax/persistence/MappedSuperclass.java        |  100 +
 src/javax/persistence/MapsId.java                  |   77 +
 src/javax/persistence/NamedAttributeNode.java      |   75 +
 src/javax/persistence/NamedEntityGraph.java        |   68 +
 src/javax/persistence/NamedEntityGraphs.java       |   33 +
 src/javax/persistence/NamedNativeQueries.java      |   38 +
 src/javax/persistence/NamedNativeQuery.java        |   52 +
 src/javax/persistence/NamedQueries.java            |   38 +
 src/javax/persistence/NamedQuery.java              |   79 +
 .../persistence/NamedStoredProcedureQueries.java   |   37 +
 .../persistence/NamedStoredProcedureQuery.java     |   98 +
 src/javax/persistence/NamedSubgraph.java           |   61 +
 src/javax/persistence/NoResultException.java       |   51 +
 .../persistence/NonUniqueResultException.java      |   50 +
 src/javax/persistence/OneToMany.java               |  136 ++
 src/javax/persistence/OneToOne.java                |  164 ++
 src/javax/persistence/OptimisticLockException.java |  117 +
 src/javax/persistence/OrderBy.java                 |  137 ++
 src/javax/persistence/OrderColumn.java             |  100 +
 src/javax/persistence/Parameter.java               |   58 +
 src/javax/persistence/ParameterMode.java           |   52 +
 src/javax/persistence/Persistence.java             |  199 ++
 src/javax/persistence/PersistenceContext.java      |   72 +
 src/javax/persistence/PersistenceContextType.java  |   32 +
 src/javax/persistence/PersistenceContexts.java     |   39 +
 src/javax/persistence/PersistenceException.java    |   67 +
 src/javax/persistence/PersistenceProperty.java     |   43 +
 src/javax/persistence/PersistenceUnit.java         |   49 +
 src/javax/persistence/PersistenceUnitUtil.java     |   67 +
 src/javax/persistence/PersistenceUnits.java        |   37 +
 src/javax/persistence/PersistenceUtil.java         |   54 +
 .../persistence/PessimisticLockException.java      |   97 +
 src/javax/persistence/PessimisticLockScope.java    |   64 +
 src/javax/persistence/PostLoad.java                |   34 +
 src/javax/persistence/PostPersist.java             |   34 +
 src/javax/persistence/PostRemove.java              |   34 +
 src/javax/persistence/PostUpdate.java              |   34 +
 src/javax/persistence/PrePersist.java              |   34 +
 src/javax/persistence/PreRemove.java               |   34 +
 src/javax/persistence/PreUpdate.java               |   34 +
 src/javax/persistence/PrimaryKeyJoinColumn.java    |  115 +
 src/javax/persistence/PrimaryKeyJoinColumns.java   |   70 +
 src/javax/persistence/Query.java                   |  455 ++++
 src/javax/persistence/QueryHint.java               |   39 +
 src/javax/persistence/QueryTimeoutException.java   |   98 +
 src/javax/persistence/RollbackException.java       |   64 +
 src/javax/persistence/SecondaryTable.java          |  118 +
 src/javax/persistence/SecondaryTables.java         |   60 +
 src/javax/persistence/SequenceGenerator.java       |   82 +
 src/javax/persistence/SharedCacheMode.java         |   56 +
 src/javax/persistence/SqlResultSetMapping.java     |   79 +
 src/javax/persistence/SqlResultSetMappings.java    |   34 +
 .../persistence/StoredProcedureParameter.java      |   51 +
 src/javax/persistence/StoredProcedureQuery.java    |  398 ++++
 src/javax/persistence/Subgraph.java                |  201 ++
 src/javax/persistence/SynchronizationType.java     |   32 +
 src/javax/persistence/Table.java                   |   80 +
 src/javax/persistence/TableGenerator.java          |  148 ++
 src/javax/persistence/Temporal.java                |   50 +
 src/javax/persistence/TemporalType.java            |   34 +
 .../persistence/TransactionRequiredException.java  |   44 +
 src/javax/persistence/Transient.java               |   45 +
 src/javax/persistence/Tuple.java                   |   96 +
 src/javax/persistence/TupleElement.java            |   41 +
 src/javax/persistence/TypedQuery.java              |  244 ++
 src/javax/persistence/UniqueConstraint.java        |   52 +
 src/javax/persistence/ValidationMode.java          |   46 +
 src/javax/persistence/Version.java                 |   56 +
 src/javax/persistence/criteria/AbstractQuery.java  |  182 ++
 src/javax/persistence/criteria/CollectionJoin.java |   61 +
 .../criteria/CommonAbstractCriteria.java           |   49 +
 .../persistence/criteria/CompoundSelection.java    |   26 +
 .../persistence/criteria/CriteriaBuilder.java      | 1532 +++++++++++++
 src/javax/persistence/criteria/CriteriaDelete.java |   84 +
 src/javax/persistence/criteria/CriteriaQuery.java  |  317 +++
 src/javax/persistence/criteria/CriteriaUpdate.java |  127 ++
 src/javax/persistence/criteria/Expression.java     |   85 +
 src/javax/persistence/criteria/Fetch.java          |   48 +
 src/javax/persistence/criteria/FetchParent.java    |  102 +
 src/javax/persistence/criteria/From.java           |  264 +++
 src/javax/persistence/criteria/Join.java           |   76 +
 src/javax/persistence/criteria/JoinType.java       |   37 +
 src/javax/persistence/criteria/ListJoin.java       |   71 +
 src/javax/persistence/criteria/MapJoin.java        |   80 +
 src/javax/persistence/criteria/Order.java          |   42 +
 .../persistence/criteria/ParameterExpression.java  |   27 +
 src/javax/persistence/criteria/Path.java           |  112 +
 src/javax/persistence/criteria/PluralJoin.java     |   40 +
 src/javax/persistence/criteria/Predicate.java      |   65 +
 src/javax/persistence/criteria/Root.java           |   35 +
 src/javax/persistence/criteria/Selection.java      |   55 +
 src/javax/persistence/criteria/SetJoin.java        |   59 +
 src/javax/persistence/criteria/Subquery.java       |  212 ++
 src/javax/persistence/criteria/package-info.java   |   20 +
 src/javax/persistence/metamodel/Attribute.java     |   98 +
 src/javax/persistence/metamodel/BasicType.java     |   26 +
 src/javax/persistence/metamodel/Bindable.java      |   57 +
 .../persistence/metamodel/CollectionAttribute.java |   29 +
 .../persistence/metamodel/EmbeddableType.java      |   26 +
 src/javax/persistence/metamodel/EntityType.java    |   34 +
 .../persistence/metamodel/IdentifiableType.java    |  114 +
 src/javax/persistence/metamodel/ListAttribute.java |   29 +
 src/javax/persistence/metamodel/ManagedType.java   |  339 +++
 src/javax/persistence/metamodel/MapAttribute.java  |   43 +
 .../metamodel/MappedSuperclassType.java            |   25 +
 src/javax/persistence/metamodel/Metamodel.java     |   72 +
 .../persistence/metamodel/PluralAttribute.java     |   58 +
 src/javax/persistence/metamodel/SetAttribute.java  |   28 +
 .../persistence/metamodel/SingularAttribute.java   |   57 +
 .../persistence/metamodel/StaticMetamodel.java     |   39 +
 src/javax/persistence/metamodel/Type.java          |   54 +
 src/javax/persistence/metamodel/package-info.java  |   20 +
 src/javax/persistence/orm_1_0.xsd                  | 1541 +++++++++++++
 src/javax/persistence/orm_2_0.xsd                  | 1938 ++++++++++++++++
 src/javax/persistence/orm_2_1.xsd                  | 2336 ++++++++++++++++++++
 src/javax/persistence/package-info.java            |   20 +
 src/javax/persistence/persistence_1_0.xsd          |  284 +++
 src/javax/persistence/persistence_2_0.xsd          |  354 +++
 src/javax/persistence/persistence_2_1.xsd          |  354 +++
 src/javax/persistence/spi/ClassTransformer.java    |   61 +
 src/javax/persistence/spi/LoadState.java           |   30 +
 src/javax/persistence/spi/PersistenceProvider.java |  120 +
 .../spi/PersistenceProviderResolver.java           |   49 +
 .../spi/PersistenceProviderResolverHolder.java     |  409 ++++
 src/javax/persistence/spi/PersistenceUnitInfo.java |  220 ++
 .../spi/PersistenceUnitTransactionType.java        |   32 +
 src/javax/persistence/spi/ProviderUtil.java        |   92 +
 src/javax/persistence/spi/package-info.java        |   20 +
 .../javax/persistence/osgi/Activator.java          |   34 +
 .../persistence/osgi/OSGiProviderResolver.java     |  222 ++
 .../service/jpa/EntityManagerFactoryBuilder.java   |   63 +
 215 files changed, 26606 insertions(+)

diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..65b3af3
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding="**/.svn/**" kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8895a25
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+.DS_Store
+*.class
+*.jar
+target/
+class/
+classes
diff --git a/.project b/.project
new file mode 100644
index 0000000..e889547
--- /dev/null
+++ b/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>javax.persistence 2.1.0</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..ed37e1c
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,324 @@
+#Fri Feb 10 09:24:44 EST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=0
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..a0144f7
--- /dev/null
+++ b/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,9 @@
+#Thu Jan 22 13:48:15 EST 2009
+eclipse.preferences.version=1
+formatter_profile=_EclipseLink
+formatter_settings_version=11
+org.eclipse.jdt.ui.ignorelowercasenames=false
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
diff --git a/.settings/org.eclipse.pde.core.prefs b/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..14ec40d
--- /dev/null
+++ b/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,5 @@
+#Fri May 02 09:46:57 EDT 2008
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..2284383
--- /dev/null
+++ b/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Export-Package: javax.persistence;jpa="2.1";version="2.1.0",
+ javax.persistence.criteria;jpa="2.1";version="2.1.0",
+ javax.persistence.metamodel;jpa="2.1";version="2.1.0",
+ javax.persistence.spi;jpa="2.1";version="2.1.0",
+ org.osgi.service.jpa;version="1.1.0"
+Implementation-Version: 2.1.0
+Bundle-ClassPath: .
+Specification-Vendor: Oracle
+Bundle-Name: Java Persistence API 2.1
+Created-By: 1.6.0_35 (Sun Microsystems Inc.)
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Implementation-Vendor: Eclipse.org - EclipseLink Project
+Bundle-Vendor: Eclipse.org - EclipseLink Project
+Bundle-Version: 2.1.0.qualifier
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.persistence.javax.persistence.osgi.Activator
+Import-Package: javax.sql;resolution:=optional,
+ org.osgi.framework;resolution:=optional,
+ org.osgi.service.jpa;version="1.1.0"
+Specification-Version: 2.1
+Bundle-SymbolicName: javax.persistence
+Extension-Name: javax.persistence
+
diff --git a/META-INF/eclipse.inf b/META-INF/eclipse.inf
new file mode 100644
index 0000000..9b6bb42
--- /dev/null
+++ b/META-INF/eclipse.inf
@@ -0,0 +1 @@
+jarprocessor.exclude.sign
\ No newline at end of file
diff --git a/build.properties b/build.properties
new file mode 100644
index 0000000..41eb6ad
--- /dev/null
+++ b/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..cf364cf
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,282 @@
+<project name="javax.persistence-api"  basedir="." default="info">
+
+    <target name="info" depends="init">
+        <!-- IMPL properties -->
+        <property name="IMPL_NAMESPACE"      value="org.eclipse.persistence"/>
+        <property name="IMPL_VERSION"        value="2.1.0"/>
+
+        <echo message="Metadata as defined by: 'https://wikis.oracle.com/display/GlassFish/Maven+Versioning+Rules':"/>
+        <echo message=" "/>
+        <echo message="API_PACKAGE:              ${API_PACKAGE}"/>
+        <echo message="SPEC_VERSION:             ${SPEC_VERSION}"/>
+        <echo message="SPEC_IMPL_VERSION:        ${SPEC_IMPL_VERSION}"/>
+        <echo message=" "/>
+        <echo message="IMPL_NAMESPACE:           ${IMPL_NAMESPACE}"/>
+        <echo message="IMPL_VERSION:             ${IMPL_VERSION}"/>
+        <echo message=" "/>
+        <echo message="API jar file:                 ${API_PACKAGE}-api.jar"/>
+        <echo message="  OSGi Bundle-SymbolicName:      ${API_PACKAGE}-api"/>
+        <echo message="  OSGi bundle specversion:       ${SPEC_VERSION}"/>
+        <echo message="  OSGi Bundle-Version:           ${SPEC_IMPL_VERSION}"/>
+        <echo message="  Maven group ID, artifact ID:   ${API_PACKAGE}:${API_PACKAGE}-api"/>
+        <echo message="  Maven version:                 ${SPEC_IMPL_VERSION}"/>
+        <echo message="  Maven API jar file:            ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}.jar"/>
+        <echo message="  Maven API javadoc file:        ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-javadoc.jar"/>
+        <echo message="  Maven API source  file:        ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-sources.jar"/>
+        <echo message="  jar Extension-Name:            ${API_PACKAGE}"/>
+        <echo message="  jar Specification-Version:     ${SPEC_VERSION}"/>
+        <echo message="  jar Implementation-Version:    ${SPEC_IMPL_VERSION}"/>
+        <echo message=" "/>
+        <echo message="Implementation jar file:       ${API_PACKAGE}.jar"/>
+        <echo message="  OSGi Bundle-SymbolicName:      ${IMPL_NAMESPACE}.${API_PACKAGE}"/>
+        <echo message="  OSGi bundle specversion:       ${SPEC_VERSION}"/>
+        <echo message="  OSGi Bundle-Version:           ${IMPL_VERSION}"/>
+        <echo message="  Maven group ID, artifact ID:   ${IMPL_NAMESPACE}:${API_PACKAGE}"/>
+        <echo message="  Maven version:                 ${IMPL_VERSION}"/>
+        <echo message="  Maven impl jar file:           ${API_PACKAGE}-${IMPL_VERSION}.jar"/>
+        <echo message="  jar Extension-Name:            ${API_PACKAGE}"/>
+        <echo message="  jar Specification-Version:     ${SPEC_VERSION}"/>
+        <echo message="  jar Implementation-Version:    ${IMPL_VERSION}"/>
+        <echo message=" "/>
+        <echo message=" "/>
+        <echo message="Note: The qualifier was omitted from these rules. I believe the API Bundle-Version"/>
+        <echo message="    should really be something like:  ${SPEC_IMPL_VERSION}.${API_QUALIFIER}"/>
+        <echo message=" "/>
+        <echo message="Note2: Tycho expects 'Bundle-Version' to be the Maven 'Version' coordinate (IMPL_VERSION) followed by '.qualifier'"/>
+        <echo message="    which it then substitutes for a generated qualifier at build time. For example: ${persistence.version}"/>
+        <echo message=" "/>
+        <echo message="Note3: Tycho requires ArtifactID to be ${Bundle-SymbolicName}"/>
+        <echo message=" "/>
+        <echo message="Note4: P2/Equinox requires the bundle jarname to be: ${Bundle-SymbolicName}_${Bundle-Version}.jar"/>
+        <echo message="    While renaming the jar shipped in glassfish is possible, it would be confusing to users."/>
+        <echo message="    Also, the metadata in the manifest couldn't be simply 'renamed'."/>
+        <echo message="Therefore:"/>
+        <echo message="       IMPL bundle filename:        ${API_PACKAGE}_${persistence.version}.jar"/>
+        <echo message="       IMPL Bundle-SymbolicName:    ${API_PACKAGE}"/>
+        <echo message="       IMPL Bundle-Version:         ${persistence.version}"/>
+        <echo message="    which is preferable (both historically, and due to jarname length) to changing 'IMPL ArtifactId' to"/>
+        <echo message="    match 'IMPL Bundle-SymbolicName' and thus yield:"/>
+        <echo message="       IMPL bundle filename:        ${IMPL_NAMESPACE}.${API_PACKAGE}_${persistence.version}.jar"/>
+        <echo message="       IMPL Bundle-SymbolicName:    ${IMPL_NAMESPACE}.${API_PACKAGE}"/>
+        <echo message="       IMPL Bundle-Version:         ${persistence.version}"/>
+        <echo message="       IMPL Mvn GroupId:ArtifactId: ${IMPL_NAMESPACE}:${IMPL_NAMESPACE}.${API_PACKAGE}"/>
+        <echo message=" "/>
+        <echo message="Note5: Eclipse has source bundle standard of: ${Bundle-SymbolicName}.source_${Bundle-Version}.jar"/>
+        <echo message="Therefore:       ${API_PACKAGE}.source_${persistence.version}.jar"/>
+        <echo message=" "/>
+        <echo message="Note6: There is no Eclipse requirement for javadoc bundles. However, Maven Central does require javadoc for each artifact"/>
+        <echo message="       so unless Maven implements specific naming requirements, it would make sense to stick to a similar formula to use"/>
+        <echo message="       IMPL javadoc jarname: ${Bundle-SymbolicName}.javadoc_${Bundle-Version}.jar"/>
+        <echo message="       rather than ${API_Package}-${IMPL_Version}-javadoc.jar"/>
+        <echo message="Therefore:       ${API_PACKAGE}.javadoc_${persistence.version}.jar"/>
+        <echo message=" "/>
+        <echo message="Metadata proposal taking into account Eclipse Standards:"/>
+        <echo message=" "/>
+        <echo message="API_PACKAGE:              ${API_PACKAGE}"/>
+        <echo message="SPEC_VERSION:             ${SPEC_VERSION}"/>
+        <echo message="SPEC_IMPL_VERSION:        ${SPEC_IMPL_VERSION}"/>
+        <echo message="API_QUALIFIER (guess):    ${API_QUALIFIER}"/>
+        <echo message=" "/>
+        <echo message="IMPL_NAMESPACE:           ${IMPL_NAMESPACE}"/>
+        <echo message="IMPL_VERSION:             ${IMPL_VERSION}"/>
+        <echo message=" "/>
+        <echo message="API jar file:                 ${API_JAR}"/>
+        <echo message="  OSGi Bundle-SymbolicName:      ${API_PACKAGE}-api"/>
+        <echo message="  OSGi bundle specversion:       ${SPEC_VERSION}"/>
+        <echo message="  OSGi Bundle-Version:           ${SPEC_IMPL_VERSION}"/>
+        <echo message="  OSGi PackageExport:            ${OSGi_PackageExport}"/>
+        <echo message="  Maven group ID, artifact ID:   ${API_PACKAGE}:${API_PACKAGE}-api"/>
+        <echo message="  Maven version:                 ${SPEC_IMPL_VERSION}"/>
+        <echo message="  Maven API jar file:            ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}.jar"/>
+        <echo message="  Maven API javadoc file:        ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-javadoc.jar"/>
+        <echo message="  Maven API source  file:        ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-sources.jar"/>
+        <echo message="  jar Extension-Name:            ${API_PACKAGE}"/>
+        <echo message="  jar Specification-Version:     ${SPEC_VERSION}"/>
+        <echo message="  jar Implementation-Version:    ${SPEC_IMPL_VERSION}"/>
+        <echo message=" "/>
+        <echo message="Implementation jar file:       ${API_PACKAGE}_${persistence.version}.jar"/>
+        <echo message="  OSGi Bundle-SymbolicName:      ${API_PACKAGE}"/>
+        <echo message="  OSGi bundle specversion:       ${SPEC_VERSION}"/>
+        <echo message="  OSGi Bundle-Version:           ${persistence.version}"/>
+        <echo message="  OSGi IMPL source  file:        ${API_PACKAGE}.source_${persistence.version}.jar"/>
+        <echo message="  OSGi IMPL javadoc file:        ${API_PACKAGE}.javadoc_${persistence.version}.jar"/>
+        <echo message="  Maven group ID, artifact ID:   ${IMPL_NAMESPACE}:${API_PACKAGE}"/>
+        <echo message="  Maven version:                 ${IMPL_VERSION}"/>
+        <echo message="  Maven IMPL jar file:           ${API_PACKAGE}-${IMPL_VERSION}.jar"/>
+        <echo message="  Maven IMPL source  file:       ${API_PACKAGE}-${IMPL_VERSION}-sources.jar"/>
+        <echo message="  Maven IMPL javadoc file:       ${API_PACKAGE}-${IMPL_VERSION}-javadoc.jar"/>
+        <echo message="  jar Extension-Name:            ${API_PACKAGE}"/>
+        <echo message="  jar Specification-Version:     ${SPEC_IMPL_VERSION}"/>
+        <echo message="  jar Implementation-Version:    ${IMPL_VERSION}"/>
+        <echo message=" "/>
+    </target>
+
+    <target name="init">
+        <!-- API properties -->
+        <tstamp>
+           <format property="build.date" pattern="yyyyMMdd"/>
+           <format property="build.time" pattern="HHmm"/>
+        </tstamp>
+        <property name="API_PACKAGE"         value="javax.persistence"/>
+        <property name="SPEC_VERSION"        value="2.1"/>
+        <property name="SPEC_IMPL_VERSION"   value="2.1.0"/>
+        <property name="API_QUALIFIER"       value="b10"/>
+
+        <property name="API_JAR"                    value="${API_PACKAGE}-api.jar"/>
+        <property name="API_javadoc_file"           value="${API_PACKAGE}-api-javadoc.jar"/>
+        <property name="API_source_file"            value="${API_PACKAGE}-api-sources.jar"/>
+        <property name="OSGi_SymbolicName"          value="${API_PACKAGE}-api"/>
+        <property name="OSGi_BundleName"            value="Java Persistence API 2.1"/>
+        <property name="OSGi_specversion"           value="${SPEC_VERSION}"/>
+        <property name="OSGi_Bundle-Version"        value="${SPEC_IMPL_VERSION}"/>
+        <property name="OSGi_Bundle-Vendor"         value="Eclipse.org - EclipseLink Project"/>
+        <property name="OSGi_PackageExport"         value="${SPEC_IMPL_VERSION}"/>
+        <property name="jar_Extension-Name"         value="${API_PACKAGE}"/>
+        <property name="jar_Specification-Version"  value="${SPEC_VERSION}"/>
+        <property name="jar_Specification-Vendor"   value="Oracle"/>
+        <property name="jar_Implementation-Version" value="${SPEC_IMPL_VERSION}"/>
+        <property name="jar_Implementation-Vendor"  value="Eclipse.org - EclipseLink Project"/>
+        <property name="Maven_group_ID"             value="${API_PACKAGE}"/>
+        <property name="Maven_artifact_ID"          value="${API_PACKAGE}-api"/>
+        <property name="Maven_version"              value="${SPEC_IMPL_VERSION}"/>
+        <property name="Maven_API_filename"         value="${API_PACKAGE}-api-${SPEC_IMPL_VERSION}.jar"/>
+        <property name="Maven_API_javadoc_file"     value="${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-javadoc.jar"/>
+        <property name="Maven_API_source_file"      value="${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-sources.jar"/>
+
+        <dirname  property="build.location_temp" file="${ant.file.javax.persistence-api}"/>
+        <pathconvert targetos="unix" property="build.location">
+            <path>
+                <pathelement location="${build.location_temp}"/>
+            </path>
+        </pathconvert>
+        <property name="build.2.base.dir"           value="${build.location}/.."/>
+        <property name="build.2.plugins.dir"        value="${build.location}/target"/>
+        <property name="build.2.classes.dir"        value="${build.location}/target/classes"/>
+        <property name="build.2.APIjavadoc.dir"     value="${build.location}/target/APIjavadoc"/>
+        <property name="build.2.src.dir"            value="${build.location}/src"/>
+        <property name="releng.loc"                 value="${build.location}/../eclipselink.releng"/>
+
+        <condition property="build.2.releng.dir"    value="${releng.loc}">
+           <available file="${releng.loc}" type="dir"/>
+        </condition>
+        <fail message="releng repo not found. Clone at '${releng.loc}' and retry." unless="build.2.releng.dir"/>
+
+        <!-- Custom task definitions -->
+        <property name="custom.tasks.lib"                 value="${build.2.releng.dir}/ant_customizations.jar"/>
+        <property name="custom.echo.task.class"           value="org.eclipse.persistence.buildtools.ant.taskdefs.Say"/>
+        <property name="custom.selectbundle.task.class"   value="org.eclipse.persistence.buildtools.ant.taskdefs.SelectBundle"/>
+        <property name="custom.stripqualifier.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.StripQualifier"/>
+        <echo message="custom.tasks.lib                 ='${custom.tasks.lib}'"/>
+        <echo message="custom.echo.task.class           ='${custom.echo.task.class}'"/>
+        <echo message="custom.selectbundle.task.class   ='${custom.selectbundle.task.class}'"/>
+        <echo message="custom.stripqualifier.task.class ='${custom.stripqualifier.task.class}'"/>
+        <echo message=" ---"/>
+        <taskdef name="say"            classname="${custom.echo.task.class}"           classpath="${custom.tasks.lib}"/>
+        <taskdef name="selectbundle"   classname="${custom.selectbundle.task.class}"   classpath="${custom.tasks.lib}"/>
+        <taskdef name="stripQualifier" classname="${custom.stripqualifier.task.class}" classpath="${custom.tasks.lib}"/>
+
+        <property name="persistence.prefix"    value="${API_PACKAGE}"/>
+        <property name="persistence.criteria"  value="[2.0.100,2.2.0)"/>
+
+        <selectbundle basename="${persistence.prefix}" directory="${build.2.plugins.dir}"
+                     criterion="${persistence.criteria}" property="persistence.version" versiononly="true"
+        />
+        <fail message="${persistence.prefix} bundle not found. run mvn, then retry to generate api" unless="persistence.version"/>
+        <stripQualifier input="${persistence.version}"      property="IMPL_VERSION"/>
+        <say  message="Found ${persistence.prefix}_${persistence.version}.jar"                          if="persistence.version"/>
+    </target>
+
+    <target name="build" depends="init, package-jar, package-src, build-javadoc, package-javadoc"/>
+
+    <target name="build-javadoc">
+        <!-- the following property needs to be here because the "qualifier" is generated at runtime -->
+        <property name="javadoc.title" value="Java Persistence ${SPEC_VERSION} API Reference"/>
+        <delete dir="${build.2.APIjavadoc.dir}" failonerror="false"/>
+        <javadoc
+            maxmemory="384m"
+            Verbose="false"
+            packagenames="${API_PACKAGE}.**"
+            destdir="${build.2.APIjavadoc.dir}"
+            useexternalfile="yes"
+            additionalparam="-breakiterator -quiet"
+            windowtitle="${javadoc.title}"
+            >
+            <classpath>
+                <path id="javadoc.path">
+                    <pathelement path="${build.2.plugins.dir}/${API_JAR}"/>
+                </path>
+            </classpath>
+            <tag name ="author" enabled="true" description="Author:" />
+            <tag name ="since" scope="all" description="Since:" />
+            <tag name ="SBGen" scope="all" description="SBGen:" />
+            <tag name ="bug" enabled="true" description="Related Bugs:" />
+            <doctitle><![CDATA[${javadoc.title}]]></doctitle>
+            <header><![CDATA[${javadoc.title}]]></header>
+            <fileset dir="${build.2.src.dir}" defaultexcludes="yes">
+                <include name="javax/persistence/**/*.java"/>
+            </fileset>
+        </javadoc>
+    </target>
+
+    <target name="package-jar" depends="init">
+        <delete file="${build.2.plugins.dir}/${API_JAR}" failonerror="false"/>
+        <jar jarfile="${build.2.plugins.dir}/${API_JAR}" duplicate="preserve">
+            <manifest>
+                <attribute name="Export-Package"                       value="javax.persistence;jpa="${OSGi_specversion}";version="${OSGi_PackageExport}",javax.persistence.criteria;jpa="${OSGi_specversion}";version="${OSGi_PackageExport}",javax.persistence.metamodel;jpa="${OSGi_specversion}";version="${OSGi_PackageExport}",javax.persistence.spi;jpa="${OSGi_specversion}";version="${OSGi_PackageExport}""/>
+                <attribute name="Implementation-Version"               value="${SPEC_IMPL_VERSION}"/>
+                <attribute name="Bundle-ClassPath"                     value="."/>
+                <attribute name="Specification-Vendor"                 value="${jar_Specification-Vendor}"/>
+                <attribute name="Bundle-Name"                          value="${OSGi_BundleName}"/>
+                <attribute name="Bundle-RequiredExecutionEnvironment"  value="JavaSE-1.6"/>
+                <attribute name="Implementation-Vendor"                value="${jar_Implementation-Vendor}"/>
+                <attribute name="Bundle-Vendor"                        value="${OSGi_Bundle-Vendor}"/>
+                <attribute name="Bundle-Version"                       value="${OSGi_Bundle-Version}"/>
+                <attribute name="Bundle-ManifestVersion"               value="2"/>
+                <attribute name="Import-Package"                       value="javax.sql;resolution:=optional"/>
+                <attribute name="Specification-Version"                value="${SPEC_VERSION}"/>
+                <attribute name="Bundle-SymbolicName"                  value="${OSGi_SymbolicName}"/>
+                <attribute name="Extension-Name"                       value="${jar_Extension-Name}"/>
+            </manifest>
+            <fileset dir="${build.2.classes.dir}"   includes="javax/persistence/**/*.class"/>
+            <fileset dir="${build.2.src.dir}"       includes="javax/persistence/**/*.xsd"/>
+        </jar>
+    </target>
+
+    <target name="package-src" depends="init">
+        <delete file="${build.2.plugins.dir}/${API_source_file}" failonerror="false"/>
+        <jar jarfile="${build.2.plugins.dir}/${API_source_file}" duplicate="preserve">
+            <manifest>
+                <attribute name="Implementation-Version"               value="${SPEC_IMPL_VERSION}"/>
+                <attribute name="Specification-Vendor"                 value="${jar_Specification-Vendor}"/>
+                <attribute name="Bundle-Name"                          value="${OSGi_BundleName} Source"/>
+                <attribute name="Implementation-Vendor"                value="${jar_Implementation-Vendor}"/>
+                <attribute name="Bundle-Vendor"                        value="${OSGi_Bundle-Vendor}"/>
+                <attribute name="Bundle-Version"                       value="${OSGi_Bundle-Version}"/>
+                <attribute name="Bundle-ManifestVersion"               value="2"/>
+                <attribute name="Specification-Version"                value="${SPEC_VERSION}"/>
+                <attribute name="Bundle-SymbolicName"                  value="${OSGi_SymbolicName}.source"/>
+                <attribute name="Extension-Name"                       value="${jar_Extension-Name}"/>
+            </manifest>
+            <fileset dir="${build.2.src.dir}"       includes="javax/persistence/**"/>
+        </jar>
+    </target>
+
+    <target name="package-javadoc" depends="init">
+        <delete file="${build.2.plugins.dir}/${API_javadoc_file}" failonerror="false"/>
+        <jar jarfile="${build.2.plugins.dir}/${API_javadoc_file}" duplicate="preserve">
+            <manifest>
+                <attribute name="Implementation-Version"               value="${SPEC_IMPL_VERSION}"/>
+                <attribute name="Specification-Vendor"                 value="${jar_Specification-Vendor}"/>
+                <attribute name="Bundle-Name"                          value="${OSGi_BundleName} Javadoc"/>
+                <attribute name="Implementation-Vendor"                value="${jar_Implementation-Vendor}"/>
+                <attribute name="Bundle-Vendor"                        value="${OSGi_Bundle-Vendor}"/>
+                <attribute name="Bundle-Version"                       value="${OSGi_Bundle-Version}"/>
+                <attribute name="Bundle-ManifestVersion"               value="2"/>
+                <attribute name="Specification-Version"                value="${SPEC_VERSION}"/>
+                <attribute name="Bundle-SymbolicName"                  value="${OSGi_SymbolicName}.javadoc"/>
+                <attribute name="Extension-Name"                       value="${jar_Extension-Name}"/>
+            </manifest>
+            <fileset dir="${build.2.APIjavadoc.dir}" includes="**"/>
+        </jar>
+    </target>
+</project>
\ No newline at end of file
diff --git a/changes b/changes
new file mode 100644
index 0000000..7fb9819
--- /dev/null
+++ b/changes
@@ -0,0 +1,136 @@
+CHANGES:
+
+javax.persistence:
+
+updated licenses in all files
+
+following additional changes were made:
+
+Cache:
+    added     public <T> T unwrap(Class<T> cls);
+
+CacheStoreMode:
+    clarified USE semantics
+
+ColumnResultType:
+    type element added
+
+EntityExistsException:
+    qualification for unsync'd PCs added
+
+EntityManager:
+    many javadoc changes due to introduction of unsync'd PCs
+    added     public Query createQuery(CriteriaUpdate updateQuery);
+    added     public Query createQuery(CriteriaDelete deleteQuery);
+    improved  docs for public Query createNativeQuery(String sqlString);
+    added     public StoredProcedureQuery createNamedStoredProcedureQuery(String name);
+    added     public StoredProcedureQuery createStoredProcedureQuery(String procedureName);
+    added     public StoredProcedureQuery createStoredProcedureQuery(String procedureName, String... resultSetMappings);
+    added     public boolean isJoinedToTransaction();
+
+EntityManagerFactory:
+    added     public void addNamedQuery(String name, Query query);
+    added    public <T> T unwrap(Class<T> cls);
+
+EntityNotFoundException:
+    qualification for unsync'd PCs added
+
+FieldResult
+    improvement to documentation
+
+FlushModeType:
+    qualifications for unsync'd PCs added
+
+NamedQuery:
+    qualifications for unsync'd PCs added
+
+PersistenceContext:
+    added  synchronization element
+
+PersistenceException:
+    qualifications for unsync'd PCs added
+
+Query:
+    clarifications to getParameterValue methods (for OUT params)
+    clarification to getLockMode
+    qualifications for unsync'd PCs
+
+SqlResultSetMapping
+    added ConstructorResult
+
+TypedQuery:
+    qualifications for unsync'd PCs
+
+
+Added Files:
+
+      ConstructorResult
+      NamedStoredProcedureQuery
+      NamedStoredProcedureQueries
+      StoredProcedureParameter
+      ParameterMode
+      StoredProcedureQuery
+      SynchronizationType
+
+
+javax.persistence.metamodel:
+    updated licenses in all files
+
+javax.persistence.spi:
+    updated licenses in all files
+
+javax.persistence.criteria:
+    updated licenses in all files
+
+AbstractQuery:
+    refactored to inherit from CommonAbstractQuery
+
+CollectionJoin:
+    added    CollectionJoin<Z, E> on(Expression<Boolean> restriction);
+    added    CollectionJoin<Z, E> on(Predicate... restrictions);
+
+CriteriaBuilder:
+    added     <T> CriteriaUpdate<T> createCriteriaUpdate(Class<T> targetEntity);
+    added     <T> CriteriaDelete<T> createCriteriaDelete(Class<T> targetEntity);
+    added     <X, T, V extends T> Join<X, V> treat(Join<X, T> join, Class<V> type);
+    added     <X, T, E extends T> CollectionJoin<X, E> treat(CollectionJoin<X, T> join, Class<E> type);
+    added    <X, T, E extends T> SetJoin<X, E> treat(SetJoin<X, T> join, Class<E> type);
+    added    <X, T, E extends T> ListJoin<X, E> treat(ListJoin<X, T> join, Class<E> type);
+    added    <X, K, T, V extends T> MapJoin<X, K, V> treat(MapJoin<X, K, T> join, Class<V> type);
+    added    <X, T extends X> Path<T> treat(Path<X> path, Class<T> type);
+    added    <X, T extends X> Root<T> treat(Root<X> root, Class<T> type);
+
+Fetch:
+    added     Fetch<Z, X> on(Expression<Boolean> restriction);
+    added     Fetch<Z, X> on(Predicate... restrictions);
+    added     Predicate getOn();
+
+Join:
+    added    Join<Z, X> on(Expression<Boolean> restriction);
+    added    Join<Z, X> on(Predicate... restrictions);
+    added    Predicate getOn();
+
+ListJoin:
+    added     ListJoin<Z, E> on(Expression<Boolean> restriction);
+    added     ListJoin<Z, E> on(Predicate... restrictions);
+
+MapJoin:
+    added    MapJoin<Z, K, V> on(Expression<Boolean> restriction);
+    added    MapJoin<Z, K, V> on(Predicate... restrictions);
+
+SetJoin:
+    added    SetJoin<Z, E> on(Expression<Boolean> restriction);
+    added    SetJoin<Z, E> on(Predicate... restrictions);
+
+Added Files
+      CommonAbstractQuery
+      CriteriaUpdate
+      CriteriaDelete
+
+
+Not yet updated:
+XSDs
+
+
+
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..260aa7e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+
+    <name>JPA Spec OSGi Bundle</name>
+    <groupId>javax.persistence</groupId>
+    <artifactId>javax.persistence</artifactId>
+    <version>2.1.0-SNAPSHOT</version>
+    <packaging>eclipse-plugin</packaging>
+
+    <!-- tycho requires maven >= 3.0 -->
+    <prerequisites>
+        <maven>3.0</maven>
+    </prerequisites>
+
+    <properties>
+        <!-- TOOL Properties -->
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <tycho.version>0.17.0</tycho.version>
+        <release.version>2.1.0</release.version>
+        <build.qualifier>v${maven.build.timestamp}</build.qualifier>
+        <forceContextQualifier>${build.qualifier}</forceContextQualifier>
+        <!-- BUILD Properties -->
+        <eclipse.drop>juno</eclipse.drop>
+    </properties>
+
+    <organization>
+        <name>Eclipse.org - EclipseLink Project</name>
+        <url>http://www.eclipse.org/eclipselink</url>
+    </organization>
+
+    <profiles>
+        <profile>
+            <id>tycho.default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <repositories>
+                <repository>
+                    <id>Eclipse</id>
+                    <layout>p2</layout>
+                    <url>http://download.eclipse.org/releases/${eclipse.drop}</url>
+                </repository>
+             </repositories>
+        </profile>
+    </profiles>
+
+    <build>
+        <defaultGoal>verify</defaultGoal>
+        <!-- section added so tycho won't add the maven poms to the artifacts it builds -->
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.eclipse.tycho</groupId>
+                    <artifactId>tycho-packaging-plugin</artifactId>
+                    <version>${tycho.version}</version>
+                    <configuration>
+                        <archive>
+                            <addMavenDescriptor>false</addMavenDescriptor>
+                        </archive>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.eclipse.tycho</groupId>
+                <artifactId>tycho-compiler-plugin</artifactId>
+                <version>${tycho.version}</version>
+                <configuration>
+                    <!-- Set to force OSGi Compatability settings (defaults to "false") (Only available as of Tycho 0.16.0) -->
+                    <!-- requireJREPackageImports>true</requireJREPackageImports -->
+                    <!-- Not needed. Compiler compatibility setting gotten from "Bundle-RequiredExecutionEnvironment" in manifest -->
+                    <!-- source>1.6</source -->
+                    <!-- target>1.6</target -->
+                    <!-- compilerArgument>-nowarn</compilerArgument> <disable all warnings -->
+                    <!-- compilerArgument>-warn:[+|-]warning_tokens_separated_by_comma - Specify the set of enabled warnings </compilerArgument -->
+                    <!-- compilerArgument>-err:warning_tokens_separated_by_comma - convert exactly the listed warnings to errors  </compilerArgument -->
+                    <!-- compilerArgument>-err:+warning_tokens_separated_by_comma - convert additional warnings to errors</compilerArgument -->
+                    <!-- compilerArgument>-err:-warning_tokens_separated_by_comma - remove specific warnings from being converted to errors </compilerArgument -->
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.eclipse.tycho</groupId>
+                <artifactId>tycho-maven-plugin</artifactId>
+                <version>${tycho.version}</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <resolver>p2</resolver>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.eclipse.tycho</groupId>
+                <artifactId>target-platform-configuration</artifactId>
+                <version>${tycho.version}</version>
+                <configuration>
+                    <resolver>p2</resolver>
+                    <environments>
+                        <environment>
+                            <os>linux</os>
+                            <ws>gtk</ws>
+                            <arch>x86_64</arch>
+                        </environment>
+                        <environment>
+                            <os>linux</os>
+                            <ws>gtk</ws>
+                            <arch>x86</arch>
+                        </environment>
+                        <environment>
+                            <os>macosx</os>
+                            <ws>carbon</ws>
+                            <arch>x86</arch>
+                        </environment>
+                        <environment>
+                            <os>macosx</os>
+                            <ws>cocoa</ws>
+                            <arch>x86</arch>
+                        </environment>
+                        <environment>
+                            <os>macosx</os>
+                            <ws>cocoa</ws>
+                            <arch>x86_64</arch>
+                        </environment>
+                        <environment>
+                            <os>win32</os>
+                            <ws>win32</ws>
+                            <arch>x86</arch>
+                        </environment>
+                        <environment>
+                            <os>win32</os>
+                            <ws>win32</ws>
+                            <arch>x86_64</arch>
+                        </environment>
+                    </environments>
+                </configuration>
+            </plugin>
+            <!-- Mostly working source bundle   generation -->
+            <plugin>
+                <groupId>org.eclipse.tycho</groupId>
+                <artifactId>tycho-source-plugin</artifactId>
+                <version>${tycho.version}</version>
+                <executions>
+                    <execution>
+                        <id>plugin-source</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>plugin-source</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>${project.artifactId}.source_${release.version}.${build.qualifier}</finalName>
+                            <sourceBundle>true</sourceBundle>
+                            <sourceBundleSuffix>.source</sourceBundleSuffix>
+                            <qualifier>${build.qualifier}</qualifier>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.6</version>
+                <executions>
+                    <execution>
+                        <id>inject-common-into-src-bundles</id>
+                        <phase>package</phase>
+                        <configuration>
+                            <target>
+                                <zip file="./target/${project.artifactId}.source_${release.version}.${build.qualifier}.jar" duplicate="preserve">
+                                    <zipgroupfileset dir="./target">
+                                        <include name="${project.artifactId}.source_${release.version}.${build.qualifier}-sources.jar"/>
+                                    </zipgroupfileset>
+                                    <fileset dir="./resource" includes="*.html"/>
+                                </zip>
+                                <delete file="./target/${project.artifactId}.source_${release.version}.${build.qualifier}-sources.jar"/>
+                            </target>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+        <sourceDirectory>./src</sourceDirectory>
+        <resources>
+            <resource>
+                <directory>./resource</directory>
+            </resource>
+        </resources>
+        <finalName>${project.artifactId}_${release.version}.${build.qualifier}</finalName>
+    </build>
+
+    <pluginRepositories>
+        <pluginRepository>
+            <id>tycho-public</id>
+            <url>https://oss.sonatype.org/content/groups/public/</url>
+        </pluginRepository>
+    </pluginRepositories>
+
+</project>
diff --git a/readme.txt b/readme.txt
new file mode 100644
index 0000000..ba25c01
--- /dev/null
+++ b/readme.txt
@@ -0,0 +1,16 @@
+Copyright (c) 2008, 2013 Sun Microsystems, Oracle Corporation. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ which accompanies this distribution.
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+  Contributors:
+      Linda DeMichiel -Java Persistence 2.1
+      Specification available from http://jcp.org/en/jsr/detail?id=338
+      Oracle Committers - EclipseLink specific implementations and OSGi support
+      Oracle Committers - Misc Bugfixes
+
+Java(TM) Persistence API, Version 2.1
diff --git a/resource/about.html b/resource/about.html
new file mode 100644
index 0000000..ec64e9a
--- /dev/null
+++ b/resource/about.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About JPA 2.1</title>
+</head>
+<body lang="EN-US">
+<h1>JPA 2.1</h1>
+
+<h2>License </h2>
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").
+    Unless otherwise indicated below, the Content is provided to you under the terms
+    and conditions of the Eclipse Public License Version 1.0 ("EPL") and
+    Eclipse Distribution License Version 1.0 (�EDL�). A copy of the EPL is available at
+    <a href="http://www.eclipse.org/legal/epl-v10.html"> http://www.eclipse.org/legal/epl-v10.html</a>
+    and a copy of the EDL is available at <a href="http://www.eclipse.org/org/documents/edl-v10.php">
+    http://www.eclipse.org/org/documents/edl-v10.php</a>.  For purposes of the EPL, "Program"
+    will mean the Content.</p>
+<p>If you did not receive this Content directly from the Eclipse Foundation, the
+  Content is being redistributed by another party ("Redistributor")
+  and different terms and conditions may apply to your use of any object code
+  in the Content. Check the Redistributor’s license that was provided with
+  the Content. If no such license exists, contact the Redistributor. Unless otherwise
+  indicated below, the terms and conditions of the EPL and EDL still apply to any source
+  code in the Content and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+<h2>Third Party Content</h2>
+<p>The Content includes items that have been sourced from third parties as set
+  out below. If you did not receive this Content directly from the Eclipse Foundation,
+  the following is provided for informational purposes only, and you should look
+  to the Redistributor’s license for terms and conditions of use.</p>
+<h3><a name="JPA21" id="JPA2"></a>Java Persistence (JPA) 2.1  </h3>
+<blockquote>
+  <p>EclipseLink is the Java Persistence (JPA) 2.1 Reference Implementation
+    (<a href="http://jcp.org/en/jsr/detail?id=338">JSR 338</a>).  The JPA 2.1
+    specification API is included in EclipseLink under the <a href="http://www.eclipse.org/legal/epl-v10.html">EPL</a> and <a href="http://www.eclipse.org/org/documents/edl-v10.php">EDL</a> licenses.</p>
+</blockquote>
+<p>
+</body>
+</html>
diff --git a/resource/license.html b/resource/license.html
new file mode 100644
index 0000000..df43520
--- /dev/null
+++ b/resource/license.html
@@ -0,0 +1,287 @@
+<html>
+
+<head>
+<title>Eclipse License</title>
+</head>
+
+<body>
+<div class=Section0>
+<p align=center style='text-align:center'><b>License</b>
+</p>
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the <a href="#EPL">Eclipse Public License Version 1.0 ("EPL")</a> and  <a href="#EDL">Eclipse Distribution License Version 1.0 (�EDL�)</a>.  For purposes of the EPL, "Program" will mean the Content. </p>
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor�s license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL and EDL still apply to any source code in the Content and s [...]
+</div>
+<div class=Section1>
+
+<p align=center style='text-align:center'><a name="EPL"><b>Eclipse Public License - v 1.0</b></a>
+</p>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b> </p>
+
+<p>"Contribution" means:</p>
+
+<p>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br>
+b) in the case of each subsequent Contributor:</p>
+
+<p>i)
+changes to the Program, and</p>
+
+<p>ii)
+additions to the Program;</p>
+
+<p>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </p>
+
+<p>"Contributor" means any person or
+entity that distributes the Program.</p>
+
+<p>"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </p>
+
+<p>"Program" means the Contributions
+distributed in accordance with this Agreement.</p>
+
+<p>"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b> </p>
+
+<p>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare 
+derivative works of, publicly display, publicly perform, distribute and sublicense 
+the Contribution of such Contributor, if any, and such derivative works, in source 
+code and object code form.</p>
+
+<p>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</p>
+
+<p>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b> </p>
+
+<p>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:
+</p>
+
+<p>a)
+it complies with the terms and conditions of this Agreement; and</p>
+
+<p>b)
+its license agreement:</p>
+
+<p>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </p>
+
+<p>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </p>
+
+<p>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</p>
+
+<p>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange. </p>
+
+<p>When the Program is made available in source
+code form: </p>
+
+<p>a)
+it must be made available under this Agreement; and </p>
+
+<p>b) a
+copy of this Agreement must be included with each copy of the Program. </p>
+
+<p>Contributors may not remove or alter any
+copyright notices contained within the Program. </p>
+
+<p>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b> </p>
+
+<p>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense. </p>
+
+<p>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages. </p>
+
+<p><b>5. NO WARRANTY</b> </p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b> </p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES. </p>
+
+<p><b>7. GENERAL</b> </p>
+
+<p>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable. </p>
+
+<p>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </p>
+
+<p>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </p>
+
+<p>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved. </p>
+
+<p>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation. </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
+
+</div>
+<div class=Section2>
+<p align=center style='text-align:center'><a name="EDL"><b>Eclipse Distribution License Version 1.0</b></a></p>
+
+<p>Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.</p> 
+
+<p>All rights reserved.
+<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+<ul>
+<li>Redistributions of source code must retain the above copyright notice, 
+this list of conditions and the following disclaimer.</li>
+<li>Redistributions in binary form must reproduce the above copyright notice, 
+this list of conditions and the following disclaimer in the documentation and/or 
+other materials provided with the distribution.</li>
+<li>Neither the name of the Eclipse Foundation, Inc. nor the names of its 
+contributors may be used to endorse or promote products derived from this 
+software without specific prior written permission.</li></ul></p>
+
+<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
+</div>
+
+</body>
+
+</html>
\ No newline at end of file
diff --git a/resource/readme.html b/resource/readme.html
new file mode 100644
index 0000000..cae2cba
--- /dev/null
+++ b/resource/readme.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>JPA 2.1</title>
+</head>
+<body lang="EN-US">
+<div class=Section0>
+
+<p style="TEXT-ALIGN: center" align=center><B>JPA 2.1 Readme</b> </p>
+  <p><a href="http://jcp.org/en/jsr/detail?id=338">JSR 338</a>
+  (distributed under the license on that page)
+  is packaged in an OSGi format for distribution with the
+  <A href="http://www.eclipse.org/eclipselink">EclipseLink Project</A>
+  which is the reference implimentation of the JPA 2.1 specification.
+</p><p>
+The source code is available within the project's <a href="http://git.eclipse.org/c/eclipselink/javax.persistence.git">javax.persistence Git repository</a>.
+    The binaries are distributed in OSGi enabled javax.persistence_2.1.*.jar series bundles. </p>
+<p>
+    JSR Readme.txt follows:</p><pre>
+Copyright (c) 2008, 2013 Sun Microsystems, Oracle Corporation. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ which accompanies this distribution.
+ The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ and the Eclipse Distribution License is available at
+ http://www.eclipse.org/org/documents/edl-v10.php.
+
+  Contributors:
+      Linda DeMichiel -Java Persistence 2.1
+      Specification available from http://jcp.org/en/jsr/detail?id=338
+      Oracle Committers - EclipseLink specific implementations and OSGi support
+      Oracle Committers - Misc Bugfixes
+
+Java(TM) Persistence API, Version 2.1
+</pre>
+</body>
+</html>
diff --git a/src/javax/persistence/Access.java b/src/javax/persistence/Access.java
new file mode 100644
index 0000000..96f864f
--- /dev/null
+++ b/src/javax/persistence/Access.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used to specify an access type to be applied to an entity class,
+ * mapped superclass, or embeddable class, or to a specific attribute
+ * of such a class.
+ * 
+ * @since Java Persistence 2.0
+ */
+ at Target( { TYPE, METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface Access {
+
+    /**
+     * (Required)  Specification of field- or property-based access.
+     */
+    AccessType value();
+}
diff --git a/src/javax/persistence/AccessType.java b/src/javax/persistence/AccessType.java
new file mode 100644
index 0000000..6494278
--- /dev/null
+++ b/src/javax/persistence/AccessType.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Used with the {@link Access} annotation to specify an access
+ * type to be applied to an entity class, mapped superclass, or
+ * embeddable class, or to a specific attribute of such a class.
+ * 
+ * @see Access
+ *
+ * @since Java Persistence 2.0
+ */
+public enum AccessType {
+
+    /** Field-based access is used. */
+    FIELD,
+
+    /** Property-based access is used. */
+    PROPERTY
+}
diff --git a/src/javax/persistence/AssociationOverride.java b/src/javax/persistence/AssociationOverride.java
new file mode 100644
index 0000000..d773c02
--- /dev/null
+++ b/src/javax/persistence/AssociationOverride.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved. 
+ * 
+ * This program and the accompanying materials are made available under the 
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+ * which accompanies this distribution. 
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ * 
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.0 - Version 2.0 (October 1 - 2013)
+ *     Specification available from http://jcp.org/en/jsr/detail?id=317
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Used to override a mapping for an entity relationship.
+ *
+ * <p> May be applied to an entity that extends a mapped superclass to
+ * override a relationship mapping defined by the mapped
+ * superclass. If not specified, the association is mapped the same as
+ * in the original mapping. When used to override a mapping defined by
+ * a mapped superclass, <code>AssociationOverride</code> is applied to
+ * the entity class.
+ *
+ * <p> May be used to override a relationship mapping from an
+ * embeddable within an entity to another entity when the embeddable
+ * is on the owning side of the relationship. When used to override a
+ * relationship mapping defined by an embeddable class (including an
+ * embeddable class embedded within another embeddable class),
+ * <code>AssociationOverride</code> is applied to the field or
+ * property containing the embeddable.
+ *
+ * <p> When <code>AssociationOverride</code> is used to override a
+ * relationship mapping from an embeddable class, the
+ * <code>name</code> element specifies the referencing relationship
+ * field or property within the embeddable class. To override mappings
+ * at multiple levels of embedding, a dot (".") notation syntax must
+ * be used in the <code>name</code> element to indicate an attribute
+ * within an embedded attribute.  The value of each identifier used
+ * with the dot notation is the name of the respective embedded field
+ * or property.
+ * 
+ * <p> When <code>AssociationOverride</code> is applied to override
+ * the mappings of an embeddable class used as a map value,
+ * "<code>value.</code>" must be used to prefix the name of the
+ * attribute within the embeddable class that is being overridden in
+ * order to specify it as part of the map value.
+ *
+ * <p> If the relationship mapping is a foreign key mapping, the
+ * <code>joinColumns</code> element is used.  If the relationship
+ * mapping uses a join table, the <code>joinTable</code> element must
+ * be specified to override the mapping of the join table and/or its
+ * join columns.
+ *
+ * <p>
+ * <pre>
+ *    Example 1: Overriding the mapping of a relationship defined by a mapped superclass
+ *
+ *    @MappedSuperclass
+ *    public class Employee {
+ *        ...
+ *        @ManyToOne
+ *        protected Address address;
+ *        ...
+ *    }
+ *    
+ *    @Entity 
+ *        @AssociationOverride(name="address", 
+ *                             joinColumns=@JoinColumn(name="ADDR_ID"))
+ *        // address field mapping overridden to ADDR_ID foreign key
+ *    public class PartTimeEmployee extends Employee {
+ *        ...
+ *    }
+ * </pre>
+ *
+ * <pre>
+ *    Example 2: Overriding the mapping for phoneNumbers defined in the ContactInfo class
+ *
+ *    @Entity
+ *    public class Employee {
+ *        @Id int id;
+ *        @AssociationOverride(
+ *          name="phoneNumbers",
+ *          joinTable=@JoinTable(
+ *             name="EMPPHONES",
+ *             joinColumns=@JoinColumn(name="EMP"),
+ *             inverseJoinColumns=@JoinColumn(name="PHONE")
+ *          )
+ *        )
+ *        @Embedded ContactInfo contactInfo;
+ *       ...
+ *    }
+ * 
+ *    @Embeddable
+ *    public class ContactInfo {
+ *        @ManyToOne Address address; // Unidirectional
+ *        @ManyToMany(targetEntity=PhoneNumber.class) List phoneNumbers;
+ *    }
+ * 
+ *    @Entity
+ *    public class PhoneNumber {
+ *        @Id int number;
+ *        @ManyToMany(mappedBy="contactInfo.phoneNumbers")
+ *        Collection<Employee> employees;
+ *     }
+ *    </pre>
+ *
+ * @see Embedded
+ * @see Embeddable
+ * @see MappedSuperclass
+ * @see AttributeOverride
+ *
+ * @since Java Persistence 1.0 
+ */
+ at Target({TYPE, METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface AssociationOverride {
+
+    /**
+     * (Required) 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(s) being mapped to the persistent attribute(s).
+     * The <code>joinColumns</code> elements must be specified if a
+     * foreign key mapping is used in the overriding of the mapping of
+     * the relationship.  The <code>joinColumns</code> element must
+     * not be specified if a join table is used in the overriding of
+     * the mapping of the relationship.
+     */
+    JoinColumn[] joinColumns() default {};
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *   foreign key constraint for the columns corresponding to the
+     *   <code>joinColumns</code> element when table generation is in
+     *   effect.  If both this element and the <code>foreignKey</code>
+     *   element of any of the <code>joinColumns</code> elements are
+     *   specified, the behavior is undefined.  If no foreign key
+     *   annotation element is specified in either location, the
+     *   persistence provider's default foreign key strategy will
+     *   apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    /**
+     * The join table that maps the relationship.
+     * The <code>joinTable</code> element must be specified if a join table 
+     * is used in the overriding of the mapping of the
+     * relationship.  The <code>joinTable</code> element must not be specified
+     * if a foreign key mapping is used in the overriding of
+     * the relationship.
+     *
+     * @since Java Persistence 2.0
+     */
+    JoinTable joinTable() default @JoinTable;
+}
diff --git a/src/javax/persistence/AssociationOverrides.java b/src/javax/persistence/AssociationOverrides.java
new file mode 100644
index 0000000..babeb3c
--- /dev/null
+++ b/src/javax/persistence/AssociationOverrides.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to override mappings of multiple relationship properties or fields.
+ *
+ * <pre>
+ *    
+ *    Example:
+ *
+ *    @MappedSuperclass
+ *    public class Employee {
+ *    
+ *        @Id protected Integer id;
+ *        @Version protected Integer version;
+ *        @ManyToOne protected Address address;
+ *        @OneToOne protected Locker locker;
+ *    
+ *        public Integer getId() { ... }
+ *        public void setId(Integer id) { ... }
+ *        public Address getAddress() { ... }
+ *        public void setAddress(Address address) { ... }
+ *        public Locker getLocker() { ... }
+ *        public void setLocker(Locker locker) { ... }
+ *        ...
+ *    }
+ *    
+ *    @Entity
+ *    @AssociationOverrides({
+ *        @AssociationOverride(
+ *                   name="address", 
+ *                   joinColumns=@JoinColumn("ADDR_ID")),
+ *        @AttributeOverride(
+ *                   name="locker", 
+ *                   joinColumns=@JoinColumn("LCKR_ID"))
+ *        })
+ *    public PartTimeEmployee { ... }
+ * </pre>
+ *
+ *@see AssociationOverride
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface AssociationOverrides {
+
+    /** 
+     *(Required) The association override mappings that are to be 
+     * applied to the relationship field or property .
+     */
+    AssociationOverride[] value();
+}
diff --git a/src/javax/persistence/AttributeConverter.java b/src/javax/persistence/AttributeConverter.java
new file mode 100644
index 0000000..ea69750
--- /dev/null
+++ b/src/javax/persistence/AttributeConverter.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * A class that implements this interface can be used to convert 
+ * entity attribute state into database column representation 
+ * and back again.
+ * Note that the X and Y types may be the same Java type.
+ *
+ * @param <X>  the type of the entity attribute
+ * @param <Y>  the type of the database column
+ */
+public interface AttributeConverter<X,Y> {
+
+    /**
+     * Converts the value stored in the entity attribute into the 
+     * data representation to be stored in the database.
+     *
+     * @param attribute  the entity attribute value to be converted
+     * @return  the converted data to be stored in the database 
+     *          column
+     */
+    public Y convertToDatabaseColumn (X attribute);
+
+    /**
+     * Converts the data stored in the database column into the 
+     * value to be stored in the entity attribute.
+     * Note that it is the responsibility of the converter writer to
+     * specify the correct <code>dbData</code> type for the corresponding 
+     * column for use by the JDBC driver: i.e., persistence providers are 
+     * not expected to do such type conversion.
+     *
+     * @param dbData  the data from the database column to be 
+     *                converted
+     * @return  the converted value to be stored in the entity 
+     *          attribute
+     */
+    public X convertToEntityAttribute (Y dbData);
+}
diff --git a/src/javax/persistence/AttributeNode.java b/src/javax/persistence/AttributeNode.java
new file mode 100644
index 0000000..97f192e
--- /dev/null
+++ b/src/javax/persistence/AttributeNode.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.util.Map;
+
+/**
+ * Represents an attribute node of an entity graph.
+ *
+ * @param <T> The type of the attribute.
+ *
+ * @see EntityGraph
+ * @see Subgraph
+ * @see NamedAttributeNode
+ *
+ * @since Java Persistence 2.1
+ */
+public interface AttributeNode<T> {
+
+    /**
+     * Return the name of the attribute corresponding to the
+     * attribute node.
+     * @return name of the attribute
+     */
+    public String getAttributeName();
+
+    /**
+     * Return the Map<Class, Subgraph> of subgraphs associated
+     * with this attribute node.
+     * @return Map of subgraphs associated with this attribute node
+     * or empty Map if none have been defined
+     */
+    public Map<Class, Subgraph> getSubgraphs();
+
+    /**
+     * Return the Map<Class, Subgraph> of subgraphs associated
+     * with this attribute node's map key.
+     * @return Map of subgraphs associated with this attribute 
+     * node's map key or empty Map if none have been defined
+     */
+    public Map<Class, Subgraph> getKeySubgraphs();
+}
+
diff --git a/src/javax/persistence/AttributeOverride.java b/src/javax/persistence/AttributeOverride.java
new file mode 100644
index 0000000..83bb91f
--- /dev/null
+++ b/src/javax/persistence/AttributeOverride.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to override the mapping of a <code>Basic</code> (whether
+ * explicit or default) property or field or <code>Id</code> property or
+ * field.
+ *
+ * <p> May be applied to an entity that extends a mapped superclass or
+ * to an embedded field or property to override a basic mapping or id
+ * mapping defined by the mapped superclass or embeddable class (or
+ * embeddable class of one of its attributes).
+
+ * <p> May be applied to an element collection containing instances of
+ * an embeddable class or to a map collection whose key and/or value
+ * is an embeddable class. When <code>AttributeOverride</code> is
+ * applied to a map, "<code>key.</code>" or "<code>value.</code>" must
+ * be used to prefix the name of the attribute that is being
+ * overridden in order to specify it as part of the map key or map
+ * value.
+ *
+ * <p> To override mappings at multiple levels of embedding, a dot (".")
+ * notation form must be used in the <code>name</code> element to indicate an
+ * attribute within an embedded attribute.  The value of each identifier
+ * used with the dot notation is the name of the respective embedded
+ * field or property.
+ *
+ * <p> If <code>AttributeOverride</code> is not specified, the column
+ * is mapped the same as in the original mapping.
+ *
+ * <pre>
+ *    Example 1:
+ *
+ *    @MappedSuperclass
+ *    public class Employee {
+ *        @Id protected Integer id;
+ *        @Version protected Integer version;
+ *        protected String address;
+ *        public Integer getId() { ... }
+ *        public void setId(Integer id) { ... }
+ *        public String getAddress() { ... }
+ *        public void setAddress(String address) { ... }
+ *    }
+ *
+ *    @Entity
+ *    @AttributeOverride(name="address", column=@Column(name="ADDR"))
+ *    public class PartTimeEmployee extends Employee {
+ *        // address field mapping overridden to ADDR
+ *        protected Float wage();
+ *        public Float getHourlyWage() { ... }
+ *        public void setHourlyWage(Float wage) { ... }
+ *    }
+ * 
+ *
+ *    Example 2:
+ *
+ *    @Embeddable public class Address {
+ *        protected String street;
+ *        protected String city;
+ *        protected String state;
+ *        @Embedded protected Zipcode zipcode;
+ *    }
+ *
+ *    @Embeddable public class Zipcode {
+ *        protected String zip;
+ *        protected String plusFour;
+ *    }
+ *
+ *    @Entity public class Customer {
+ *        @Id protected Integer id;
+ *        protected String name;
+ *        @AttributeOverrides({
+ *            @AttributeOverride(name="state",
+ *                               column=@Column(name="ADDR_STATE")),
+ *            @AttributeOverride(name="zipcode.zip",
+ *                               column=@Column(name="ADDR_ZIP"))
+ *        })
+ *        @Embedded protected Address address;
+ *        ...
+ *    }
+ *
+ *
+ *    Example 3:
+ *
+ *    @Entity public class PropertyRecord {
+ *        @EmbeddedId PropertyOwner owner;
+ *        @AttributeOverrides({
+ *            @AttributeOverride(name="key.street", 
+ *                               column=@Column(name="STREET_NAME")),
+ *            @AttributeOverride(name="value.size", 
+ *                               column=@Column(name="SQUARE_FEET")),
+ *            @AttributeOverride(name="value.tax", 
+ *                               column=@Column(name="ASSESSMENT"))
+ *        })
+ *       @ElementCollection
+ *       Map<Address, PropertyInfo> parcels;
+ *    }
+ *
+ *   @Embeddable public class PropertyInfo {
+ *       Integer parcelNumber;
+ *       Integer size;
+ *       BigDecimal tax;
+ *   }
+ *
+ * </pre>
+ *
+ * @see Embedded
+ * @see Embeddable
+ * @see MappedSuperclass
+ * @see AssociationOverride
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface AttributeOverride {
+
+    /**
+     * (Required) 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();
+
+    /**
+     * (Required) The column that is being mapped to the persistent 
+     * attribute. The mapping type will remain the same as is 
+     * defined in the embeddable class or mapped superclass.
+     */
+    Column column();
+}
diff --git a/src/javax/persistence/AttributeOverrides.java b/src/javax/persistence/AttributeOverrides.java
new file mode 100644
index 0000000..28ce50d
--- /dev/null
+++ b/src/javax/persistence/AttributeOverrides.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to override mappings of multiple properties or fields.
+ *
+ * <pre>
+ *
+ *    Example:
+ *
+ *    @Embedded
+ *    @AttributeOverrides({
+ *            @AttributeOverride(name="startDate", 
+ *                               column=@Column("EMP_START")),
+ *            @AttributeOverride(name="endDate", 
+ *                               column=@Column("EMP_END"))
+ *    })
+ *    public EmploymentPeriod getEmploymentPeriod() { ... }
+ *
+ * </pre>
+ *
+ *
+ * @see AttributeOverride
+ *
+ * @since Java Persistence 1.0 
+ */
+ at Target({TYPE, METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface AttributeOverrides {
+
+    /** (Required) One or more field or property mapping overrides. */
+    AttributeOverride[] value();
+}
diff --git a/src/javax/persistence/Basic.java b/src/javax/persistence/Basic.java
new file mode 100644
index 0000000..894a96c
--- /dev/null
+++ b/src/javax/persistence/Basic.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+/**
+ * The simplest type of mapping to a database column. The
+ * <code>Basic</code> 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, <code>String</code>, 
+ * <code>java.math.BigInteger</code>,
+ * <code>java.math.BigDecimal</code>,
+ * <code>java.util.Date</code>,
+ * <code>java.util.Calendar</code>, 
+ * <code>java.sql.Date</code>, 
+ * <code>java.sql.Time</code>,
+ * <code>java.sql.Timestamp</code>, <code>byte[]</code>, <code>Byte[]</code>,
+ * <code>char[]</code>, <code>Character[]</code>, enums, and any other type that
+ * implements <code>java.io.Serializable</code>.
+ * 
+ * <p> The use of the <code>Basic</code> annotation is optional for
+ * persistent fields and properties of these types.  If the
+ * <code>Basic</code> annotation is not specified for such a field or
+ * property, the default values of the <code>Basic</code> annotation
+ * will apply.
+ *
+ * <pre>
+ *    Example 1:
+ *
+ *    @Basic
+ *    protected String name;
+ *
+ *    Example 2:
+ *
+ *    @Basic(fetch=LAZY)
+ *    protected String getName() { return name; }
+ *
+ * </pre>
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface Basic {
+
+    /**
+     * (Optional) Defines whether the value of the field or property should 
+     * be lazily loaded or must be eagerly fetched. The <code>EAGER</code> 
+     * strategy is a requirement on the persistence provider runtime 
+     * that the value must be eagerly fetched.  The <code>LAZY</code> 
+     * strategy is a hint to the persistence provider runtime.
+     * If not specified, defaults to <code>EAGER</code>.
+     */
+    FetchType fetch() default EAGER;
+
+    /**
+     * (Optional) 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 <code>true</code>.
+     */
+    boolean optional() default true;
+}
diff --git a/src/javax/persistence/Cache.java b/src/javax/persistence/Cache.java
new file mode 100644
index 0000000..8ba66ee
--- /dev/null
+++ b/src/javax/persistence/Cache.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Interface used to interact with the second-level cache.
+ * If a cache is not in use, the methods of this interface have
+ * no effect, except for <code>contains</code>, which returns false.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Cache {
+
+    /**
+     * Whether the cache contains data for the given entity.
+     * @param cls  entity class 
+     * @param primaryKey  primary key
+     * @return boolean indicating whether the entity is in the cache
+     */
+    public boolean contains(Class cls, Object primaryKey);
+
+    /**
+     * Remove the data for the given entity from the cache.
+     * @param cls  entity class
+     * @param primaryKey  primary key
+     */
+    public void evict(Class cls, Object primaryKey);
+
+    /**
+     * Remove the data for entities of the specified class (and its
+     * subclasses) from the cache.
+     * @param cls  entity class
+     */
+    public void evict(Class cls);
+
+    /**
+     * Clear the cache.
+     */
+    public void evictAll();
+
+    /**
+     * Return an object of the specified type to allow access to the
+     * provider-specific API.  If the provider's Cache
+     * implementation does not support the specified class, the
+     * PersistenceException is thrown.
+     * @param cls  the class of the object to be returned.  This is
+     * normally either the underlying Cache implementation
+     * class or an interface that it implements.
+     * @return an instance of the specified class
+     * @throws PersistenceException if the provider does not
+     * support the call
+     * @since Java Persistence 2.1
+     */
+    public <T> T unwrap(Class<T> cls);
+}
diff --git a/src/javax/persistence/CacheRetrieveMode.java b/src/javax/persistence/CacheRetrieveMode.java
new file mode 100644
index 0000000..aff7473
--- /dev/null
+++ b/src/javax/persistence/CacheRetrieveMode.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Used as the value of the
+ * <code>javax.persistence.cache.retrieveMode</code> property to
+ * specify the behavior when data is retrieved by the
+ * <code>find</code> methods and by queries.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum CacheRetrieveMode {
+
+    /**
+     * Read entity data from the cache: this is 
+     * the default behavior.
+     */
+    USE,
+
+    /**
+     * Bypass the cache: get data directly from
+     * the database.
+     */
+    BYPASS  
+}
diff --git a/src/javax/persistence/CacheStoreMode.java b/src/javax/persistence/CacheStoreMode.java
new file mode 100644
index 0000000..16fc0e0
--- /dev/null
+++ b/src/javax/persistence/CacheStoreMode.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Used as the value of the
+ * <code>javax.persistence.cache.storeMode</code> property to specify
+ * the behavior when data is read from the database and when data is
+ * committed into the database.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum CacheStoreMode {
+
+    /**
+     * Insert entity data into cache when read from database
+     * and insert/update entity data when committed into database: 
+     * this is the default behavior. Does not force refresh
+     * of already cached items when reading from database.
+     */
+    USE,
+
+    /**
+     * Don't insert into cache. 
+     */
+    BYPASS,
+
+    /**
+     * Insert/update entity data into cache when read 
+     * from database and when committed into database. 
+     * Forces refresh of cache for items read from database.
+     */
+    REFRESH
+}
diff --git a/src/javax/persistence/Cacheable.java b/src/javax/persistence/Cacheable.java
new file mode 100644
index 0000000..431fdca
--- /dev/null
+++ b/src/javax/persistence/Cacheable.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies whether an entity should be cached if caching is enabled
+ * when the value of the <code>persistence.xml</code> caching element
+ * is <code>ENABLE_SELECTIVE</code> or <code>DISABLE_SELECTIVE</code>.
+ * The value of the <code>Cacheable</code> annotation is inherited by
+ * subclasses; it can be overridden by specifying
+ * <code>Cacheable</code> on a subclass.
+ * 
+ * <p> <code>Cacheable(false)</code> means that the entity and its state must 
+ * not be cached by the provider.
+ * 
+ * @since Java Persistence 2.0
+ */
+ at Target( { TYPE })
+ at Retention(RUNTIME)
+public @interface Cacheable {
+
+    /**
+     * (Optional) Whether or not the entity should be cached.
+     */
+    boolean value() default true;
+}
diff --git a/src/javax/persistence/CascadeType.java b/src/javax/persistence/CascadeType.java
new file mode 100644
index 0000000..14a2e07
--- /dev/null
+++ b/src/javax/persistence/CascadeType.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+ package javax.persistence;
+
+/**
+ * Defines the set of cascadable operations that are propagated 
+ * to the associated entity.
+ * The value <code>cascade=ALL</code> is equivalent to 
+ * <code>cascade={PERSIST, MERGE, REMOVE, REFRESH, DETACH}</code>.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum CascadeType { 
+
+    /** Cascade all operations */
+    ALL, 
+
+    /** Cascade persist operation */
+    PERSIST, 
+
+    /** Cascade merge operation */
+    MERGE, 
+
+    /** Cascade remove operation */
+    REMOVE,
+
+    /** Cascade refresh operation */
+    REFRESH,
+
+    /**
+     * Cascade detach operation
+     *
+     * @since Java Persistence 2.0
+     * 
+     */   
+    DETACH
+}
diff --git a/src/javax/persistence/CollectionTable.java b/src/javax/persistence/CollectionTable.java
new file mode 100644
index 0000000..b176061
--- /dev/null
+++ b/src/javax/persistence/CollectionTable.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies the table that is used for the mapping of
+ * collections of basic or embeddable types.  Applied
+ * to the collection-valued field or property.
+ * 
+ * <p>By default, the columns of the collection table that correspond
+ * to the embeddable class or basic type are derived from the
+ * attributes of the embeddable class or from the basic type according
+ * to the default values of the <code>Column</code> annotation. In the case
+ * of a basic type, the column name is derived from the name of the
+ * collection-valued field or property. In the case of an embeddable
+ * class, the column names are derived from the field or property
+ * names of the embeddable class.
+ * <ul>
+ * <li> To override the default properties of the column used for a
+ * basic type, the <code>Column</code> annotation is used on the
+ * collection-valued attribute in addition to the
+ * <code>ElementCollection</code> annotation. 
+ *
+ * <li> To override these defaults for an embeddable class, the
+ * <code>AttributeOverride</code> and/or
+ * <code>AttributeOverrides</code> annotations can be used in
+ * addition to the <code>ElementCollection</code> annotation. If the
+ * embeddable class contains references to other entities, the default
+ * values for the columns corresponding to those references may be
+ * overridden by means of the <code>AssociationOverride</code> and/or
+ * <code>AssociationOverrides</code> annotations.  
+ * </ul>
+ *
+ * <p> If the <code>CollectionTable</code> annotation is missing, the
+ * default values of the <code>CollectionTable</code> annotation
+ * elements apply.
+ *
+ * <pre>
+ *    Example:
+ *
+ *    @Embeddable public class Address {
+ *       protected String street;
+ *       protected String city;
+ *       protected String state;
+ *       ... 
+ *     }
+ *
+ *    @Entity public class Person {
+ *       @Id protected String ssn;
+ *       protected String name;
+ *       protected Address home;
+ *       ...
+ *       @ElementCollection  // use default table (PERSON_NICKNAMES)
+ *       @Column(name="name", length=50)
+ *       protected Set<String> nickNames = new HashSet();
+ *       ...
+ *    }
+ *
+ *    @Entity public class WealthyPerson extends Person {
+ *       @ElementCollection
+ *       @CollectionTable(name="HOMES") // use default join column name
+ *       @AttributeOverrides({
+ *          @AttributeOverride(name="street", 
+ *                             column=@Column(name="HOME_STREET")),
+ *          @AttributeOverride(name="city", 
+ *                             column=@Column(name="HOME_CITY")),
+ *          @AttributeOverride(name="state", 
+ *                             column=@Column(name="HOME_STATE"))
+ *        })
+ *       protected Set<Address> vacationHomes = new HashSet();
+ *       ...
+ *    }
+ * </pre>
+ *
+ * @see ElementCollection
+ * @see AttributeOverride
+ * @see AssociationOverride
+ * @see Column
+ *
+ * @since Java Persistence 2.0
+ */
+
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface CollectionTable {
+
+    /** 
+     *  (Optional) The name of the collection table.  If not specified,
+     *  it defaults to the concatenation of the name of the containing
+     *  entity and the name of the collection attribute, separated by
+     *  an underscore.
+     */
+    String name() default "";
+
+    /**
+     *  (Optional) The catalog of the table.  If not specified, the
+     *  default catalog is used.
+     */
+    String catalog() default "";
+
+    /**
+     * (Optional) The schema of the table.  If not specified, the
+     * default schema for the user is used.
+     */
+    String schema() default "";
+
+    /**
+     *  (Optional) The foreign key columns of the collection table
+     *  which reference the primary table of the entity.  The default
+     *  only applies if a single join column is used.  The default is
+     *  the same as for <code>JoinColumn</code> (i.e., the
+     *  concatenation of the following: the name of the entity; "_";
+     *  the name of the referenced primary key column.) However, if
+     *  there is more than one join column, a <code>JoinColumn</code>
+     *  annotation must be specified for each join column using the
+     *  <code>JoinColumns</code> annotation.  In this case, both the
+     *  <code>name</code> and the <code>referencedColumnName</code>
+     *  elements must be specified in each such
+     *  <code>JoinColumn</code> annotation.
+     */
+     JoinColumn[] joinColumns() default {};
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *   foreign key constraint for the columns corresponding to the
+     *   <code>joinColumns</code> element when table generation is in
+     *   effect.  If both this element and the <code>foreignKey</code>
+     *   element of any of the <code>joinColumns</code> elements are
+     *   specified, the behavior is undefined.  If no foreign key
+     *   annotation element is specified in either location, the
+     *   persistence provider's default foreign key strategy will
+     *   apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    /**
+     * (Optional) Unique constraints that are to be placed on the
+     * table.  These are only used if table generation is in effect.
+     */
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    /**
+     * (Optional) Indexes for the table.  These are only used if
+     * table generation is in effect. 
+     *
+     * @since Java Persistence 2.1 
+     */
+    Index[] indexes() default {};
+}
diff --git a/src/javax/persistence/Column.java b/src/javax/persistence/Column.java
new file mode 100644
index 0000000..adc030b
--- /dev/null
+++ b/src/javax/persistence/Column.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the mapped column for a persistent property or field.
+ * If no <code>Column</code> annotation is specified, the default values apply.
+ *
+ * <blockquote><pre>
+ *    Example 1:
+ *
+ *    @Column(name="DESC", nullable=false, length=512)
+ *    public String getDescription() { return description; }
+ *
+ *    Example 2:
+ *
+ *    @Column(name="DESC",
+ *            columnDefinition="CLOB NOT NULL",
+ *            table="EMP_DETAIL")
+ *    @Lob
+ *    public String getDescription() { return description; }
+ *
+ *    Example 3:
+ *
+ *    @Column(name="ORDER_COST", updatable=false, precision=12, scale=2)
+ *    public BigDecimal getCost() { return cost; }
+ *
+ * </pre></blockquote>
+ *
+ *
+ * @since Java Persistence 1.0
+ */ 
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface Column {
+
+    /**
+     * (Optional) The name of the column. Defaults to 
+     * the property or field name.
+     */
+    String name() default "";
+
+    /**
+     * (Optional) Whether the column is a unique key.  This is a 
+     * shortcut for the <code>UniqueConstraint</code> annotation at the table 
+     * level and is useful for when the unique key constraint 
+     * corresponds to only a single column. 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;
+
+    /**
+     * (Optional) Whether the database column is nullable.
+     */
+    boolean nullable() default true;
+
+    /**
+     * (Optional) Whether the column is included in SQL INSERT 
+     * statements generated by the persistence provider.
+     */
+    boolean insertable() default true;
+
+    /**
+     * (Optional) Whether the column is included in SQL UPDATE 
+     * statements generated by the persistence provider.
+     */
+    boolean updatable() default true;
+
+    /**
+     * (Optional) The SQL fragment that is used when 
+     * generating the DDL for the column.
+     * <p> Defaults to the generated SQL to create a
+     * column of the inferred type.
+     */
+    String columnDefinition() default "";
+
+    /**
+     * (Optional) The name of the table that contains the column. 
+     * If absent the column is assumed to be in the primary table.
+     */
+    String table() default "";
+
+    /**
+     * (Optional) The column length. (Applies only if a
+     * string-valued column is used.)
+     */
+    int length() default 255;
+
+    /**
+     * (Optional) 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;
+
+    /**
+     * (Optional) The scale for a decimal (exact numeric) column. 
+     * (Applies only if a decimal column is used.)
+     */
+    int scale() default 0;
+}
diff --git a/src/javax/persistence/ColumnResult.java b/src/javax/persistence/ColumnResult.java
new file mode 100644
index 0000000..ff42571
--- /dev/null
+++ b/src/javax/persistence/ColumnResult.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link SqlResultSetMapping} annotation or
+ * {@link ConstructorResult} annotation to map a column of the SELECT
+ * list of a SQL query.
+ *
+ * <p> The <code>name</code> element references the name of a column in the SELECT list
+ *  — i.e., column alias, if applicable. Scalar result types can be 
+ * included in the query result by specifying this annotation in 
+ * the metadata.
+ *
+ * <pre>
+ *
+ * Example:
+ *   Query q = em.createNativeQuery(
+ *       "SELECT o.id AS order_id, " +
+ *           "o.quantity AS order_quantity, " +
+ *           "o.item AS order_item, " + 
+ *           "i.name AS item_name, " +
+ *         "FROM Order o, Item i " +
+ *         "WHERE (order_quantity > 25) AND (order_item = i.id)",
+ *       "OrderResults");
+ *
+ *   @SqlResultSetMapping(name="OrderResults",
+ *       entities={
+ *           @EntityResult(entityClass=com.acme.Order.class, fields={
+ *               @FieldResult(name="id", column="order_id"),
+ *               @FieldResult(name="quantity", column="order_quantity"),
+ *               @FieldResult(name="item", column="order_item")})},
+ *       columns={
+ *           @ColumnResult(name="item_name")}
+ *       )
+ * </pre>
+ *
+ * @see SqlResultSetMapping
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({}) 
+ at Retention(RUNTIME)
+
+public @interface ColumnResult { 
+
+    /** (Required) The name of a column in the SELECT clause of a SQL query */
+    String name();
+
+    /** 
+     *  (Optional) The Java type to which the column type is to be mapped.
+     *  If the <code>type</code> element is not specified, the default JDBC type 
+     *  mapping for the column will be used.
+     *  @since Java Persistence 2.1
+     */
+    Class type() default void.class;
+}
diff --git a/src/javax/persistence/ConstraintMode.java b/src/javax/persistence/ConstraintMode.java
new file mode 100644
index 0000000..30904dd
--- /dev/null
+++ b/src/javax/persistence/ConstraintMode.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Used to control the application of a constraint.
+ * 
+ * @since Java Persistence 2.1
+ */
+public enum ConstraintMode {
+
+    /** Apply the constraint. */
+	CONSTRAINT,
+
+    /** Do not apply the constraint. */
+	NO_CONSTRAINT,
+
+    /** Use the provider-defined default behavior. */
+        PROVIDER_DEFAULT
+}
diff --git a/src/javax/persistence/ConstructorResult.java b/src/javax/persistence/ConstructorResult.java
new file mode 100644
index 0000000..9bd4776
--- /dev/null
+++ b/src/javax/persistence/ConstructorResult.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link SqlResultSetMapping} annotation to map the SELECT
+ * clause of a SQL query to a constructor.
+ *
+ * <p>Applies a constructor for the target class, passing in as arguments
+ * values from the specified columns.  All columns corresponding
+ * to arguments of the intended constructor must be specified using the
+ * <code>columns</code> element of the <code>ConstructorResult</code>
+ * annotation in the same order as that of the argument list of the
+ * constructor.  Any entities returned as constructor results will be
+ * in either the new or detached state, depending on whether a primary
+ * key is retrieved for the constructed object.
+ * 
+ * <pre>
+ *
+ * Example:
+ *
+ *   Query q = em.createNativeQuery(
+ *      "SELECT c.id, c.name, COUNT(o) as orderCount, AVG(o.price) AS avgOrder " +
+ *      "FROM Customer c, Orders o " +
+ *      "WHERE o.cid = c.id " +
+ *      "GROUP BY c.id, c.name",
+ *      "CustomerDetailsResult");
+ *
+ *   @SqlResultSetMapping(
+ *       name="CustomerDetailsResult",
+ *       classes={
+ *          @ConstructorResult(
+ *               targetClass=com.acme.CustomerDetails.class,
+ *                 columns={
+ *                    @ColumnResult(name="id"),
+ *                    @ColumnResult(name="name"),
+ *                    @ColumnResult(name="orderCount"),
+ *                    @ColumnResult(name="avgOrder", type=Double.class)
+ *                    }
+ *          )
+ *       }
+ *      )
+ *
+ * </pre>
+ *
+ * @see SqlResultSetMapping
+ * @see ColumnResult
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({}) 
+ at Retention(RUNTIME)
+
+public @interface ConstructorResult { 
+
+    /** (Required) The class whose constructor is to be invoked. */
+    Class targetClass();
+
+    /** 
+     *  (Required) The mapping of columns in the SELECT list to the arguments
+     *  of the intended constructor, in order.
+     */
+    ColumnResult[] columns();
+}
diff --git a/src/javax/persistence/Convert.java b/src/javax/persistence/Convert.java
new file mode 100644
index 0000000..189e18f
--- /dev/null
+++ b/src/javax/persistence/Convert.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ *  Specifies the conversion of a Basic field or property.  It is
+ *  not necessary to use the <code>Basic</code> annotation or corresponding
+ *  XML element to specify the Basic type.
+ *
+ *  <p>The <code>Convert</code> annotation should not be used to specify
+ *  conversion of the following:  Id attributes, version attributes,
+ *  relationship attributes, and attributes explicitly denoted as
+ *  Enumerated or Temporal.  Applications that specify such conversions
+ *  will not be portable.
+ *
+ *  <p>The <code>Convert</code> annotation may be applied to a basic
+ *  attribute or to an element collection of basic type (in which case
+ *  the converter is applied to the elements of the collection).  In
+ *  these cases, the <code>attributeName</code> element must not be
+ *  specified.
+ *
+ *  <p>The <code>Convert</code> annotation may be applied to an embedded
+ *  attribute or to a map collection attribute whose key or value is of
+ *  embeddable type (in which case the converter is applied to the
+ *  specified attribute of the embeddable instances contained in the
+ *  collection).  In these cases, the <code>attributeName</code>
+ *  element must be specified.
+ *
+ *  <p>To override conversion mappings at multiple levels of embedding,
+ *  a dot (".") notation form must be used in the <code>attributeName</code>
+ *  element to indicate an attribute within an embedded attribute.  The
+ *  value of each identifier used with the dot notation is the name of the
+ *  respective embedded field or property.
+ *
+ *  <p>When the <code>Convert</code> annotation is applied to a map containing
+ *  instances of embeddable classes, the <code>attributeName</code> element
+ *  must be specified, and <code>"key."</code> or <code>"value."</code>
+ *  must be used to prefix the name of the attribute that is to be converted
+ *  in order to specify it as part of the map key or map value.
+ *
+ *  <p>When the <code>Convert</code> annotation is applied to a map to specify
+ *  conversion of a map key of basic type, <code>"key"</code> must be used
+ *  as the value of the <code>attributeName</code> element to specify that
+ *  it is the map key that is to be converted.
+ *  
+ *  <p>The <code>Convert</code> annotation may be applied to an entity class
+ *  that extends a mapped superclass to specify or override a conversion
+ *  mapping for an inherited basic or embedded attribute.
+ *
+ *  <pre>
+ *     Example 1:  Convert a basic attribute
+ *
+ *     @Converter
+ *     public class BooleanToIntegerConverter 
+ *        implements AttributeConverter<Boolean, Integer> {  ... }
+ *
+ *     @Entity
+ *     public class Employee {
+ *         @Id long id;
+ *
+ *         @Convert(BooleanToIntegerConverter.class)
+ *          boolean fullTime;
+ *          ...
+ *     }
+ *
+ *
+ *     Example 2:  Auto-apply conversion of a basic attribute
+ *
+ *     @Converter(autoApply=true)
+ *     public class EmployeeDateConverter 
+ *        implements AttributeConverter<com.acme.EmployeeDate, java.sql.Date> {  ... }
+ *
+ *     @Entity
+ *     public class Employee {
+ *         @Id long id;
+ *         ...
+ *         // EmployeeDateConverter is applied automatically
+ *         EmployeeDate startDate;
+ *     }
+ *
+ *
+ *     Example 3:  Disable conversion in the presence of an autoapply converter
+ *
+ *     @Convert(disableConversion=true)
+ *     EmployeeDate lastReview;
+ *
+ *
+ *     Example 4:  Apply a converter to an element collection of basic type
+ *
+ *     @ElementCollection
+ *     // applies to each element in the collection
+ *     @Convert(NameConverter.class) 
+ *     List<String> names;
+ *
+ *
+ *     Example 5:  Apply a converter to an element collection that is a map or basic values.  
+ *                 The converter is applied to the map value.
+ *
+ *     @ElementCollection
+ *     @Convert(EmployeeNameConverter.class)
+ *     Map<String, String> responsibilities;
+ *
+ *
+ *     Example 6:  Apply a converter to a map key of basic type
+ *
+ *     @OneToMany
+ *     @Convert(converter=ResponsibilityCodeConverter.class, 
+ *              attributeName="key")
+ *     Map<String, Employee> responsibilities;
+ *
+ *
+ *     Example 7:  Apply a converter to an embeddable attribute
+ *
+ *     @Embedded
+ *     @Convert(converter=CountryConverter.class, 
+ *              attributeName="country")
+ *     Address address;
+ * 
+ *
+ *     Example 8:  Apply a converter to a nested embeddable attribute
+ * 
+ *     @Embedded
+ *     @Convert(converter=CityConverter.class, 
+ *              attributeName="region.city")
+ *     Address address;
+ *
+ *
+ *     Example 9:  Apply a converter to a nested attribute of an embeddable that is a map key 
+ *                 of an element collection
+ *
+ *     @Entity public class PropertyRecord {
+ *          ...
+ *         @Convert(name="key.region.city", 
+ *                  converter=CityConverter.class)
+ *         @ElementCollection
+ *         Map<Address, PropertyInfo> parcels;
+ *     }
+ *
+ *
+ *     Example 10: Apply a converter to an embeddable that is a map key for a relationship
+ *
+ *     @OneToMany
+ *     @Convert(attributeName="key.jobType", 
+ *              converter=ResponsibilityTypeConverter.class)
+ *     Map<Responsibility, Employee> responsibilities;
+ *
+ *
+ *     Example 11: Override conversion mappings for attributes inherited from a mapped superclass
+ *
+ *     @Entity
+ *         @Converts({
+ *            @Convert(attributeName="startDate", 
+ *                     converter=DateConverter.class),
+ *            @Convert(attributeName="endDate", 
+ *                     converter=DateConverter.class)})
+ *     public class FullTimeEmployee extends GenericEmployee { ... }
+ *  </pre>
+ *
+ *  @see Converter
+ *  @see Converts
+ *  @see Basic
+ *
+ *  @since Java Persistence 2.1
+ */
+ at Target({METHOD, FIELD, TYPE}) @Retention(RUNTIME)
+public @interface Convert {
+
+  /**
+   * Specifies the converter to be applied.  A value for this
+   * element must be specified if multiple converters would
+   * otherwise apply.
+   */
+  Class converter() default void.class;
+
+  /**
+   * The <code>attributeName</code> element must be specified unless the 
+   * <code>Convert</code> annotation is on an attribute of basic type 
+   * or on an element collection of basic type.  In these cases, the
+   * <code>attributeName</code> element  must not be specified.
+   */
+  String attributeName() default "";
+
+  /**
+   * Used to disable an auto-apply or inherited converter.
+   * If disableConversion is true, the <code>converter</code> element should
+   * not be specified.
+   */
+  boolean disableConversion() default false;
+}
diff --git a/src/javax/persistence/Converter.java b/src/javax/persistence/Converter.java
new file mode 100644
index 0000000..de8b4b1
--- /dev/null
+++ b/src/javax/persistence/Converter.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the annotated class is a converter and defines its
+ * scope.  A converter class must be annotated with the <code>Converter</code>
+ * annotation or defined in the object/relational mapping descriptor as
+ * a converter.
+ *
+ * <p>If the <code>autoApply</code> element is specified as
+ * <code>true</code>, the persistence provider must automatically
+ * apply the converter to all mapped attributes of the specified
+ * target type for all entities in the persistence unit except for
+ * attributes for which conversion is overridden by means of the
+ * <code>Convert</code> annotation (or XML equivalent).
+ *
+ * <p>In determining whether a converter is applicable to an attribute,
+ * the provider must treat primitive types and wrapper types as
+ * equivalent.
+ *
+ * <p>Note that Id attributes, version attributes, relationship
+ * attributes, and attributes explicitly annotated as
+ * <code>Enumerated</code> or <code>Temporal</code> (or designated as
+ * such via XML) will not be converted.
+ *
+ * <p>Note that if <code>autoApply</code> is <code>true</code>, the
+ * <code>Convert</code> annotation may be used to override or disable
+ * auto-apply conversion on a per-attribute basis.
+ *
+ * <p>If <code>autoApply</code> is <code>false</code>, only those
+ * attributes of the target type for which the <code>Convert</code>
+ * annotation (or corresponding XML element) has been specified will
+ * be converted.
+ *
+ * <p>If there is more than one converter defined for the same target
+ * type, the <code>Convert</code> annotation should be used to
+ * explicitly specify which converter to use.
+ *
+ * @see AttributeConverter
+ * @see Convert
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({TYPE}) @Retention(RUNTIME)
+public @interface Converter {
+     boolean autoApply() default false;
+}
diff --git a/src/javax/persistence/Converts.java b/src/javax/persistence/Converts.java
new file mode 100644
index 0000000..1754f91
--- /dev/null
+++ b/src/javax/persistence/Converts.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to group <code>Convert</code> annotations.  Multiple converters
+ * must not be applied to the same basic attribute.
+ *
+ * @see Convert
+ * @since Java Persistence 2.1
+ */
+ at Target({METHOD, FIELD, TYPE})
+ at Retention(RUNTIME)
+public @interface Converts {
+
+  /**
+   * The <code>Convert</code> mappings that are to be applied.
+   *
+   */
+  Convert[] value();
+}
diff --git a/src/javax/persistence/DiscriminatorColumn.java b/src/javax/persistence/DiscriminatorColumn.java
new file mode 100644
index 0000000..9f1c39b
--- /dev/null
+++ b/src/javax/persistence/DiscriminatorColumn.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.DiscriminatorType.STRING;
+
+/**
+ * Specifies the discriminator column for the 
+ * <code>SINGLE_TABLE</code> and 
+ * <code>JOINED</code> {@link Inheritance} mapping strategies.
+ * 
+ * <p> 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
+ * 
+ * <p> If the <code>DiscriminatorColumn</code> annotation is missing, 
+ * and a discriminator column is required, the name of the 
+ * discriminator column defaults to <code>"DTYPE"</code> and the discriminator 
+ * type to {@link DiscriminatorType#STRING DiscriminatorType.STRING}.
+ *
+ * <pre>
+ *     Example:
+ *
+ *     @Entity
+ *     @Table(name="CUST")
+ *     @Inheritance(strategy=SINGLE_TABLE)
+ *     @DiscriminatorColumn(name="DISC", discriminatorType=STRING, length=20)
+ *     public class Customer { ... }
+ *
+ *     @Entity
+ *     public class ValuedCustomer extends Customer { ... }
+ * </pre>
+ *
+ * @see DiscriminatorValue
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+
+public @interface DiscriminatorColumn {
+
+    /**
+     * (Optional) The name of column to be used for the discriminator.
+     */
+    String name() default "DTYPE";
+
+    /**
+     * (Optional) The type of object/column to use as a class discriminator.
+     * Defaults to {@link DiscriminatorType#STRING DiscriminatorType.STRING}.
+     */
+    DiscriminatorType discriminatorType() default STRING;
+
+    /**
+     * (Optional) The SQL fragment that is used when generating the DDL 
+     * for the discriminator column.
+     * <p> Defaults to the provider-generated SQL to create a column 
+     * of the specified discriminator type.
+     */
+    String columnDefinition() default "";
+
+    /** 
+     * (Optional) The column length for String-based discriminator types. 
+     * Ignored for other discriminator types.
+     */
+    int length() default 31;
+}
diff --git a/src/javax/persistence/DiscriminatorType.java b/src/javax/persistence/DiscriminatorType.java
new file mode 100644
index 0000000..09da52c
--- /dev/null
+++ b/src/javax/persistence/DiscriminatorType.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Defines supported types of the discriminator column. 
+ *
+ * @since Java Persistence 1.0
+ */
+public enum DiscriminatorType { 
+
+    /** 
+     * String as the discriminator type.
+     */
+    STRING,
+
+    /** 
+     * Single character as the discriminator type.
+     */
+    CHAR,
+
+    /** 
+     * Integer as the discriminator type.
+     */
+    INTEGER
+}
diff --git a/src/javax/persistence/DiscriminatorValue.java b/src/javax/persistence/DiscriminatorValue.java
new file mode 100644
index 0000000..664b20b
--- /dev/null
+++ b/src/javax/persistence/DiscriminatorValue.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the value of the discriminator column for 
+ * entities of the given type. 
+ *
+ * <p> The <code>DiscriminatorValue</code> 
+ * annotation can only be specified on a concrete entity 
+ * class. 
+ *
+ * <p> If the <code>DiscriminatorValue</code> 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 {@link DiscriminatorType} is <code>
+ * STRING</code>, the discriminator value 
+ * default is the entity name. 
+ *
+ * <p> 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.
+ *
+ * <pre>
+ *
+ *    Example:
+ *
+ *    @Entity
+ *    @Table(name="CUST")
+ *    @Inheritance(strategy=SINGLE_TABLE)
+ *    @DiscriminatorColumn(name="DISC", discriminatorType=STRING, length=20)
+ *    @DiscriminatorValue("CUSTOMER")
+ *    public class Customer { ... }
+ *
+ *    @Entity
+ *    @DiscriminatorValue("VCUSTOMER")
+ *    public class ValuedCustomer extends Customer { ... }
+ * </pre>
+ *
+ * @see DiscriminatorColumn
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+
+public @interface DiscriminatorValue {
+
+    /**
+     * (Optional) The value that indicates that the
+     * row is an entity of the annotated entity type.
+     *
+     * <p> If the <code>DiscriminatorValue</code> 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 <code>DiscriminatorType</code> is
+     * <code>STRING</code>, the discriminator value default is the
+     * entity name.
+     */
+    String value();
+}
diff --git a/src/javax/persistence/ElementCollection.java b/src/javax/persistence/ElementCollection.java
new file mode 100644
index 0000000..45d2bf5
--- /dev/null
+++ b/src/javax/persistence/ElementCollection.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+/**
+ * Specifies a collection of instances of a basic type or embeddable
+ * class. 
+ * Must be specified if the collection is to be mapped by
+ * means of a collection table.
+ * 
+ * <pre>
+ *    Example:
+ *
+ *    @Entity public class Person {
+ *       @Id protected String ssn;
+ *       protected String name;
+ *       ...
+ *       @ElementCollection  
+ *       protected Set<String> nickNames = new HashSet();
+ *         ...
+ *    } 
+ *  </pre>
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface ElementCollection {
+
+    /**
+     * (Optional) The basic or embeddable class that is the element
+     * type of the collection.  This element is optional only if the
+     * collection field or property is defined using Java generics,
+     * and must be specified otherwise.  It defaults to the
+     * paramterized type of the collection when defined using
+     * generics.
+     */
+    Class targetClass() default void.class;
+    
+    /**
+     *  (Optional) Whether the collection should be lazily loaded or must be
+     *  eagerly fetched.  The EAGER strategy is a requirement on
+     *  the persistence provider runtime that the collection elements
+     *  must be eagerly fetched.  The LAZY strategy is a hint to the
+     *  persistence provider runtime.
+     */
+    FetchType fetch() default LAZY;
+}
diff --git a/src/javax/persistence/Embeddable.java b/src/javax/persistence/Embeddable.java
new file mode 100644
index 0000000..6b6a66d
--- /dev/null
+++ b/src/javax/persistence/Embeddable.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies 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. 
+ *
+ * <p> Note that the {@link Transient} annotation may be used to 
+ * designate the non-persistent state of an embeddable class.
+ *
+ * <pre>
+ *
+ *    Example 1:
+ *
+ *    @Embeddable public class EmploymentPeriod { 
+ *       @Temporal(DATE) java.util.Date startDate;
+ *       @Temporal(DATE) java.util.Date endDate;
+ *      ... 
+ *    }
+ *
+ *    Example 2:
+ *
+ *    @Embeddable public class PhoneNumber {
+ *        protected String areaCode;
+ *        protected String localNumber;
+ *        @ManyToOne PhoneServiceProvider provider;
+ *        ...
+ *     }
+ *
+ *    @Entity public class PhoneServiceProvider {
+ *        @Id protected String name;
+ *         ...
+ *     }
+ *
+ *    Example 3:
+ *
+ *    @Embeddable public class Address {
+ *       protected String street;
+ *       protected String city;
+ *       protected String state;
+ *       @Embedded protected Zipcode zipcode;
+ *    }
+ *
+ *    @Embeddable public class Zipcode {
+ *       protected String zip;
+ *       protected String plusFour;
+ *     }
+
+
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Documented
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface Embeddable {
+}
diff --git a/src/javax/persistence/Embedded.java b/src/javax/persistence/Embedded.java
new file mode 100644
index 0000000..9fdccfc
--- /dev/null
+++ b/src/javax/persistence/Embedded.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a persistent field or property of an entity whose 
+ * value is an instance of an embeddable class. The embeddable 
+ * class must be annotated as {@link Embeddable}.
+ *
+ * <p> The <code>AttributeOverride</code>, <code>AttributeOverrides</code>,
+ * <code>AssociationOverride</code>, and <code>AssociationOverrides</code>
+ * annotations may be used to override mappings declared or defaulted
+ * by the embeddable class.
+ *
+ * <pre>
+ *   Example:
+ *
+ *   @Embedded
+ *   @AttributeOverrides({
+ *       @AttributeOverride(name="startDate", column=@Column("EMP_START")),
+ *       @AttributeOverride(name="endDate", column=@Column("EMP_END"))
+ *   })
+ *   public EmploymentPeriod getEmploymentPeriod() { ... }
+ * </pre>
+ *
+ * @see Embeddable
+ * @see AttributeOverride
+ * @see AttributeOverrides
+ * @see AssociationOverride
+ * @see AssociationOverrides
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface Embedded {
+}
diff --git a/src/javax/persistence/EmbeddedId.java b/src/javax/persistence/EmbeddedId.java
new file mode 100644
index 0000000..3c5a88d
--- /dev/null
+++ b/src/javax/persistence/EmbeddedId.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 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 {@link Embeddable}. 
+ *
+ * <p> There must be only one <code>EmbeddedId</code> annotation and
+ * no <code>Id</code> annotation when the <code>EmbeddedId</code> annotation is used.
+ *
+ * <p> The {@link AttributeOverride} annotation may be used to override
+ * the column mappings declared within the embeddable class.
+ * 
+ * <p> The {@link MapsId} annotation may be used in conjunction
+ * with the <code>EmbeddedId</code> annotation to specify a derived
+ * primary key.
+ *
+ * <p> If the entity has a derived primary key, the
+ * <code>AttributeOverride</code> annotation may only be used to
+ * override those attributes of the embedded id that do not correspond
+ * to the relationship to the parent entity.
+ *
+ * <p> Relationship mappings defined within an embedded id class are not supported.
+ *
+ * <pre>
+ *    Example 1:
+ *
+ *    @EmbeddedId
+ *    protected EmployeePK empPK;
+ *
+ *
+ *    Example 2:
+ *
+ *    @Embeddable
+ *    public class DependentId {
+ *       String name;
+ *       EmployeeId empPK;   // corresponds to primary key type of Employee
+ *    }
+ *
+ *    @Entity
+ *    public class Dependent {
+ *       // default column name for "name" attribute is overridden
+ *       @AttributeOverride(name="name", @Column(name="dep_name"))
+ *       @EmbeddedId DependentId id;
+ *       ...
+ *       @MapsId("empPK")
+ *       @ManyToOne Employee emp;
+ *    }
+ * </pre>
+ *
+ * @see Embeddable
+ * @see MapsId
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface EmbeddedId {}
diff --git a/src/javax/persistence/Entity.java b/src/javax/persistence/Entity.java
new file mode 100644
index 0000000..1dda0a3
--- /dev/null
+++ b/src/javax/persistence/Entity.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the class is an entity. This annotation is applied to the
+ * entity class.
+ * 
+ * @since Java Persistence 1.0
+ */
+ at Documented
+ at Target(TYPE)
+ at Retention(RUNTIME)
+public @interface Entity {
+
+	/**
+	 * (Optional) The entity name. 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 "";
+}
diff --git a/src/javax/persistence/EntityExistsException.java b/src/javax/persistence/EntityExistsException.java
new file mode 100644
index 0000000..2ac4517
--- /dev/null
+++ b/src/javax/persistence/EntityExistsException.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when {@link EntityManager#persist(Object)
+ * EntityManager.persist(Object)} is called and the entity already exists. The
+ * current transaction, if one is active, will be marked for rollback.
+ * <p>
+ * If the entity already exists, the <code>EntityExistsException</code> may be thrown when
+ * the persist operation is invoked, or the <code>EntityExistsException</code> or another
+ * <code>PersistenceException</code> may be thrown at flush or commit time.
+ * <p> The current transaction, if one is active and the persistence context
+ * has been joined to it, will be marked for rollback.
+ *
+ * @see javax.persistence.EntityManager#persist(Object)
+ * 
+ * @since Java Persistence 1.0
+ */
+public class EntityExistsException extends PersistenceException {
+
+    /**
+     * Constructs a new <code>EntityExistsException</code> exception with
+     * <code>null</code> as its detail message.
+     */
+    public EntityExistsException() {
+        super();
+    }
+
+    /**
+     * Constructs a new <code>EntityExistsException</code> exception with the
+     * specified detail message.
+     * 
+     * @param message
+     *            the detail message.
+     */
+    public EntityExistsException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new <code>EntityExistsException</code> 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);
+    }
+
+    /**
+     * Constructs a new <code>EntityExistsException</code> exception with the
+     * specified cause.
+     * 
+     * @param cause
+     *            the cause.
+     */
+    public EntityExistsException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/src/javax/persistence/EntityGraph.java b/src/javax/persistence/EntityGraph.java
new file mode 100644
index 0000000..fc4def9
--- /dev/null
+++ b/src/javax/persistence/EntityGraph.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import javax.persistence.metamodel.Attribute;
+import java.util.List;
+
+/**
+ * This type represents the root of an entity graph that will be used
+ * as a template to define the attribute nodes and boundaries of a
+ * graph of entities and entity relationships. The root must be an
+ * entity type.
+ * <p>
+ * The methods to add subgraphs implicitly create the
+ * corresponding attribute nodes as well; such attribute nodes
+ * should not be redundantly specified.
+ *
+ * @param <T> The type of the root entity.
+ *
+ * @see AttributeNode
+ * @see Subgraph
+ * @see NamedEntityGraph
+ *
+ * @since Java Persistence 2.1
+ */
+public interface EntityGraph<T> {
+
+    /**
+     * Return the name of a named EntityGraph (an entity graph
+     * defined by means of the <code>NamedEntityGraph</code>
+     * annotation, XML descriptor element, or added by means of the
+     * <code>addNamedEntityGraph</code> method.  Returns null if the
+     * EntityGraph is not a named EntityGraph.
+     */
+    public String getName();
+
+    /**
+     * Add one or more attribute nodes to the entity graph.
+     *
+     * @param attributeName  name of the attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this entity.
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public void addAttributeNodes(String ... attributeName);
+
+    /**
+     * Add one or more attribute nodes to the entity graph.
+     *
+     * @param attribute  attribute
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public void addAttributeNodes(Attribute<T, ?> ... attribute);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type. This allows for construction of multi-node entity graphs
+     * that include related managed types.  
+     *
+     * @param attribute  attribute
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not a managed type
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addSubgraph(Attribute<T, X> attribute);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type with inheritance.  This allows for multiple subclass
+     * subgraphs to be defined for this node of the entity
+     * graph. Subclass subgraphs will automatically include the
+     * specified attributes of superclass subgraphs. 
+     *
+     * @param attribute  attribute
+     * @param type  entity subclass
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<? extends X> addSubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type. This allows for construction of multi-node entity graphs
+     * that include related managed types.  
+     *
+     * @param attributeName  name of the attribute 
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this entity.
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not a managed type
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addSubgraph(String attributeName);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type with inheritance.  This allows for multiple subclass
+     * subgraphs to be defined for this node of the entity graph.
+     * Subclass subgraphs will automatically include the specified
+     * attributes of superclass subgraphs.  
+     *
+     * @param attributeName  name of the attribute 
+     * @param type  entity subclass
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this managed type.
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been
+     *         statically defined
+     */
+    public <X> Subgraph<X> addSubgraph(String attributeName, Class<X> type);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type. This allows for construction of
+     * multi-node entity graphs that include related managed types.
+     *
+     * @param attribute  attribute
+     * @return subgraph for the key attribute
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not an entity
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addKeySubgraph(Attribute<T, X> attribute);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type with inheritance. This allows for
+     * construction of multi-node entity graphs that include related
+     * managed types.  Subclass subgraphs will include the specified
+     * attributes of superclass subgraphs.
+     *
+     * @param attribute  attribute
+     * @param type  entity subclass
+     * @return subgraph for the key attribute
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not an entity
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<? extends X> addKeySubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type. This allows for construction of
+     * multi-node entity graphs that include related managed types.
+     *
+     * @param attributeName  name of the attribute
+     * @return subgraph for the key attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this entity.
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not an entity
+     * @throws IllegalStateException if this EntityGraph has been
+     *          statically defined
+     */
+    public <X> Subgraph<X> addKeySubgraph(String attributeName);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type with inheritance. This allows for
+     * construction of multi-node entity graphs that include related
+     * managed types. Subclass subgraphs will automatically include
+     * the specified attributes of superclass subgraphs
+     *
+     * @param attributeName  name of the attribute
+     * @param type  entity subclass
+     * @return subgraph for the key attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this entity.
+     * @throws IllegalArgumentException if the attribute's target type 
+     *         is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addKeySubgraph(String attributeName, Class<X> type);
+
+
+    /**
+     * Add additional attributes to this entity graph that
+     * correspond to attributes of subclasses of this EntityGraph's
+     * entity type.  Subclass subgraphs will automatically include the
+     * specified attributes of superclass subgraphs.
+     *
+     * @param type  entity subclass
+     * @return subgraph for the subclass
+     * @throws IllegalArgumentException if the type is not an entity type
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public <T> Subgraph<? extends T> addSubclassSubgraph(Class<? extends T> type);
+
+
+    /**
+     * Return the attribute nodes of this entity that are included in
+     * the entity graph.
+     * @return attribute nodes for the annotated entity type or empty
+     *         list if none have been defined
+     */
+    public List<AttributeNode<?>> getAttributeNodes();
+
+}
diff --git a/src/javax/persistence/EntityListeners.java b/src/javax/persistence/EntityListeners.java
new file mode 100644
index 0000000..3f8e40e
--- /dev/null
+++ b/src/javax/persistence/EntityListeners.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 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.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface EntityListeners {
+
+    /** The callback listener classes */
+    Class[] value();
+}
diff --git a/src/javax/persistence/EntityManager.java b/src/javax/persistence/EntityManager.java
new file mode 100644
index 0000000..336a980
--- /dev/null
+++ b/src/javax/persistence/EntityManager.java
@@ -0,0 +1,895 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.util.Map;
+import java.util.List;
+import javax.persistence.metamodel.Metamodel;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.CriteriaUpdate;
+import javax.persistence.criteria.CriteriaDelete;
+
+/**
+ * Interface used to interact with the persistence context.
+ *
+ * <p> An <code>EntityManager</code> 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. 
+ * The <code>EntityManager</code> API is used 
+ * to create and remove persistent entity instances, to find entities 
+ * by their primary key, and to query over entities.
+ *
+ * <p> The set of entities that can be managed by a given 
+ * <code>EntityManager</code> 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.
+ *
+ * @see Query
+ * @see TypedQuery
+ * @see CriteriaQuery
+ * @see PersistenceContext
+ * @see StoredProcedureQuery
+ * 
+ * @since Java Persistence 1.0
+ */
+public interface EntityManager {
+
+    /**
+     * Make an instance managed and persistent.
+     * @param entity  entity instance
+     * @throws EntityExistsException if the entity already exists.
+     * (If the entity already exists, the <code>EntityExistsException</code> may 
+     * be thrown when the persist operation is invoked, or the
+     * <code>EntityExistsException</code> or another <code>PersistenceException</code> may be 
+     * thrown at flush or commit time.) 
+     * @throws IllegalArgumentException if the instance is not an
+     *         entity
+     * @throws TransactionRequiredException if there is no transaction when
+     *         invoked on a container-managed entity manager of that is of type 
+     *         <code>PersistenceContextType.TRANSACTION</code>
+     */
+    public void persist(Object entity);
+    
+    /**
+     * Merge the state of the given entity into the
+     * current persistence context.
+     * @param entity  entity instance
+     * @return the managed instance that the state was merged to
+     * @throws IllegalArgumentException if instance is not an
+     *         entity or is a removed entity
+     * @throws TransactionRequiredException if there is no transaction when
+     *         invoked on a container-managed entity manager of that is of type 
+     *         <code>PersistenceContextType.TRANSACTION</code>
+     */    
+    public <T> T merge(T entity);
+
+    /**
+     * Remove the entity instance.
+     * @param entity  entity instance
+     * @throws IllegalArgumentException if the instance is not an
+     *         entity or is a detached entity
+     * @throws TransactionRequiredException if invoked on a
+     *         container-managed entity manager of type 
+     *         <code>PersistenceContextType.TRANSACTION</code> and there is 
+     *         no transaction
+     */    
+    public void remove(Object entity);
+    
+    /**
+     * Find by primary key.
+     * Search for an entity of the specified class and primary key.
+     * If the entity instance is contained in the persistence context,
+     * it is returned from there.
+     * @param entityClass  entity class
+     * @param primaryKey  primary key
+     * @return the found entity instance or null if the entity does
+     *         not exist
+     * @throws IllegalArgumentException if the first argument does
+     *         not denote an entity type or the second argument is 
+     *         is not a valid type for that entity's primary key or
+     *         is null
+     */
+    public <T> T find(Class<T> entityClass, Object primaryKey);
+    
+    /**
+     * Find by primary key, using the specified properties. 
+     * Search for an entity of the specified class and primary key. 
+     * If the entity instance is contained in the persistence 
+     * context, it is returned from there. 
+     * If a vendor-specific property or hint is not recognized, 
+     * it is silently ignored. 
+     * @param entityClass  entity class
+     * @param primaryKey   primary key
+     * @param properties  standard and vendor-specific properties 
+     *        and hints
+     * @return the found entity instance or null if the entity does
+     *         not exist 
+     * @throws IllegalArgumentException if the first argument does 
+     *         not denote an entity type or the second argument is
+     *         is not a valid type for that entity's primary key or 
+     *         is null 
+     * @since Java Persistence 2.0
+     */ 
+    public <T> T find(Class<T> entityClass, Object primaryKey, 
+                      Map<String, Object> properties); 
+    
+    /**
+     * Find by primary key and lock.
+     * Search for an entity of the specified class and primary key
+     * and lock it with respect to the specified lock type.
+     * If the entity instance is contained in the persistence context,
+     * it is returned from there, and the effect of this method is
+     * the same as if the lock method had been called on the entity.
+     * <p> If the entity is found within the persistence context and the
+     * lock mode type is pessimistic and the entity has a version
+     * attribute, the persistence provider must perform optimistic
+     * version checks when obtaining the database lock.  If these 
+     * checks fail, the <code>OptimisticLockException</code> will be thrown.
+     * <p>If the lock mode type is pessimistic and the entity instance
+     * is found but cannot be locked:
+     * <ul>
+     * <li> the <code>PessimisticLockException</code> will be thrown if the database
+     *    locking failure causes transaction-level rollback
+     * <li> the <code>LockTimeoutException</code> will be thrown if the database
+     *    locking failure causes only statement-level rollback
+     * </ul>
+     * @param entityClass  entity class
+     * @param primaryKey  primary key
+     * @param lockMode  lock mode
+     * @return the found entity instance or null if the entity does
+     *         not exist
+     * @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 or 
+     *         is null
+     * @throws TransactionRequiredException if there is no 
+     *         transaction and a lock mode other than <code>NONE</code> is
+     *         specified or if invoked on an entity manager which has
+     *         not been joined to the current transaction and a lock
+     *         mode other than <code>NONE</code> is specified
+     * @throws OptimisticLockException if the optimistic version 
+     *         check fails
+     * @throws PessimisticLockException if pessimistic locking 
+     *         fails and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking fails and
+     *         only the statement is rolled back
+     * @throws PersistenceException if an unsupported lock call 
+     *         is made
+     * @since Java Persistence 2.0
+     */
+    public <T> T find(Class<T> entityClass, Object primaryKey,
+                      LockModeType lockMode);
+
+    /**
+     * Find by primary key and lock, using the specified properties. 
+     * Search for an entity of the specified class and primary key
+     * and lock it with respect to the specified lock type.
+     * If the entity instance is contained in the persistence context,
+     * it is returned from there.  
+     * <p> If the entity is found
+     * within the persistence context and the lock mode type
+     * is pessimistic and the entity has a version attribute, the
+     * persistence provider must perform optimistic version checks
+     * when obtaining the database lock.  If these checks fail,
+     * the <code>OptimisticLockException</code> will be thrown.
+     * <p>If the lock mode type is pessimistic and the entity instance
+     * is found but cannot be locked:
+     * <ul>
+     * <li> the <code>PessimisticLockException</code> will be thrown if the database
+     *    locking failure causes transaction-level rollback
+     * <li> the <code>LockTimeoutException</code> will be thrown if the database
+     *    locking failure causes only statement-level rollback
+     * </ul>
+     * <p>If a vendor-specific property or hint is not recognized, 
+     * it is silently ignored.  
+     * <p>Portable applications should not rely on the standard timeout
+     * hint. Depending on the database in use and the locking
+     * mechanisms used by the provider, the hint may or may not
+     * be observed.
+     * @param entityClass  entity class
+     * @param primaryKey  primary key
+     * @param lockMode  lock mode
+     * @param properties  standard and vendor-specific properties
+     *        and hints
+     * @return the found entity instance or null if the entity does
+     *         not exist
+     * @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 or 
+     *         is null
+     * @throws TransactionRequiredException if there is no 
+     *         transaction and a lock mode other than <code>NONE</code> is
+     *         specified or if invoked on an entity manager which has
+     *         not been joined to the current transaction and a lock
+     *         mode other than <code>NONE</code> is specified
+     * @throws OptimisticLockException if the optimistic version 
+     *         check fails
+     * @throws PessimisticLockException if pessimistic locking 
+     *         fails and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking fails and
+     *         only the statement is rolled back
+     * @throws PersistenceException if an unsupported lock call 
+     *         is made
+     * @since Java Persistence 2.0
+     */
+    public <T> T find(Class<T> entityClass, Object primaryKey,
+                      LockModeType lockMode, 
+                      Map<String, Object> properties);
+
+    /**
+     * Get an instance, whose state may be lazily fetched.
+     * If the requested instance does not exist in the database,
+     * the <code>EntityNotFoundException</code> is thrown when the instance 
+     * state is first accessed. (The persistence provider runtime is 
+     * permitted to throw the <code>EntityNotFoundException</code> when 
+     * <code>getReference</code> 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  entity class
+     * @param primaryKey  primary key
+     * @return the found entity instance
+     * @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 or
+     *         is null
+     * @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 TransactionRequiredException if there is
+     *         no transaction or if the entity manager has not been
+     *         joined to the current 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  flush mode
+     */
+    public void setFlushMode(FlushModeType flushMode);
+
+    /**
+     * Get the flush mode that applies to all objects contained
+     * in the persistence context. 
+     * @return flushMode
+     */
+    public FlushModeType getFlushMode();
+
+    /**
+     * Lock an entity instance that is contained in the persistence
+     * context with the specified lock mode type.
+     * <p>If a pessimistic lock mode type is specified and the entity
+     * contains a version attribute, the persistence provider must 
+     * also perform optimistic version checks when obtaining the 
+     * database lock.  If these checks fail, the 
+     * <code>OptimisticLockException</code> will be thrown.
+     * <p>If the lock mode type is pessimistic and the entity instance
+     * is found but cannot be locked:
+     * <ul>
+     * <li> the <code>PessimisticLockException</code> will be thrown if the database
+     *    locking failure causes transaction-level rollback
+     * <li> the <code>LockTimeoutException</code> will be thrown if the database
+     *    locking failure causes only statement-level rollback
+     * </ul>
+     * @param entity  entity instance
+     * @param lockMode  lock mode
+     * @throws IllegalArgumentException if the instance is not an
+     *         entity or is a detached entity
+     * @throws TransactionRequiredException if there is no 
+     *         transaction or if invoked on an entity manager which
+     *         has not been joined to the current transaction
+     * @throws EntityNotFoundException if the entity does not exist 
+     *         in the database when pessimistic locking is 
+     *         performed
+     * @throws OptimisticLockException if the optimistic version 
+     *         check fails
+     * @throws PessimisticLockException if pessimistic locking fails 
+     *         and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking fails and
+     *         only the statement is rolled back
+     * @throws PersistenceException if an unsupported lock call 
+     *         is made
+     */
+    public void lock(Object entity, LockModeType lockMode);
+
+    /**
+     * Lock an entity instance that is contained in the persistence
+     * context with the specified lock mode type and with specified
+     * properties.
+     * <p>If a pessimistic lock mode type is specified and the entity
+     * contains a version attribute, the persistence provider must 
+     * also perform optimistic version checks when obtaining the 
+     * database lock.  If these checks fail, the 
+     * <code>OptimisticLockException</code> will be thrown.
+     * <p>If the lock mode type is pessimistic and the entity instance
+     * is found but cannot be locked:
+     * <ul>
+     * <li> the <code>PessimisticLockException</code> will be thrown if the database
+     *    locking failure causes transaction-level rollback
+     * <li> the <code>LockTimeoutException</code> will be thrown if the database
+     *    locking failure causes only statement-level rollback
+     * </ul>
+     * <p>If a vendor-specific property or hint is not recognized, 
+     * it is silently ignored.  
+     * <p>Portable applications should not rely on the standard timeout
+     * hint. Depending on the database in use and the locking
+     * mechanisms used by the provider, the hint may or may not
+     * be observed.
+     * @param entity  entity instance
+     * @param lockMode  lock mode
+     * @param properties  standard and vendor-specific properties
+     *        and hints
+     * @throws IllegalArgumentException if the instance is not an
+     *         entity or is a detached entity
+     * @throws TransactionRequiredException if there is no 
+     *         transaction or if invoked on an entity manager which
+     *         has not been joined to the current transaction
+     * @throws EntityNotFoundException if the entity does not exist 
+     *         in the database when pessimistic locking is 
+     *         performed
+     * @throws OptimisticLockException if the optimistic version 
+     *         check fails
+     * @throws PessimisticLockException if pessimistic locking fails 
+     *         and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking fails and
+     *         only the statement is rolled back
+     * @throws PersistenceException if an unsupported lock call 
+     *         is made
+     * @since Java Persistence 2.0
+     */
+    public void lock(Object entity, LockModeType lockMode,
+                     Map<String, Object> properties);
+
+    /**
+     * Refresh the state of the instance from the database, 
+     * overwriting changes made to the entity, if any. 
+     * @param entity  entity instance
+     * @throws IllegalArgumentException if the instance is not
+     *         an entity or the entity is not managed
+     * @throws TransactionRequiredException if there is no
+     *         transaction when invoked on a container-managed
+     *         entity manager of type <code>PersistenceContextType.TRANSACTION</code>
+     * @throws EntityNotFoundException if the entity no longer
+     *         exists in the database
+     */    
+    public void refresh(Object entity);
+
+    /**
+     * Refresh the state of the instance from the database, using 
+     * the specified properties, and overwriting changes made to
+     * the entity, if any. 
+     * <p> If a vendor-specific property or hint is not recognized, 
+     * it is silently ignored. 
+     * @param entity  entity instance
+     * @param properties  standard and vendor-specific properties 
+     *        and hints
+     * @throws IllegalArgumentException if the instance is not 
+     *         an entity or the entity is not managed 
+     * @throws TransactionRequiredException if there is no
+     *         transaction when invoked on a container-managed
+     *         entity manager of type <code>PersistenceContextType.TRANSACTION</code>
+     * @throws EntityNotFoundException if the entity no longer 
+     *         exists in the database 
+     * @since Java Persistence 2.0
+     */     
+    public void refresh(Object entity,
+                            Map<String, Object> properties); 
+
+    /**
+     * Refresh the state of the instance from the database, 
+     * overwriting changes made to the entity, if any, and 
+     * lock it with respect to given lock mode type.
+     * <p>If the lock mode type is pessimistic and the entity instance
+     * is found but cannot be locked:
+     * <ul>
+     * <li> the <code>PessimisticLockException</code> will be thrown if the database
+     *    locking failure causes transaction-level rollback
+     * <li> the <code>LockTimeoutException</code> will be thrown if the
+     *    database locking failure causes only statement-level 
+     *    rollback.
+     * </ul>
+     * @param entity  entity instance
+     * @param lockMode  lock mode
+     * @throws IllegalArgumentException if the instance is not
+     *         an entity or the entity is not managed
+     * @throws TransactionRequiredException if invoked on a 
+     *         container-managed entity manager of type
+     *         <code>PersistenceContextType.TRANSACTION</code> when there is
+     *         no transaction; if invoked on an extended entity manager when
+     *         there is no transaction and a lock mode other than <code>NONE</code>
+     *         has been specified; or if invoked on an extended entity manager
+     *         that has not been joined to the current transaction and a
+     *         lock mode other than <code>NONE</code> has been specified
+     * @throws EntityNotFoundException if the entity no longer exists
+     *         in the database
+     * @throws PessimisticLockException if pessimistic locking fails
+     *         and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking fails and
+     *         only the statement is rolled back
+     * @throws PersistenceException if an unsupported lock call
+     *         is made
+     * @since Java Persistence 2.0
+     */
+    public void refresh(Object entity, LockModeType lockMode);
+
+    /**
+     * Refresh the state of the instance from the database, 
+     * overwriting changes made to the entity, if any, and 
+     * lock it with respect to given lock mode type and with
+     * specified properties.
+     * <p>If the lock mode type is pessimistic and the entity instance
+     * is found but cannot be locked:
+     * <ul>
+     * <li> the <code>PessimisticLockException</code> will be thrown if the database
+     *    locking failure causes transaction-level rollback
+     * <li> the <code>LockTimeoutException</code> will be thrown if the database
+     *    locking failure causes only statement-level rollback
+     * </ul>
+     * <p>If a vendor-specific property or hint is not recognized, 
+     *    it is silently ignored.  
+     * <p>Portable applications should not rely on the standard timeout
+     * hint. Depending on the database in use and the locking
+     * mechanisms used by the provider, the hint may or may not
+     * be observed.
+     * @param entity  entity instance
+     * @param lockMode  lock mode
+     * @param properties  standard and vendor-specific properties
+     *        and hints
+     * @throws IllegalArgumentException if the instance is not
+     *         an entity or the entity is not managed
+     * @throws TransactionRequiredException if invoked on a 
+     *         container-managed entity manager of type
+     *         <code>PersistenceContextType.TRANSACTION</code> when there is
+     *         no transaction; if invoked on an extended entity manager when
+     *         there is no transaction and a lock mode other than <code>NONE</code>
+     *         has been specified; or if invoked on an extended entity manager
+     *         that has not been joined to the current transaction and a
+     *         lock mode other than <code>NONE</code> has been specified
+     * @throws EntityNotFoundException if the entity no longer exists
+     *         in the database
+     * @throws PessimisticLockException if pessimistic locking fails
+     *         and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking fails and
+     *         only the statement is rolled back
+     * @throws PersistenceException if an unsupported lock call
+     *         is made
+     * @since Java Persistence 2.0
+     */
+    public void refresh(Object entity, LockModeType lockMode,
+                        Map<String, Object> properties);
+    
+    /**
+     * 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.
+     */
+    public void clear();
+
+    /**
+     * Remove the given entity from the persistence context, causing
+     * a managed entity to become detached.  Unflushed changes made 
+     * to the entity if any (including removal of the entity), 
+     * will not be synchronized to the database.  Entities which 
+     * previously referenced the detached entity will continue to
+     * reference it.
+     * @param entity  entity instance
+     * @throws IllegalArgumentException if the instance is not an 
+     *         entity 
+     * @since Java Persistence 2.0
+     */
+    public void detach(Object entity); 
+
+    /**
+     * Check if the instance is a managed entity instance belonging
+     * to the current persistence context.
+     * @param entity  entity instance
+     * @return boolean indicating if entity is in persistence context
+     * @throws IllegalArgumentException if not an entity
+     */    
+    public boolean contains(Object entity);
+
+    /**
+     * Get the current lock mode for the entity instance.
+     * @param entity  entity instance
+     * @return lock mode
+     * @throws TransactionRequiredException if there is no 
+     *         transaction or if the entity manager has not been
+     *         joined to the current transaction
+     * @throws IllegalArgumentException if the instance is not a
+     *         managed entity and a transaction is active
+     * @since Java Persistence 2.0
+     */
+    public LockModeType getLockMode(Object entity);
+
+    /** 
+     * Set an entity manager property or hint. 
+     * If a vendor-specific property or hint is not recognized, it is
+     * silently ignored. 
+     * @param propertyName name of property or hint
+     * @param value  value for property or hint
+     * @throws IllegalArgumentException if the second argument is 
+     *         not valid for the implementation 
+     * @since Java Persistence 2.0
+     */ 
+    public void setProperty(String propertyName, Object value);
+
+    /**
+     * Get the properties and hints and associated values that are in effect 
+     * for the entity manager. Changing the contents of the map does 
+     * not change the configuration in effect.
+     * @return map of properties and hints in effect for entity manager
+     * @since Java Persistence 2.0
+     */
+    public Map<String, Object> getProperties();
+
+    /**
+     * Create an instance of <code>Query</code> for executing a
+     * Java Persistence query language statement.
+     * @param qlString a Java Persistence query string
+     * @return the new query instance
+     * @throws IllegalArgumentException if the query string is
+     *         found to be invalid
+     */
+    public Query createQuery(String qlString);
+
+    /**
+     * Create an instance of <code>TypedQuery</code> for executing a
+     * criteria query.
+     * @param criteriaQuery  a criteria query object
+     * @return the new query instance
+     * @throws IllegalArgumentException if the criteria query is
+     *         found to be invalid
+     * @since Java Persistence 2.0
+     */
+    public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery); 
+
+    /**
+     * Create an instance of <code>Query</code> for executing a criteria
+     * update query.
+     * @param updateQuery  a criteria update query object
+     * @return the new query instance
+     * @throws IllegalArgumentException if the update query is
+     *         found to be invalid
+     * @since Java Persistence 2.1
+     */
+    public Query createQuery(CriteriaUpdate updateQuery);
+
+    /**
+     * Create an instance of <code>Query</code> for executing a criteria
+     * delete query.
+     * @param deleteQuery  a criteria delete query object
+     * @return the new query instance
+     * @throws IllegalArgumentException if the delete query is
+     *         found to be invalid
+     * @since Java Persistence 2.1
+     */
+    public Query createQuery(CriteriaDelete deleteQuery);
+
+    /**
+     * Create an instance of <code>TypedQuery</code> for executing a
+     * Java Persistence query language statement.
+     * The select list of the query must contain only a single
+     * item, which must be assignable to the type specified by
+     * the <code>resultClass</code> argument.
+     * @param qlString a Java Persistence query string
+     * @param resultClass the type of the query result
+     * @return the new query instance
+     * @throws IllegalArgumentException if the query string is found
+     *         to be invalid or if the query result is found to
+     *         not be assignable to the specified type
+     * @since Java Persistence 2.0
+     */
+    public <T> TypedQuery<T> createQuery(String qlString, Class<T> resultClass);
+
+    /**
+     * Create an instance of <code>Query</code> for executing a named query
+     * (in the Java Persistence query language or in native SQL).
+     * @param name the name of a query defined in metadata
+     * @return the new query instance
+     * @throws IllegalArgumentException if a query has not been
+     *         defined with the given name or if the query string is
+     *         found to be invalid
+     */
+    public Query createNamedQuery(String name);
+
+    /**
+     * Create an instance of <code>TypedQuery</code> for executing a
+     * Java Persistence query language named query.
+     * The select list of the query must contain only a single
+     * item, which must be assignable to the type specified by
+     * the <code>resultClass</code> argument.
+     * @param name the name of a query defined in metadata
+     * @param resultClass the type of the query result
+     * @return the new query instance
+     * @throws IllegalArgumentException if a query has not been
+     *         defined with the given name or if the query string is
+     *         found to be invalid or if the query result is found to
+     *         not be assignable to the specified type
+     * @since Java Persistence 2.0
+     */
+    public <T> TypedQuery<T> createNamedQuery(String name, Class<T> resultClass);
+
+    /**
+     * Create an instance of <code>Query</code> for executing
+     * a native SQL statement, e.g., for update or delete.
+     * If the query is not an update or delete query, query
+     * execution will result in each row of the SQL result
+     * being returned as a result of type Object[] (or a result
+     * of type Object if there is only one column in the select
+     * list.)  Column values are returned in the order of their
+     * appearance in the select list and default JDBC type
+     * mappings are applied.
+     * @param sqlString a native SQL query string
+     * @return the new query instance
+     */
+    public Query createNativeQuery(String sqlString);
+
+    /**
+     * Create an instance of <code>Query</code> 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
+     */
+    public Query createNativeQuery(String sqlString, Class resultClass);
+
+    /**
+     * Create an instance of <code>Query</code> 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
+     */
+    public Query createNativeQuery(String sqlString, String resultSetMapping);
+
+    /**
+     * Create an instance of <code>StoredProcedureQuery</code> for executing a
+     * stored procedure in the database.
+     * <p>Parameters must be registered before the stored procedure can
+     * be executed.
+     * <p>If the stored procedure returns one or more result sets,
+     * any result set will be returned as a list of type Object[].
+     * @param name name assigned to the stored procedure query
+     * in metadata
+     * @return the new stored procedure query instance
+     * @throws IllegalArgumentException if a query has not been
+     * defined with the given name
+     * @since Java Persistence 2.1
+     */
+    public StoredProcedureQuery createNamedStoredProcedureQuery(String name);
+
+    /**
+     * Create an instance of <code>StoredProcedureQuery</code> for executing a
+     * stored procedure in the database.
+     * <p>Parameters must be registered before the stored procedure can
+     * be executed.
+     * <p>If the stored procedure returns one or more result sets,
+     * any result set will be returned as a list of type Object[].
+     * @param procedureName name of the stored procedure in the
+     * database
+     * @return the new stored procedure query instance
+     * @throws IllegalArgumentException if a stored procedure of the
+     * given name does not exist (or the query execution will
+     * fail)
+     * @since Java Persistence 2.1
+     */
+    public StoredProcedureQuery createStoredProcedureQuery(String procedureName);
+
+    /**
+     * Create an instance of <code>StoredProcedureQuery</code> for executing a
+     * stored procedure in the database.
+     * <p>Parameters must be registered before the stored procedure can
+     * be executed.
+     * <p>The <code>resultClass</code> arguments must be specified in the order in
+     * which the result sets will be returned by the stored procedure
+     * invocation.
+     * @param procedureName name of the stored procedure in the
+     * database
+     * @param resultClasses classes to which the result sets
+     * produced by the stored procedure are to
+     * be mapped
+     * @return the new stored procedure query instance
+     * @throws IllegalArgumentException if a stored procedure of the
+     * given name does not exist (or the query execution will
+     * fail)
+     * @since Java Persistence 2.1
+     */
+    public StoredProcedureQuery createStoredProcedureQuery(
+	       String procedureName, Class... resultClasses);
+
+    /**
+     * Create an instance of <code>StoredProcedureQuery</code> for executing a
+     * stored procedure in the database.
+     * <p>Parameters must be registered before the stored procedure can
+     * be executed.
+     * <p>The <code>resultSetMapping</code> arguments must be specified in the order
+     * in which the result sets will be returned by the stored
+     * procedure invocation.
+     * @param procedureName name of the stored procedure in the
+     *        database
+     * @param resultSetMappings the names of the result set mappings
+     *        to be used in mapping result sets
+     *        returned by the stored procedure
+     * @return the new stored procedure query instance
+     * @throws IllegalArgumentException if a stored procedure or
+     *         result set mapping of the given name does not exist
+     *         (or the query execution will fail)
+     */
+    public StoredProcedureQuery createStoredProcedureQuery(
+              String procedureName, String... resultSetMappings);
+
+    /**
+     * Indicate to the entity manager that a JTA transaction is
+     * active and join the persistence context to it. 
+     * <p>This method should be called on a JTA application 
+     * managed entity manager that was created outside the scope
+     * of the active transaction or on an entity manager of type
+     * <code>SynchronizationType.UNSYNCHRONIZED</code> to associate
+     * it with the current JTA transaction.
+     * @throws TransactionRequiredException if there is
+     *         no transaction
+     */
+    public void joinTransaction();
+
+    /**
+     * Determine whether the entity manager is joined to the
+     * current transaction. Returns false if the entity manager
+     * is not joined to the current transaction or if no
+     * transaction is active
+     * @return boolean
+     * @since Java Persistence 2.1
+     */
+    public boolean isJoinedToTransaction();
+
+    /**
+     * Return an object of the specified type to allow access to the
+     * provider-specific API.   If the provider's <code>EntityManager</code>
+     * implementation does not support the specified class, the
+     * <code>PersistenceException</code> is thrown.
+     * @param cls  the class of the object to be returned.  This is
+     * normally either the underlying <code>EntityManager</code> implementation
+     * class or an interface that it implements.
+     * @return an instance of the specified class
+     * @throws PersistenceException if the provider does not 
+     *         support the call 
+     * @since Java Persistence 2.0
+     */
+    public <T> T unwrap(Class<T> cls); 
+
+    /**
+     * Return the underlying provider object for the <code>EntityManager</code>,
+     * if available. The result of this method is implementation
+     * specific. 
+     * <p>The <code>unwrap</code> method is to be preferred for new applications.
+     * @return underlying provider object for EntityManager
+     */
+    public Object getDelegate();
+
+    /**
+     * Close an application-managed entity manager. 
+     * After the close method has been invoked, all methods
+     * on the <code>EntityManager</code> instance and any 
+     * <code>Query</code>, <code>TypedQuery</code>, and
+     * <code>StoredProcedureQuery</code> objects obtained from 
+     * it will throw the <code>IllegalStateException</code>
+     * except for <code>getProperties</code>, 
+     * <code>getTransaction</code>, and <code>isOpen</code> (which will return false).
+     * If this method is called when the entity manager is
+     * joined to an active transaction, the persistence
+     * context remains managed until the transaction completes. 
+     * @throws IllegalStateException if the entity manager
+     *         is container-managed
+     */
+    public void close();
+
+    /**
+     * Determine whether the entity manager is open. 
+     * @return true until the entity manager has been closed
+     */
+    public boolean isOpen();
+
+    /**
+     * Return the resource-level <code>EntityTransaction</code> object. 
+     * The <code>EntityTransaction</code> instance may be used serially to 
+     * begin and commit multiple transactions.
+     * @return EntityTransaction instance
+     * @throws IllegalStateException if invoked on a JTA
+     *         entity manager
+     */
+    public EntityTransaction getTransaction();
+
+    /**
+     * Return the entity manager factory for the entity manager.
+     * @return EntityManagerFactory instance
+     * @throws IllegalStateException if the entity manager has 
+     *         been closed
+     * @since Java Persistence 2.0
+     */
+    public EntityManagerFactory getEntityManagerFactory();
+
+    /**
+     * Return an instance of <code>CriteriaBuilder</code> for the creation of
+     * <code>CriteriaQuery</code> objects.
+     * @return CriteriaBuilder instance
+     * @throws IllegalStateException if the entity manager has
+     *         been closed
+     * @since Java Persistence 2.0
+     */
+    public CriteriaBuilder getCriteriaBuilder();
+
+    /**
+     * Return an instance of <code>Metamodel</code> interface for access to the
+     * metamodel of the persistence unit.
+     * @return Metamodel instance
+     * @throws IllegalStateException if the entity manager has
+     *         been closed
+     * @since Java Persistence 2.0
+     */
+    public Metamodel getMetamodel();
+
+    /**
+     * Return a mutable EntityGraph that can be used to dynamically create an
+     * EntityGraph.
+     * @param rootType class of entity graph
+     * @return entity graph
+     * @since Java Persistence 2.1
+     */
+    public <T> EntityGraph<T> createEntityGraph(Class<T> rootType);
+
+    /**
+     * Return a mutable copy of the named EntityGraph.  If there
+     * is no entity graph with the specified name, null is returned.
+     * @param graphName name of an entity graph
+     * @return entity graph
+     * @since Java Persistence 2.1
+     */
+    public EntityGraph<?> createEntityGraph(String graphName);
+
+    /**
+     * Return a named EntityGraph. The returned EntityGraph 
+     * should be considered immutable.
+     * @param graphName  name of an existing entity graph
+     * @return named entity graph
+     * @throws IllegalArgumentException if there is no EntityGraph of
+     *         the given name
+     * @since Java Persistence 2.1
+     */
+    public  EntityGraph<?> getEntityGraph(String graphName);
+
+    /**
+     * Return all named EntityGraphs that have been defined for the provided
+     * class type.
+     * @param entityClass  entity class
+     * @return list of all entity graphs defined for the entity
+     * @throws IllegalArgumentException if the class is not an entity
+     * @since Java Persistence 2.1
+     */
+    public <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass);
+
+}
diff --git a/src/javax/persistence/EntityManagerFactory.java b/src/javax/persistence/EntityManagerFactory.java
new file mode 100644
index 0000000..a200d31
--- /dev/null
+++ b/src/javax/persistence/EntityManagerFactory.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.util.Map;
+import javax.persistence.metamodel.Metamodel;
+import javax.persistence.criteria.CriteriaBuilder;
+
+/**
+ * Interface used to interact with the entity manager factory
+ * for the persistence unit.
+ *
+ * <p>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
+ * <code>EntityManagerFactory</code> has been closed, all its entity managers
+ * are considered to be in the closed state.
+ *
+ * @since Java Persistence 1.0
+ */
+public interface EntityManagerFactory {
+
+    /**
+     * Create a new application-managed <code>EntityManager</code>.
+     * This method returns a new <code>EntityManager</code> instance each time
+     * it is invoked. 
+     * The <code>isOpen</code> method will return true on the returned instance.
+     * @return entity manager instance
+     * @throws IllegalStateException if the entity manager factory
+     * has been closed
+     */
+    public EntityManager createEntityManager();
+    
+    /**
+     * Create a new application-managed <code>EntityManager</code> with the 
+     * specified Map of properties. 
+     * This method returns a new <code>EntityManager</code> instance each time
+     * it is invoked. 
+     * The <code>isOpen</code> method will return true on the returned instance.
+     * @param map properties for entity manager
+     * @return entity manager instance
+     * @throws IllegalStateException if the entity manager factory
+     * has been closed
+     */
+    public EntityManager createEntityManager(Map map);
+
+    /**
+     * Create a new JTA application-managed <code>EntityManager</code> with the 
+     * specified synchronization type.
+     * This method returns a new <code>EntityManager</code> instance each time
+     * it is invoked. 
+     * The <code>isOpen</code> method will return true on the returned instance.
+     * @param synchronizationType  how and when the entity manager should be 
+     * synchronized with the current JTA transaction
+     * @return entity manager instance
+     * @throws IllegalStateException if the entity manager factory
+     * has been configured for resource-local entity managers or is closed
+     *
+     * @since Java Persistence 2.1
+     */
+    public EntityManager createEntityManager(SynchronizationType synchronizationType);
+
+    /**
+     * Create a new JTA application-managed <code>EntityManager</code> with the 
+     * specified synchronization type and map of properties. 
+     * This method returns a new <code>EntityManager</code> instance each time
+     * it is invoked. 
+     * The <code>isOpen</code> method will return true on the returned instance.
+     * @param synchronizationType  how and when the entity manager should be 
+     * synchronized with the current JTA transaction
+     * @param map properties for entity manager
+     * @return entity manager instance
+     * @throws IllegalStateException if the entity manager factory
+     * has been configured for resource-local entity managers or is closed
+     *
+     * @since Java Persistence 2.1
+     */
+    public EntityManager createEntityManager(SynchronizationType synchronizationType, Map map);
+
+    /**
+     * Return an instance of <code>CriteriaBuilder</code> for the creation of
+     * <code>CriteriaQuery</code> objects.
+     * @return CriteriaBuilder instance
+     * @throws IllegalStateException if the entity manager factory 
+     * has been closed
+     *
+     * @since Java Persistence 2.0
+     */
+    public CriteriaBuilder getCriteriaBuilder();
+    
+    /**
+     * Return an instance of <code>Metamodel</code> interface for access to the
+     * metamodel of the persistence unit.
+     * @return Metamodel instance
+     * @throws IllegalStateException if the entity manager factory
+     * has been closed
+     *
+     * @since Java Persistence 2.0
+     */
+    public Metamodel getMetamodel();
+
+    /**
+     * Indicates whether the factory is open. Returns true
+     * until the factory has been closed.
+     * @return boolean indicating whether the factory is open
+     */
+    public boolean isOpen();
+    
+    /**
+     * Close the factory, releasing any resources that it holds.
+     * After a factory instance has been closed, all methods invoked
+     * on it will throw the <code>IllegalStateException</code>, except
+     * for <code>isOpen</code>, which will return false. Once an
+     * <code>EntityManagerFactory</code> has been closed, all its
+     * entity managers are considered to be in the closed state.
+     * @throws IllegalStateException if the entity manager factory
+     * has been closed
+     */
+    public void close();
+
+    /**
+     * Get the properties and associated values that are in effect
+     * for the entity manager factory. Changing the contents of the
+     * map does not change the configuration in effect.
+     * @return properties
+     * @throws IllegalStateException if the entity manager factory 
+     * has been closed
+     *
+     * @since Java Persistence 2.0
+     */
+    public Map<String, Object> getProperties();
+
+    /**
+     * Access the cache that is associated with the entity manager 
+     * factory (the "second level cache").
+     * @return instance of the <code>Cache</code> interface or null if
+     * no cache is in use
+     * @throws IllegalStateException if the entity manager factory
+     * has been closed
+     *
+     * @since Java Persistence 2.0
+     */
+    public Cache getCache();
+
+    /**
+     * Return interface providing access to utility methods
+     * for the persistence unit.
+     * @return <code>PersistenceUnitUtil</code> interface
+     * @throws IllegalStateException if the entity manager factory
+     * has been closed
+     *
+     * @since Java Persistence 2.0
+     */
+    public PersistenceUnitUtil getPersistenceUnitUtil();
+
+    /**
+     * Define the query, typed query, or stored procedure query as
+     * a named query such that future query objects can be created
+     * from it using the <code>createNamedQuery</code> or
+     * <code>createNamedStoredProcedureQuery</code> method.
+     * <p>Any configuration of the query object (except for actual
+     * parameter binding) in effect when the named query is added
+     * is retained as part of the named query definition.
+     * This includes configuration information such as max results,
+     * hints, flush mode, lock mode, result set mapping information,
+     * and information about stored procedure parameters.
+     * <p>When the query is executed, information that can be set
+     * by means of the query APIs can be overridden. Information
+     * that is overridden does not affect the named query as
+     * registered with the entity manager factory, and thus does
+     * not affect subsequent query objects created from it by
+     * means of the <code>createNamedQuery</code> or
+     * <code>createNamedStoredProcedureQuery</code> method.
+     * <p>If a named query of the same name has been previously
+     * defined, either statically via metadata or via this method,
+     * that query definition is replaced.
+     *
+     * @param name name for the query
+     * @param query Query, TypedQuery, or StoredProcedureQuery object
+     *
+     * @since Java Persistence 2.1
+     */
+    public void addNamedQuery(String name, Query query);
+
+    /**
+     * Return an object of the specified type to allow access to the
+     * provider-specific API. If the provider's EntityManagerFactory
+     * implementation does not support the specified class, the
+     * PersistenceException is thrown.
+     * @param cls the class of the object to be returned. This is
+     * normally either the underlying EntityManagerFactory
+     * implementation class or an interface that it implements.
+     * @return an instance of the specified class
+     * @throws PersistenceException if the provider does not
+     * support the call
+     * @since Java Persistence 2.1
+     */
+    public <T> T unwrap(Class<T> cls);
+
+    /**
+     * Add a named copy of the EntityGraph to the
+     * EntityManagerFactory.  If an entity graph with the same name
+     * already exists, it is replaced.
+     * @param graphName  name for the entity graph
+     * @param entityGraph  entity graph
+     * @since Java Persistence 2.1
+     */
+    public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph);
+
+}
diff --git a/src/javax/persistence/EntityNotFoundException.java b/src/javax/persistence/EntityNotFoundException.java
new file mode 100644
index 0000000..21e5b35
--- /dev/null
+++ b/src/javax/persistence/EntityNotFoundException.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an entity reference obtained by
+ * {@link EntityManager#getReference EntityManager.getReference}
+ * is accessed but the entity does not exist. Thrown when
+ * {@link EntityManager#refresh EntityManager.refresh} is called and the
+ * object no longer exists in the database. 
+ * Thrown when {@link EntityManager#lock EntityManager.lock} is used with
+ * pessimistic locking is used and the entity no longer exists in the database.
+ * <p> The current transaction, if one is active and the persistence context
+ * has been joined to it, will be marked for rollback.
+ * 
+ * @see EntityManager#getReference(Class,Object)
+ * @see EntityManager#refresh(Object)
+ * @see EntityManager#refresh(Object, LockModeType)
+ * @see EntityManager#refresh(Object, java.util.Map)
+ * @see EntityManager#refresh(Object, LockModeType, java.util.Map)
+ * @see EntityManager#lock(Object, LockModeType)
+ * @see EntityManager#lock(Object, LockModeType, java.util.Map)
+ * 
+ * @since Java Persistence 1.0
+ */
+public class EntityNotFoundException extends PersistenceException {
+
+	/**
+	 * Constructs a new <code>EntityNotFoundException</code> exception with
+	 * <code>null</code> as its detail message.
+	 */
+	public EntityNotFoundException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new <code>EntityNotFoundException</code> exception with the
+	 * specified detail message.
+	 * 
+	 * @param message
+	 *            the detail message.
+	 */
+	public EntityNotFoundException(String message) {
+		super(message);
+	}
+
+}
diff --git a/src/javax/persistence/EntityResult.java b/src/javax/persistence/EntityResult.java
new file mode 100644
index 0000000..1e74264
--- /dev/null
+++ b/src/javax/persistence/EntityResult.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link SqlResultSetMapping} annotation to map the SELECT
+ * clause of a SQL query to an entity result.
+ *
+ * <p>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.
+ *
+ * <pre>
+ *   Example:
+ *
+ *   Query q = em.createNativeQuery(
+ *       "SELECT o.id, o.quantity, o.item, i.id, i.name, i.description "+
+ *           "FROM Order o, Item i " +
+ *           "WHERE (o.quantity > 25) AND (o.item = i.id)",
+ *       "OrderItemResults");
+ *   @SqlResultSetMapping(name="OrderItemResults",
+ *       entities={
+ *           @EntityResult(entityClass=com.acme.Order.class),
+ *           @EntityResult(entityClass=com.acme.Item.class)
+ *   })
+ * </pre>
+ *
+ * @see SqlResultSetMapping
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({}) 
+ at Retention(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 "";
+}
diff --git a/src/javax/persistence/EntityTransaction.java b/src/javax/persistence/EntityTransaction.java
new file mode 100644
index 0000000..d6c7833
--- /dev/null
+++ b/src/javax/persistence/EntityTransaction.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Interface used to control transactions on resource-local entity
+ * managers.  The {@link EntityManager#getTransaction
+ * EntityManager.getTransaction()} method returns the
+ * <code>EntityTransaction</code> interface.
+
+ *
+ * @since Java Persistence 1.0
+ */
+public interface EntityTransaction {
+
+     /**
+      * Start a resource transaction. 
+      * @throws IllegalStateException if <code>isActive()</code> is true
+      */
+     public void begin();
+
+     /**
+      * Commit the current resource transaction, writing any 
+      * unflushed changes to the database.  
+      * @throws IllegalStateException if <code>isActive()</code> is false
+      * @throws RollbackException if the commit fails
+      */
+     public void commit();
+
+     /**
+      * Roll back the current resource transaction. 
+      * @throws IllegalStateException if <code>isActive()</code> is false
+      * @throws PersistenceException if an unexpected error 
+      *         condition is encountered
+      */
+     public void rollback();
+
+     /**
+      * Mark the current resource transaction so that the only 
+      * possible outcome of the transaction is for the transaction 
+      * to be rolled back. 
+      * @throws IllegalStateException if <code>isActive()</code> is false
+      */
+     public void setRollbackOnly();
+
+     /**
+      * Determine whether the current resource transaction has been 
+      * marked for rollback.
+      * @return boolean indicating whether the transaction has been
+      *         marked for rollback
+      * @throws IllegalStateException if <code>isActive()</code> is false
+      */
+     public boolean getRollbackOnly();
+
+     /**
+      * Indicate whether a resource transaction is in progress.
+      * @return boolean indicating whether transaction is
+      *         in progress
+      * @throws PersistenceException if an unexpected error 
+      *         condition is encountered
+      */
+     public boolean isActive();
+}
diff --git a/src/javax/persistence/EnumType.java b/src/javax/persistence/EnumType.java
new file mode 100644
index 0000000..ff0c873
--- /dev/null
+++ b/src/javax/persistence/EnumType.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Defines mapping for enumerated types.  The constants of this
+ * enumerated type specify how a persistent property or
+ * field of an enumerated type should be persisted.
+ * 
+ * @since Java Persistence 1.0
+ */
+public enum EnumType {
+    /** Persist enumerated type property or field as an integer. */
+    ORDINAL,
+
+    /** Persist enumerated type property or field as a string. */
+    STRING
+}
diff --git a/src/javax/persistence/Enumerated.java b/src/javax/persistence/Enumerated.java
new file mode 100644
index 0000000..ad8c4ca
--- /dev/null
+++ b/src/javax/persistence/Enumerated.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.EnumType.ORDINAL;
+
+/**
+ * Specifies that a persistent property or field should be persisted
+ * as a enumerated type.  The <code>Enumerated</code> annotation may
+ * be used in conjunction with the <code>Basic</code> annotation, or in
+ * conjunction with the <code>ElementCollection</code> annotation when the
+ * element collection value is of basic type.  If the enumerated type
+ * is not specified or the <code>Enumerated</code> annotation is not
+ * used, the <code>EnumType</code> value is assumed to be <code>ORDINAL<code>.
+ *
+ * <pre>
+ *   Example:
+ *
+ *   public enum EmployeeStatus {FULL_TIME, PART_TIME, CONTRACT}
+ *
+ *   public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}
+ *
+ *   @Entity public class Employee {
+ *       public EmployeeStatus getStatus() {...}
+ *       ...
+ *       @Enumerated(STRING)
+ *       public SalaryRate getPayScale() {...}
+ *       ...
+ *   }
+ * </pre>
+ *
+ * @see Basic
+ * @see ElementCollection
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface Enumerated {
+
+    /** (Optional) The type used in mapping an enum type. */
+    EnumType value() default ORDINAL;
+}
diff --git a/src/javax/persistence/ExcludeDefaultListeners.java b/src/javax/persistence/ExcludeDefaultListeners.java
new file mode 100644
index 0000000..9404728
--- /dev/null
+++ b/src/javax/persistence/ExcludeDefaultListeners.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the invocation of default listeners is 
+ * to be excluded for the entity class (or mapped superclass) 
+ * and its subclasses.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface ExcludeDefaultListeners {
+}
diff --git a/src/javax/persistence/ExcludeSuperclassListeners.java b/src/javax/persistence/ExcludeSuperclassListeners.java
new file mode 100644
index 0000000..e95e939
--- /dev/null
+++ b/src/javax/persistence/ExcludeSuperclassListeners.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the invocation of superclass listeners is 
+ * to be excluded for the entity class (or mapped superclass) 
+ * and its subclasses.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+
+public @interface ExcludeSuperclassListeners {
+}
diff --git a/src/javax/persistence/FetchType.java b/src/javax/persistence/FetchType.java
new file mode 100644
index 0000000..0efc1cc
--- /dev/null
+++ b/src/javax/persistence/FetchType.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Defines strategies for fetching data from the database.
+ * The <code>EAGER</code> strategy is a requirement on the persistence 
+ * provider runtime that data must be eagerly fetched. The 
+ * <code>LAZY</code> 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 <code>LAZY</code> strategy hint has been 
+ * specified. 
+ *
+ * <pre>
+ *   Example:
+ *   @Basic(fetch=LAZY)
+ *   protected String getName() { return name; }
+ * </pre>
+ *
+ * @see Basic
+ * @see ElementCollection
+ * @see ManyToMany
+ * @see OneToMany
+ * @see ManyToOne
+ * @see OneToOne
+ * @since Java Persistence 1.0
+ */
+public enum FetchType {
+
+    /** Defines that data can be lazily fetched. */
+    LAZY,
+
+    /** Defines that data must be eagerly fetched. */
+    EAGER
+}
diff --git a/src/javax/persistence/FieldResult.java b/src/javax/persistence/FieldResult.java
new file mode 100644
index 0000000..7aae6bc
--- /dev/null
+++ b/src/javax/persistence/FieldResult.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link EntityResult} annotation to map columns specified 
+ * in the SELECT list of a SQL query to the properties or fields of an entity class.
+ *
+ * <pre>
+ *
+ * Example:
+ *   Query q = em.createNativeQuery(
+ *       "SELECT o.id AS order_id, " +
+ *           "o.quantity AS order_quantity, " +
+ *           "o.item AS order_item, " +
+ *         "FROM Order o, Item i " +
+ *         "WHERE (order_quantity > 25) AND (order_item = i.id)",
+ *       "OrderResults");
+ *
+ *   @SqlResultSetMapping(name="OrderResults",
+ *       entities={
+ *           @EntityResult(entityClass=com.acme.Order.class, fields={
+ *               @FieldResult(name="id", column="order_id"),
+ *               @FieldResult(name="quantity", column="order_quantity"),
+ *               @FieldResult(name="item", column="order_item")})
+ *       })
+ * </pre>
+ *
+ * @see EntityResult
+ * @see SqlResultSetMapping
+ * @since Java Persistence 1.0
+ */
+ at Target({}) 
+ at Retention(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();
+}
diff --git a/src/javax/persistence/FlushModeType.java b/src/javax/persistence/FlushModeType.java
new file mode 100644
index 0000000..d521c10
--- /dev/null
+++ b/src/javax/persistence/FlushModeType.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Flush mode setting.
+ *
+ * <p> When queries are executed within a transaction, if
+ * <code>FlushModeType.AUTO</code> is set on the {@link
+ * javax.persistence.Query Query} or {@link javax.persistence.TypedQuery
+ * TypedQuery} object, or if the flush mode setting for the
+ * persistence context is <code>AUTO</code> (the default) and a flush
+ * mode setting has not been specified for the <code>Query</code> or
+ * <code>TypedQuery</code> 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. 
+ * <p> If <code>FlushModeType.COMMIT</code> is set, the effect of
+ * updates made to entities in the persistence context upon queries is
+ * unspecified.
+ *
+ * <p> If there is no transaction active or the persistence context is not
+ * joined to the current transaction, the persistence provider must not flush 
+ * to the database.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum FlushModeType {
+
+    /** Flushing to occur at transaction commit.  The provider may flush
+     *  at other times, but is not required to.
+     */
+   COMMIT,
+
+    /** (Default) Flushing to occur at query execution. */
+   AUTO
+}
diff --git a/src/javax/persistence/ForeignKey.java b/src/javax/persistence/ForeignKey.java
new file mode 100644
index 0000000..c0294a8
--- /dev/null
+++ b/src/javax/persistence/ForeignKey.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static javax.persistence.ConstraintMode.CONSTRAINT;
+
+/**
+ * Used to specify the handling of foreign key constraints when schema
+ * generation is in effect.  If this annotation is not specified, the
+ * persistence provider's default foreign key strategy will be used.
+ * <p>
+ * The <code>ConstraintMode</code> value is used to specify whether foreign
+ * key constraints should be generated.
+ * <p>
+ * The syntax used in the <code>foreignKeyDefinition</code> element 
+ * should follow the SQL syntax used by the target database for foreign
+ * key constraints.  For example, this may be similar the following:
+ * <p>
+ * <pre>
+ * FOREIGN KEY ( <COLUMN expression> {, <COLUMN expression>}... )
+ * REFERENCES <TABLE identifier> [
+ *     (<COLUMN expression> {, <COLUMN expression>}... ) ]
+ * [ ON UPDATE <referential action> ]
+ * [ ON DELETE <referential action> ]
+ * </pre>
+ *
+ * When the <code>ConstraintMode</code> value is
+ * <code>CONSTRAINT</code>, but the <code>foreignKeyDefinition</code>
+ * element is not specified, the provider will generate foreign key
+ * constraints whose update and delete actions it determines most
+ * appropriate for the join column(s) to which the foreign key
+ * annotation is applied.
+ *
+ * @see JoinColumn
+ * @see JoinColumns
+ * @see MapKeyJoinColumn
+ * @see MapKeyJoinColumns
+ * @see PrimaryKeyJoinColumn
+ * @see JoinTable
+ * @see CollectionTable
+ * @see SecondaryTable
+ * @see AssociationOverride
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({})
+ at Retention(RUNTIME)
+public @interface ForeignKey {
+
+    /**
+     * (Optional) The name of the foreign key constraint.  If this
+     * is not specified, it defaults to a provider-generated name.
+     */
+    String name() default "";
+
+    /**
+     * (Optional) Used to specify whether a foreign key constraint should be
+     *  generated when schema generation is in effect. 
+     *  <p>
+     *  A value of <code>CONSTRAINT</code> will cause the persistence
+     *  provider to generate a foreign key constraint.  If the
+     *  <code>foreignKeyDefinition</code> element is not specified, the
+     *  provider will generate a constraint whose update
+     *  and delete actions it determines most appropriate for the
+     *  join column(s) to which the foreign key annotation is applied.
+     *  <p>
+     *  A value of <code>NO_CONSTRAINT</code> will result in no
+     *  constraint being generated.
+     *  <p>
+     *  A value of <code>PROVIDER_DEFAULT</code> will result in the
+     *  provider's default behavior (which may or may not result
+     *  in the generation of a constraint for the given join column(s).
+     */
+    ConstraintMode value() default CONSTRAINT;
+
+    /**
+     * (Optional) The foreign key constraint definition.  
+     */
+    String foreignKeyDefinition() default "";
+}
diff --git a/src/javax/persistence/GeneratedValue.java b/src/javax/persistence/GeneratedValue.java
new file mode 100644
index 0000000..9c90d80
--- /dev/null
+++ b/src/javax/persistence/GeneratedValue.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.GenerationType.AUTO;
+
+/**
+ * Provides for the specification of generation strategies for the
+ * values of primary keys. 
+ *
+ * <p> The <code>GeneratedValue</code> annotation
+ * may be applied to a primary key property or field of an entity or
+ * mapped superclass in conjunction with the {@link Id} annotation.
+ * The use of the <code>GeneratedValue</code> annotation is only
+ * required to be supported for simple primary keys.  Use of the
+ * <code>GeneratedValue</code> annotation is not supported for derived
+ * primary keys.
+ *
+ * <pre>
+ *
+ *     Example 1:
+ *
+ *     @Id
+ *     @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
+ *     @Column(name="CUST_ID")
+ *     public Long getId() { return id; }
+ *
+ *     Example 2:
+ *
+ *     @Id
+ *     @GeneratedValue(strategy=TABLE, generator="CUST_GEN")
+ *     @Column(name="CUST_ID")
+ *     Long id;
+ * </pre>
+ *
+ * @see Id
+ * @see TableGenerator
+ * @see SequenceGenerator
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface GeneratedValue {
+
+    /**
+     * (Optional) The primary key generation strategy
+     * that the persistence provider must use to
+     * generate the annotated entity primary key.
+     */
+    GenerationType strategy() default AUTO;
+
+    /**
+     * (Optional) The name of the primary key generator
+     * to use as specified in the {@link SequenceGenerator} 
+     * or {@link TableGenerator} annotation.
+     * <p> Defaults to the id generator supplied by persistence provider.
+     */
+    String generator() default "";
+}
diff --git a/src/javax/persistence/GenerationType.java b/src/javax/persistence/GenerationType.java
new file mode 100644
index 0000000..9d1980e
--- /dev/null
+++ b/src/javax/persistence/GenerationType.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/** 
+ * Defines the types of primary key generation strategies. 
+ *
+ * @see GeneratedValue
+ *
+ * @since Java Persistence 1.0
+ */
+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 a database sequence.
+     */
+    SEQUENCE, 
+
+    /**
+     * Indicates that the persistence provider must assign 
+     * primary keys for the entity using a database identity column.
+     */
+    IDENTITY, 
+
+    /**
+     * Indicates that the persistence provider should pick an 
+     * appropriate strategy for the particular database. The 
+     * <code>AUTO</code> 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
+}
diff --git a/src/javax/persistence/Id.java b/src/javax/persistence/Id.java
new file mode 100644
index 0000000..a201843
--- /dev/null
+++ b/src/javax/persistence/Id.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the primary key of an entity.
+ * The field or property to which the <code>Id</code> annotation is applied 
+ * should be one of the following types: any Java primitive type; 
+ * any primitive wrapper type; 
+ * <code>String</code>; 
+ * <code>java.util.Date</code>; 
+ * <code>java.sql.Date</code>; 
+ * <code>java.math.BigDecimal</code>;
+ * <code>java.math.BigInteger</code>.
+ *
+ * <p>The mapped column for the primary key of the entity is assumed 
+ * to be the primary key of the primary table. If no <code>Column</code> annotation 
+ * is specified, the primary key column name is assumed to be the name 
+ * of the primary key property or field.
+ *
+ * <pre>
+ *   Example:
+ *
+ *   @Id
+ *   public Long getId() { return id; }
+ * </pre>
+ *
+ * @see Column
+ * @see GeneratedValue
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface Id {}
diff --git a/src/javax/persistence/IdClass.java b/src/javax/persistence/IdClass.java
new file mode 100644
index 0000000..8bfab22
--- /dev/null
+++ b/src/javax/persistence/IdClass.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+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.  
+ *
+ * <p> 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.
+ *
+ * <pre>
+ *
+ *   Example:
+ *
+ *   @IdClass(com.acme.EmployeePK.class)
+ *   @Entity
+ *   public class Employee {
+ *      @Id String empName;
+ *      @Id Date birthDay;
+ *      ...
+ *   }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE})
+ at Retention(RUNTIME)
+
+public @interface IdClass {
+
+    /** Primary key class */
+    Class value();
+}
diff --git a/src/javax/persistence/Index.java b/src/javax/persistence/Index.java
new file mode 100644
index 0000000..5899a03
--- /dev/null
+++ b/src/javax/persistence/Index.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used in schema generation to specify creation of an index.
+ * <p>
+ * Note that it is not necessary to specify an index for a primary key,
+ * as the primary key index will be created automatically.
+ *
+ * <p> 
+ * The syntax of the <code>columnList</code> element is a 
+ * <code>column_list</code>, as follows:
+ * 
+ * <pre>
+ *    column::= index_column [,index_column]*
+ *    index_column::= column_name [ASC | DESC]
+ * </pre>
+ * 
+ * <p> If <code>ASC</code> or <code>DESC</code> is not specified, 
+ * <code>ASC</code> (ascending order) is assumed.
+ *
+ * @see Table
+ * @see SecondaryTable
+ * @see CollectionTable
+ * @see JoinTable
+ * @see TableGenerator
+ *
+ * @since Java Persistence 2.1
+ *
+ */
+ at Target({})
+ at Retention(RUNTIME)
+public @interface Index {
+
+    /**
+     * (Optional) The name of the index; defaults to a provider-generated name.
+     */
+    String name() default "";
+
+    /**
+     * (Required) The names of the columns to be included in the index, 
+     * in order.
+     */
+    String columnList();
+
+    /**
+     * (Optional) Whether the index is unique.
+     */
+    boolean unique() default false;
+
+}
diff --git a/src/javax/persistence/Inheritance.java b/src/javax/persistence/Inheritance.java
new file mode 100644
index 0000000..fe44c5e
--- /dev/null
+++ b/src/javax/persistence/Inheritance.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.InheritanceType.SINGLE_TABLE;
+
+/**
+ * Specifies 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.  If the <code>Inheritance</code> annotation is not
+ * specified or if no inheritance type is specified for an entity
+ * class hierarchy, the <code>SINGLE_TABLE<code> mapping strategy is used.
+ *
+ * <pre>
+ *
+ *   Example:
+ *
+ *   @Entity
+ *   @Inheritance(strategy=JOINED)
+ *   public class Customer { ... }
+ *
+ *   @Entity
+ *   public class ValuedCustomer extends Customer { ... }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE})
+ at Retention(RUNTIME)
+
+public @interface Inheritance {
+
+    /** The strategy to be used for the entity inheritance hierarchy. */
+    InheritanceType strategy() default SINGLE_TABLE;
+}
diff --git a/src/javax/persistence/InheritanceType.java b/src/javax/persistence/InheritanceType.java
new file mode 100644
index 0000000..dcb10cd
--- /dev/null
+++ b/src/javax/persistence/InheritanceType.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Defines inheritance strategy options.
+ *
+ * @since Java Persistence 1.0
+ */
+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 
+}
diff --git a/src/javax/persistence/JoinColumn.java b/src/javax/persistence/JoinColumn.java
new file mode 100644
index 0000000..74a2552
--- /dev/null
+++ b/src/javax/persistence/JoinColumn.java
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a column for joining an entity association or element
+ * collection.  If the <code>JoinColumn</code> annotation itself is
+ * defaulted, a single join column is assumed and the default values
+ * apply.
+ *
+ * <pre>
+ *   Example:
+ *
+ *   @ManyToOne
+ *   @JoinColumn(name="ADDR_ID")
+ *   public Address getAddress() { return address; }
+ *
+ *
+ *   Example: unidirectional one-to-many association using a foreign key mapping
+ * 
+ *   // In Customer class
+ *   @OneToMany
+ *   @JoinColumn(name="CUST_ID") // join column is in table for Order
+ *   public Set<Order> getOrders() {return orders;}
+ * </pre>
+ *
+ * @see ManyToOne
+ * @see OneToMany
+ * @see OneToOne
+ * @see JoinTable
+ * @see CollectionTable
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface JoinColumn {
+
+    /** 
+     * (Optional) The name of the foreign key column.
+     * The table in which it is found depends upon the
+     * context. 
+     * <ul>
+     * <li>If the join is for a OneToOne or ManyToOne
+     *  mapping using a foreign key mapping strategy, 
+     * the foreign key column is in the table of the
+     * source entity or embeddable. 
+     * <li> If the join is for a unidirectional OneToMany mapping
+     * using a foreign key mapping strategy, the foreign key is in the
+     * table of the target entity.  
+     * <li> If the join is for a ManyToMany mapping or for a OneToOne
+     * or bidirectional ManyToOne/OneToMany mapping using a join
+     * table, the foreign key is in a join table.  
+     * <li> If the join is for an element collection, the foreign 
+     * key is in a collection table.
+     *</ul>
+     *
+     * <p> 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 or embeddable class; "_"; the name of the referenced 
+     * primary key column. 
+     * If there is no such referencing relationship property or 
+     * field in the entity, or if the join is for an element collection,
+     * 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 "";
+
+    /**
+     * (Optional) The name of the column referenced by this foreign
+     * key column. 
+     * <ul>
+     * <li> When used with entity relationship mappings other
+     * than the cases described here, the referenced column is in the
+     * table of the target entity. 
+     * <li> When used with a unidirectional OneToMany foreign key
+     * mapping, the referenced column is in the table of the source
+     * entity.  
+     * <li> When used inside a <code>JoinTable</code> 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.  
+     * <li> When used in a <code>CollectionTable</code> mapping, the
+     * referenced column is in the table of the entity containing the
+     * collection.
+     * </ul>
+     *
+     * <p> 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 "";
+
+    /**
+     * (Optional) Whether the property is a unique key.  This is a
+     * shortcut for the <code>UniqueConstraint</code> 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;
+
+    /** (Optional) Whether the foreign key column is nullable. */
+    boolean nullable() default true;
+
+    /**
+     * (Optional) Whether the column is included in
+     * SQL INSERT statements generated by the persistence
+     * provider.
+     */
+    boolean insertable() default true;
+
+    /**
+     * (Optional) Whether the column is included in
+     * SQL UPDATE statements generated by the persistence
+     * provider.
+     */
+    boolean updatable() default true;
+
+    /**
+     * (Optional) The SQL fragment that is used when
+     * generating the DDL for the column.
+     * <p> Defaults to the generated SQL for the column.
+     */
+    String columnDefinition() default "";
+
+    /**
+     * (Optional) 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.
+     *
+     * <p> Default: 
+     * <ul>
+     * <li> If the join is for a OneToOne or ManyToOne mapping
+     * using a foreign key mapping strategy, the name of the table of
+     * the source entity or embeddable. 
+     * <li> If the join is for a unidirectional OneToMany mapping 
+     * using a foreign key mapping strategy, the name of the table of
+     * the target entity. 
+     * <li> If the join is for a ManyToMany mapping or
+     * for a OneToOne or bidirectional ManyToOne/OneToMany mapping
+     * using a join table, the name of the join table. 
+     * <li> If the join is for an element collection, the name of the collection table.
+     * </ul>
+     */
+    String table() default "";
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *  foreign key constraint when table generation is in effect.  If
+     *  this element is not specified, the persistence provider's
+     *  default foreign key strategy will apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/src/javax/persistence/JoinColumns.java b/src/javax/persistence/JoinColumns.java
new file mode 100644
index 0000000..0766c80
--- /dev/null
+++ b/src/javax/persistence/JoinColumns.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies the mapping for composite foreign keys. This annotation 
+ * groups <code>JoinColumn</code> annotations for the same relationship.
+ *
+ * <p> When the <code>JoinColumns</code> annotation is used, 
+ * both the <code>name</code> and the <code>referencedColumnName</code> elements 
+ * must be specified in each such <code>JoinColumn</code> annotation.
+ *
+ * <pre>
+ *
+ *    Example:
+ *    @ManyToOne
+ *    @JoinColumns({
+ *        @JoinColumn(name="ADDR_ID", referencedColumnName="ID"),
+ *        @JoinColumn(name="ADDR_ZIP", referencedColumnName="ZIP")
+ *    })
+ *    public Address getAddress() { return address; }
+ * </pre>
+ *
+ * @see JoinColumn
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface JoinColumns {
+
+    /**
+     * The join columns that map the relationship.
+     */
+    JoinColumn[] value();
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *  foreign key constraint when table generation is in effect. 
+     *  If both this element and the <code>foreignKey</code> element 
+     *  of any of the <code>JoinColumn</code> elements are specified, 
+     *  the behavior is undefined.  If no foreign key annotation element
+     *  is specified in either location, the persistence provider's
+     *  default foreign key strategy will apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/src/javax/persistence/JoinTable.java b/src/javax/persistence/JoinTable.java
new file mode 100644
index 0000000..eae9566
--- /dev/null
+++ b/src/javax/persistence/JoinTable.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies the mapping of associations. It is applied to the
+ * owning side of an association.  
+ *
+ * <p> A join table is typically used in the mapping of many-to-many
+ * and unidirectional one-to-many associations. It may also be used to
+ * map bidirectional many-to-one/one-to-many associations,
+ * unidirectional many-to-one relationships, and one-to-one
+ * associations (both bidirectional and unidirectional).
+ *
+ *<p>When a join table is used in mapping a relationship with an
+ *embeddable class on the owning side of the relationship, the
+ *containing entity rather than the embeddable class is considered the
+ *owner of the relationship.
+ *
+ * <p> If the <code>JoinTable</code> 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.
+ *
+ * <pre>
+ *
+ *    Example:
+ *
+ *    @JoinTable(
+ *        name="CUST_PHONE",
+ *        joinColumns=
+ *            @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
+ *        inverseJoinColumns=
+ *            @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
+ *    )
+ * </pre>
+ * 
+ * @see JoinColumn
+ * @see JoinColumns
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface JoinTable {
+
+    /**
+     * (Optional) The name of the join table. 
+     * 
+     * <p> Defaults to the concatenated names of
+     * the two associated primary entity tables, 
+     * separated by an underscore.
+     */
+    String name() default "";
+
+    /** (Optional) The catalog of the table. 
+     * <p> Defaults to the default catalog.
+     */
+    String catalog() default "";
+
+    /** (Optional) The schema of the table. 
+     * <p> Defaults to the default schema for user.
+     */
+    String schema() default "";
+
+    /**
+     * (Optional) 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).
+     *
+     * <p> Uses the same defaults as for {@link JoinColumn}.
+     */
+    JoinColumn[] joinColumns() default {};
+
+    /** 
+     * (Optional) 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).
+     *
+     * <p> Uses the same defaults as for {@link JoinColumn}.
+     */
+    JoinColumn[] inverseJoinColumns() default {};
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *   foreign key constraint for the columns corresponding to the
+     *   <code>joinColumns</code> element when table generation is in
+     *   effect.  If both this element and the <code>foreignKey</code>
+     *   element of any of the <code>joinColumns</code> elements are
+     *   specified, the behavior is undefined.  If no foreign key
+     *   annotation element is specified in either location, the
+     *   persistence provider's default foreign key strategy will
+     *   apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *  foreign key constraint for the columns corresponding to the
+     *  <code>inverseJoinColumns</code> element when table generation
+     *  is in effect.  If both this element and the
+     *  <code>foreignKey</code> element of any of the
+     *  <code>inverseJoinColumns</code> elements are specified, the
+     *  behavior is undefined.  If no foreign key annotation element
+     *  is specified in either location, the persistence provider's
+     *  default foreign key strategy will apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey inverseForeignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    /**
+     * (Optional) Unique constraints that are
+     * to be placed on the table. These are
+     * only used if table generation is in effect.
+     * <p> Defaults to no additional constraints.
+     */
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    /**
+     * (Optional) Indexes for the table.  These are only used if
+     * table generation is in effect. 
+     *
+     * @since Java Persistence 2.1 
+     */
+    Index[] indexes() default {};
+}
diff --git a/src/javax/persistence/Lob.java b/src/javax/persistence/Lob.java
new file mode 100644
index 0000000..d1680b8
--- /dev/null
+++ b/src/javax/persistence/Lob.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that a persistent property or field should be persisted
+ * as a large object to a database-supported large object type.
+ *
+ * <p> Portable applications should use the <code>Lob</code> annotation
+ * when mapping to a database Lob type.  The <code>Lob</code>
+ * annotation may be used in conjunction with the {@link Basic}
+ * annotation or the {@link ElementCollection} annotation when the
+ * element collection value is of basic type. A <code>Lob</code> may
+ * be either a binary or character type.
+ *
+ * <p> The <code>Lob</code> type is inferred from the type of the 
+ * persistent field or property, and except for string and 
+ * character-based types defaults to Blob.
+ * <pre>
+ *
+ *   Example 1:
+ *
+ *   @Lob @Basic(fetch=LAZY)
+ *   @Column(name="REPORT")
+ *   protected String report;
+ *
+ *   Example 2:
+ *
+ *   @Lob @Basic(fetch=LAZY)
+ *   @Column(name="EMP_PIC", columnDefinition="BLOB NOT NULL")
+ *   protected byte[] pic;
+ *
+ * </pre>
+ *
+ * @see Basic
+ * @see ElementCollection
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface Lob {
+}
diff --git a/src/javax/persistence/LockModeType.java b/src/javax/persistence/LockModeType.java
new file mode 100644
index 0000000..622efec
--- /dev/null
+++ b/src/javax/persistence/LockModeType.java
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Lock modes can be specified by means of passing a <code>LockModeType</code>
+ * argument to one of the {@link javax.persistence.EntityManager} methods that take locks
+ * (<code>lock</code>, <code>find</code>, or <code>refresh</code>) or
+ * to the {@link Query#setLockMode Query.setLockMode()} or
+ * {@link TypedQuery#setLockMode TypedQuery.setLockMode()} method.
+ * 
+ * <p> Lock modes can be used to specify either optimistic or pessimistic locks.
+ *
+ * <p> Optimistic locks are specified using {@link
+ * LockModeType#OPTIMISTIC LockModeType.OPTIMISTIC} and {@link
+ * LockModeType#OPTIMISTIC_FORCE_INCREMENT
+ * LockModeType.OPTIMISTIC_FORCE_INCREMENT}.  The lock mode type
+ * values {@link LockModeType#READ LockModeType.READ} and 
+ * {@link LockModeType#WRITE LockModeType.WRITE} are
+ * synonyms of <code>OPTIMISTIC</code> and
+ * <code>OPTIMISTIC_FORCE_INCREMENT</code> respectively.  The latter
+ * are to be preferred for new applications.
+ *
+ * <p> The semantics of requesting locks of type
+ * <code>LockModeType.OPTIMISTIC</code> and
+ * <code>LockModeType.OPTIMISTIC_FORCE_INCREMENT</code> are the
+ * following.
+ *
+ * <p> If transaction T1 calls for a lock of type 
+ * <code>LockModeType.OPTIMISTIC</code> on a versioned object, 
+ * the entity manager must ensure that neither of the following 
+ * phenomena can occur:
+ * <ul>
+ *   <li> 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.
+ *   <li>
+ *   </li> 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.
+ *   </li>
+ * </ul>
+ *
+ * <p> Lock modes must always prevent the phenomena P1 and P2.
+ *
+ * <p> In addition, calling a lock of type 
+ * <code>LockModeType.OPTIMISTIC_FORCE_INCREMENT</code> on a versioned object,
+ * will also force an update (increment) to the entity's version
+ * column.
+ *
+ * <p> The persistence implementation is not required to support
+ * the use of optimistic lock modes on non-versioned objects. When it
+ * cannot support a such lock call, it must throw the {@link
+ * PersistenceException}.
+ *
+ * <p>The lock modes {@link LockModeType#PESSIMISTIC_READ
+ * LockModeType.PESSIMISTIC_READ}, {@link
+ * LockModeType#PESSIMISTIC_WRITE LockModeType.PESSIMISTIC_WRITE}, and
+ * {@link LockModeType#PESSIMISTIC_FORCE_INCREMENT
+ * LockModeType.PESSIMISTIC_FORCE_INCREMENT} are used to immediately
+ * obtain long-term database locks.
+ *
+ * <p> The semantics of requesting locks of type
+ * <code>LockModeType.PESSIMISTIC_READ</code>, <code>LockModeType.PESSIMISTIC_WRITE</code>, and
+ * <code>LockModeType.PESSIMISTIC_FORCE_INCREMENT</code> are the following.  
+ *
+ * <p> If transaction T1 calls for a lock of type
+ * <code>LockModeType.PESSIMISTIC_READ</code> or
+ * <code>LockModeType.PESSIMISTIC_WRITE</code> on an object, the entity
+ * manager must ensure that neither of the following phenomena can
+ * occur: 
+ * <ul> 
+ * <li> 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.
+ *
+ * <li> P2 (Non-repeatable read): Transaction T1 reads a row. Another
+ * transaction T2 then modifies or deletes that row, before T1 has
+ * committed or rolled back.
+ * </ul>
+ *
+ * <p> A lock with <code>LockModeType.PESSIMISTIC_WRITE</code> can be obtained on
+ * an entity instance to force serialization among transactions
+ * attempting to update the entity data. A lock with
+ * <code>LockModeType.PESSIMISTIC_READ</code> can be used to query data using
+ * repeatable-read semantics without the need to reread the data at
+ * the end of the transaction to obtain a lock, and without blocking
+ * other transactions reading the data. A lock with
+ * <code>LockModeType.PESSIMISTIC_WRITE</code> can be used when querying data and
+ * there is a high likelihood of deadlock or update failure among
+ * concurrent updating transactions.
+ * 
+ * <p> The persistence implementation must support use of locks of type
+ * <code>LockModeType.PESSIMISTIC_READ</code> 
+ * <code>LockModeType.PESSIMISTIC_WRITE</code> on a non-versioned entity as well as
+ * on a versioned entity.
+ *
+ * <p> When the lock cannot be obtained, and the database locking
+ * failure results in transaction-level rollback, the provider must
+ * throw the {@link PessimisticLockException} and ensure that the JTA
+ * transaction or <code>EntityTransaction</code> has been marked for rollback.
+ * 
+ * <p> When the lock cannot be obtained, and the database locking
+ * failure results in only statement-level rollback, the provider must
+ * throw the {@link LockTimeoutException} (and must not mark the transaction
+ * for rollback).
+ *
+ * @since Java Persistence 1.0
+ *
+ */
+public enum LockModeType
+{
+    /**
+     *  Synonymous with <code>OPTIMISTIC</code>.
+     *  <code>OPTIMISTIC</code> is to be preferred for new
+     *  applications.
+     *
+     */
+    READ,
+
+    /**
+     *  Synonymous with <code>OPTIMISTIC_FORCE_INCREMENT</code>.
+     *  <code>OPTIMISTIC_FORCE_IMCREMENT</code> is to be preferred for new
+     *  applications.
+     *
+     */
+    WRITE,
+
+    /**
+     * Optimistic lock.
+     *
+     * @since Java Persistence 2.0
+     */
+    OPTIMISTIC,
+
+    /**
+     * Optimistic lock, with version update.
+     *
+     * @since Java Persistence 2.0
+     */
+    OPTIMISTIC_FORCE_INCREMENT,
+
+    /**
+     *
+     * Pessimistic read lock.
+     *
+     * @since Java Persistence 2.0
+     */
+    PESSIMISTIC_READ,
+
+    /**
+     * Pessimistic write lock.
+     *
+     * @since Java Persistence 2.0
+     */
+    PESSIMISTIC_WRITE,
+
+    /**
+     * Pessimistic write lock, with version update.
+     *
+     * @since Java Persistence 2.0
+     */
+    PESSIMISTIC_FORCE_INCREMENT,
+
+    /**
+     * No lock.
+     *
+     * @since Java Persistence 2.0
+     */
+    NONE
+}
diff --git a/src/javax/persistence/LockTimeoutException.java b/src/javax/persistence/LockTimeoutException.java
new file mode 100644
index 0000000..50d4f24
--- /dev/null
+++ b/src/javax/persistence/LockTimeoutException.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an pessimistic locking
+ * conflict occurs that does not result in transaction rollback. This
+ * exception may be thrown as part of an API call, at, flush or at
+ * commit time. The current transaction, if one is active, will be not
+ * be marked for rollback.
+ *
+ * @since Java Persistence 2.0
+ */
+public class LockTimeoutException extends PersistenceException {
+    /** The object that caused the exception */
+    Object entity;
+
+    /** 
+     * Constructs a new <code>LockTimeoutException</code> exception 
+     * with <code>null</code> as its detail message.
+     */
+    public LockTimeoutException() {
+        super();
+    }
+
+    /** 
+     * Constructs a new <code>LockTimeoutException</code> exception 
+     * with the specified detail message.
+     * @param   message   the detail message.
+     */
+    public LockTimeoutException(String message) {
+        super(message);
+    }
+
+    /** 
+     * Constructs a new <code>LockTimeoutException</code> exception 
+     * with the specified detail message and cause.
+     * @param   message   the detail message.
+     * @param   cause     the cause.
+     */
+    public LockTimeoutException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /** 
+     * Constructs a new <code>LockTimeoutException</code> exception 
+     * with the specified cause.
+     * @param   cause     the cause.
+     */
+    public LockTimeoutException(Throwable cause) {
+        super(cause);
+    }
+
+    /** 
+     * Constructs a new <code>LockTimeoutException</code> exception 
+     * with the specified object.
+     * @param   entity     the entity.
+     */
+    public LockTimeoutException(Object entity) {
+        this.entity = entity;
+    }
+
+    /** 
+     * Constructs a new <code>LockTimeoutException</code> exception 
+     * with the specified detail message, cause, and entity.
+     * @param   message   the detail message.
+     * @param   cause     the cause.
+     * @param   entity     the entity.
+     */
+    public LockTimeoutException(String message, Throwable cause, Object entity) {
+        super(message, cause);
+        this.entity = entity;
+    }
+    
+    /**
+     * Returns the object that caused this exception.
+     * @return the entity
+     */
+    public Object getObject() {
+        return this.entity;
+    }
+}
+
+
diff --git a/src/javax/persistence/ManyToMany.java b/src/javax/persistence/ManyToMany.java
new file mode 100644
index 0000000..31aa29b
--- /dev/null
+++ b/src/javax/persistence/ManyToMany.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+/**
+ * Specifies a many-valued association with many-to-many multiplicity. 
+ *
+ * <p> 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.  If the relationship is
+ * bidirectional, the non-owning side must use the <code>mappedBy</code> element of
+ * the <code>ManyToMany</code> annotation to specify the relationship field or
+ * property of the owning side.
+ *
+ * <p> The join table for the relationship, if not defaulted, is
+ * specified on the owning side.
+ *
+ * <p> The <code>ManyToMany</code> annotation may be used within an
+ * embeddable class contained within an entity class to specify a
+ * relationship to a collection of entities. If the relationship is
+ * bidirectional and the entity containing the embeddable class is the
+ * owner of the relationship, the non-owning side must use the
+ * <code>mappedBy</code> element of the <code>ManyToMany</code>
+ * annotation to specify the relationship field or property of the
+ * embeddable class. The dot (".") notation syntax must be used in the
+ * <code>mappedBy</code> element to indicate the relationship
+ * attribute within the embedded attribute.  The value of each
+ * identifier used with the dot notation is the name of the respective
+ * embedded field or property.
+ *
+ * <pre>
+ *
+ *    Example 1:
+ *
+ *    // In Customer class:
+ *
+ *    @ManyToMany
+ *    @JoinTable(name="CUST_PHONES")
+ *    public Set<PhoneNumber> getPhones() { return phones; }
+ *
+ *    // In PhoneNumber class:
+ *
+ *    @ManyToMany(mappedBy="phones")
+ *    public Set<Customer> getCustomers() { return customers; }
+ *
+ *    Example 2:
+ *
+ *    // In Customer class:
+ *
+ *    @ManyToMany(targetEntity=com.acme.PhoneNumber.class)
+ *    public Set getPhones() { return phones; }
+ *
+ *    // In PhoneNumber class:
+ *
+ *    @ManyToMany(targetEntity=com.acme.Customer.class, mappedBy="phones")
+ *    public Set getCustomers() { return customers; }
+ *
+ *    Example 3:
+ *
+ *    // In Customer class:
+ *
+ *    @ManyToMany
+ *    @JoinTable(name="CUST_PHONE",
+ *        joinColumns=
+ *            @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
+ *        inverseJoinColumns=
+ *            @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
+ *        )
+ *    public Set<PhoneNumber> getPhones() { return phones; }
+ *
+ *    // In PhoneNumberClass:
+ *
+ *    @ManyToMany(mappedBy="phones")
+ *    public Set<Customer> getCustomers() { return customers; }
+ * </pre>
+ *
+ * @see JoinTable
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface ManyToMany {
+
+    /**
+     * (Optional) The entity class that is the target of the
+     * association. Optional only if the collection-valued
+     * relationship property is defined using Java generics.  Must be
+     * specified otherwise.
+     *
+     * <p> Defaults to the parameterized type of
+     * the collection when defined using generics.
+     */
+    Class targetEntity() default void.class;
+
+    /** 
+     * (Optional) The operations that must be cascaded to the target
+     * of the association.  
+     *
+     * <p> When the target collection is a {@link java.util.Map
+     * java.util.Map}, the <code>cascade</code> element applies to the
+     * map value.
+     *
+     * <p> Defaults to no operations being cascaded.
+     */
+    CascadeType[] cascade() default {};
+
+    /** (Optional) 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 entities
+     * 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 "";
+}
diff --git a/src/javax/persistence/ManyToOne.java b/src/javax/persistence/ManyToOne.java
new file mode 100644
index 0000000..1d6ef67
--- /dev/null
+++ b/src/javax/persistence/ManyToOne.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+/**
+ * Specifies 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.  If the
+ * relationship is bidirectional, the non-owning
+ * <code>OneToMany</code> entity side must used the
+ * <code>mappedBy</code> element to specify the relationship field or
+ * property of the entity that is the owner of the relationship.
+ *
+ * <p> The <code>ManyToOne</code> annotation may be used within an
+ * embeddable class to specify a relationship from the embeddable
+ * class to an entity class. If the relationship is bidirectional, the
+ * non-owning <code>OneToMany</code> entity side must use the <code>mappedBy</code>
+ * element of the <code>OneToMany</code> annotation to specify the
+ * relationship field or property of the embeddable field or property
+ * on the owning side of the relationship. The dot (".") notation
+ * syntax must be used in the <code>mappedBy</code> element to indicate the
+ * relationship attribute within the embedded attribute.  The value of
+ * each identifier used with the dot notation is the name of the
+ * respective embedded field or property.
+ * <pre>
+ *
+ *     Example 1:
+ *
+ *     @ManyToOne(optional=false) 
+ *     @JoinColumn(name="CUST_ID", nullable=false, updatable=false)
+ *     public Customer getCustomer() { return customer; }
+ *
+ *
+ *     Example 2:
+ * 
+ *     @Entity
+ *        public class Employee {
+ *        @Id int id;
+ *        @Embedded JobInfo jobInfo;
+ *        ...
+ *     }
+ *
+ *     @Embeddable
+ *        public class JobInfo {
+ *        String jobDescription; 
+ *        @ManyToOne ProgramManager pm; // Bidirectional
+ *     }
+ *
+ *     @Entity
+ *        public class ProgramManager {
+ *        @Id int id;
+ *        @OneToMany(mappedBy="jobInfo.pm")
+ *        Collection<Employee> manages;
+ *     }
+ *
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface ManyToOne {
+
+    /** 
+     * (Optional) The entity class that is the target of 
+     * the association. 
+     *
+     * <p> Defaults to the type of the field or property 
+     * that stores the association. 
+     */
+    Class targetEntity() default void.class;
+
+    /**
+     * (Optional) The operations that must be cascaded to 
+     * the target of the association.
+     *
+     * <p> By default no operations are cascaded.
+     */
+    CascadeType[] cascade() default {};
+
+    /** 
+     * (Optional) 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;
+
+    /** 
+     * (Optional) Whether the association is optional. If set 
+     * to false then a non-null relationship must always exist.
+     */
+    boolean optional() default true;
+}
diff --git a/src/javax/persistence/MapKey.java b/src/javax/persistence/MapKey.java
new file mode 100644
index 0000000..46c3d1e
--- /dev/null
+++ b/src/javax/persistence/MapKey.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the map key for associations of type 
+ * {@link java.util.Map java.util.Map} when the map key is itself the primary
+ * key or a persistent field or property of the entity that is
+ * the value of the map.
+ * 
+ * <p> 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.
+ *
+ * <p> The {@link MapKeyClass} annotation is not used when
+ * <code>MapKey</code> is specified and vice versa.
+ *
+ * <pre>
+ *
+ *    Example 1:
+ *
+ *    @Entity
+ *    public class Department {
+ *        ...
+ *        @OneToMany(mappedBy="department")
+ *        @MapKey  // map key is primary key
+ *        public Map<Integer, Employee> getEmployees() {... }
+ *        ...
+ *    }
+ *
+ *    @Entity
+ *    public class Employee {
+ *        ...
+ *        @Id Integer getEmpId() { ... }
+ *        @ManyToOne
+ *        @JoinColumn(name="dept_id")
+ *        public Department getDepartment() { ... }
+ *        ...
+ *    }
+ *
+ *    Example 2:
+ *
+ *    @Entity
+ *        public class Department {
+ *        ...
+ *        @OneToMany(mappedBy="department")
+ *        @MapKey(name="name")
+ *        public Map<String, Employee> getEmployees() {... }
+ *        ...
+ *    }
+ *
+ *    @Entity
+ *        public class Employee {
+ *        @Id public Integer getEmpId() { ... }
+ *        ...
+ *        @ManyToOne
+ *        @JoinColumn(name="dept_id")
+ *        public Department getDepartment() { ... }
+ *        ...
+ *    }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface MapKey {
+
+    /**
+     * (Optional) The name of the persistent field or property of the 
+     * associated entity that is used as the map key. 
+     * <p> Default: If the 
+     * <code>name</code> 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 <code>IdClass</code>, an instance of the primary key 
+     * class is used as the key.
+     */
+    String name() default "";
+}
diff --git a/src/javax/persistence/MapKeyClass.java b/src/javax/persistence/MapKeyClass.java
new file mode 100644
index 0000000..2365188
--- /dev/null
+++ b/src/javax/persistence/MapKeyClass.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the type of the map key for associations of type
+ * <code>java.util.Map</code>.  The map key can be a basic type, an
+ * embeddable class, or an entity. If the map is specified using Java
+ * generics, the <code>MapKeyClass</code> annotation and associated
+ * type need not be specified; otherwise they must be specified.
+ * 
+ * <p> The <code>MapKeyClass</code> annotation is used in conjunction
+ * with <code>ElementCollection</code> or one of the collection-valued
+ * relationship annotations (<code>OneToMany</code> or <code>ManyToMany</code>).
+ * The <code>MapKey</code> annotation is not used when
+ * <code>MapKeyClass</code> is specified and vice versa.
+ *
+ * <pre>
+ *
+ *    Example 1:
+ *
+ *    @Entity
+ *    public class Item {
+ *       @Id int id;
+ *       ...
+ *       @ElementCollection(targetClass=String.class)
+ *       @MapKeyClass(String.class)
+ *       Map images;  // map from image name to image filename
+ *       ...
+ *    }
+ *
+ *    Example 2:
+ *
+ *    // MapKeyClass and target type of relationship can be defaulted
+ *
+ *    @Entity
+ *    public class Item {
+ *       @Id int id;
+ *       ...
+ *       @ElementCollection
+ *       Map<String, String> images; 
+ *        ...
+ *     }
+ *
+ *     Example 3:
+ *
+ *     @Entity
+ *     public class Company {
+ *        @Id int id;
+ *        ...
+ *        @OneToMany(targetEntity=com.example.VicePresident.class)
+ *        @MapKeyClass(com.example.Division.class)
+ *        Map organization;
+ *     }
+ *
+ *     Example 4:
+ *
+ *     // MapKeyClass and target type of relationship are defaulted
+ *
+ *     @Entity
+ *     public class Company {
+ *        @Id int id;
+ *        ...
+ *        @OneToMany
+ *        Map<Division, VicePresident> organization;
+ *     }
+ *
+ * </pre>
+ * @see ElementCollection 
+ * @see OneToMany
+ * @see ManyToMany
+ * @since Java Persistence 2.0
+ */
+
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface MapKeyClass {
+	/**(Required) The type of the map key.*/
+	Class value();
+}
diff --git a/src/javax/persistence/MapKeyColumn.java b/src/javax/persistence/MapKeyColumn.java
new file mode 100644
index 0000000..d00ccd9
--- /dev/null
+++ b/src/javax/persistence/MapKeyColumn.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the mapping for the key column of a map whose
+ * map key is a basic type. If the <code>name</code> element is not specified, it
+ * defaults to the concatenation of the following: the name of the
+ * referencing relationship field or property; "_"; "KEY".
+ * 
+ * <pre>
+ *    Example:
+ *
+ *    @Entity
+ *    public class Item {
+ *       @Id int id;
+ *       ...
+ *       @ElementCollection
+ *       @MapKeyColumn(name="IMAGE_NAME")
+ *       @Column(name="IMAGE_FILENAME")
+ *       @CollectionTable(name="IMAGE_MAPPING")
+ *       Map<String, String> images;  // map from image name to filename
+ *       ...
+ *    } 
+ * </pre>
+ * @since Java Persistence 2.0
+ */
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface MapKeyColumn {
+
+	/**
+	 * (Optional) The name of the map key column. The table in which it is found
+	 * depends upon the context. If the map key is for an element collection,
+	 * the map key column is in the collection table for the map value. If the
+	 * map key is for a ManyToMany entity relationship or for a OneToMany entity
+	 * relationship using a join table, the map key column is in a join table.
+	 * If the map key is for a OneToMany entity relationship using a foreign key
+	 * mapping strategy, the map key column is in the table of the entity that
+	 * is the value of the map.
+         * <p> Defaults to the concatenation of the following: the name of
+         * the referencing relationship field or property; "_"; "<code>KEY</code>".
+	 */
+	String name() default "";
+
+	/**
+	 * (Optional) Whether the column is a unique key. This is a
+	 * shortcut for the <code>UniqueConstraint</code> annotation
+	 * at the table level and is useful for when the unique key
+	 * constraint corresponds to only a single column. 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;
+
+	/** (Optional) Whether the database column is nullable. */
+	boolean nullable() default false;
+
+	/**
+	 * (Optional) Whether the column is included in SQL INSERT statements
+	 * generated by the persistence provider.
+	 */
+	boolean insertable() default true;
+
+	/**
+	 * (Optional) Whether the column is included in SQL UPDATE statements
+	 * generated by the persistence provider.
+	 */
+	boolean updatable() default true;
+
+	/**
+	 * (Optional) The SQL fragment that is used when generating the DDL for the
+	 * column.
+	 * <p> Defaults to the generated SQL to create a
+	 * column of the inferred type.
+         *
+	 */
+	String columnDefinition() default "";
+
+	/** (Optional) The name of the table that contains the column. 
+         *
+         * <p> Defaults: If the map key is for an element collection,
+         * the name of the collection table for the map value. If the
+         * map key is for a OneToMany or ManyToMany entity
+         * relationship using a join table, the name of the join table
+         * for the map. If the map key is for a OneToMany entity
+         * relationship using a foreign key mapping strategy, the name
+         * of the primary table of the entity that is the value of the
+         * map.
+         */
+	String table() default "";
+
+	/**
+	 * (Optional) The column length. (Applies only if a string-valued column is
+	 * used.)
+	 */
+	int length() default 255;
+
+	/**
+	 * (Optional) The precision for a decimal (exact numeric) column. (Applies
+	 * only if a decimal column is used.)  
+         *
+         *<p> Default: 0. (The value must be set by the developer.)
+	 */
+	int precision() default 0; // decimal precision
+
+	/**
+	 * (Optional) The scale for a decimal (exact numeric) column. (Applies only
+	 * if a decimal column is used.)
+	 */
+	int scale() default 0; // decimal scale
+}
diff --git a/src/javax/persistence/MapKeyEnumerated.java b/src/javax/persistence/MapKeyEnumerated.java
new file mode 100644
index 0000000..53d99cb
--- /dev/null
+++ b/src/javax/persistence/MapKeyEnumerated.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.EnumType.ORDINAL;
+
+/**
+ * Specifies the enum type for a map key whose basic type is an enumerated type.
+ * 
+ * The <code>MapKeyEnumerated</code> annotation can be applied to an 
+ * element collection or relationship of type <code>java.util.Map</code>, in 
+ * conjunction with the <code>ElementCollection</code>, <code>OneToMany</code>, or 
+ * <code>ManyToMany</code> annotation.
+ * If the enumerated type is not specified or the <code>MapKeyEnumerated</code>
+ * annotation is not used, the enumerated type is assumed to be
+ * <code>ORDINAL</code>.
+ *
+ * <pre>
+ *   Example:
+ *
+ *   public enum ProjectStatus {COMPLETE, DELAYED, CANCELLED, IN_PROGRESS}
+ *
+ *   public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}
+ *
+ *   @Entity public class Employee {
+ *       @ManyToMany
+ *       public Projects<ProjectStatus, Project> getProjects() {...}
+ *       
+ *       @OneToMany
+ *       @MapKeyEnumerated(STRING)
+ *       public Map<SalaryRate, Employee> getEmployees() {...}
+ *       ...
+ *   }
+ * </pre>
+ *
+ * @see ElementCollection
+ * @see OneToMany
+ * @see ManyToMany
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface MapKeyEnumerated {
+    
+    /** (Optional) The type used in mapping a map key enum type. */
+    EnumType value() default ORDINAL;
+}
diff --git a/src/javax/persistence/MapKeyJoinColumn.java b/src/javax/persistence/MapKeyJoinColumn.java
new file mode 100644
index 0000000..ca4e62d
--- /dev/null
+++ b/src/javax/persistence/MapKeyJoinColumn.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a mapping to an entity that is a map key. The map key
+ * join column is in the collection table, join table, or table of the
+ * target entity that is used to represent the map.  If no
+ * <code>MapKeyJoinColumn</code> annotation is specified, a single
+ * join column is assumed and the default values apply.
+ *
+ * <pre>
+ *
+ *    Example 1:
+ *
+ *    @Entity
+ *    public class Company {
+ *       @Id int id;
+ *       ...
+ *       @OneToMany   // unidirectional
+ *       @JoinTable(name="COMPANY_ORGANIZATION",
+ *                  joinColumns=@JoinColumn(name="COMPANY"),
+ *                  inverseJoinColumns=@JoinColumn(name="VICEPRESIDENT"))
+ *       @MapKeyJoinColumn(name="DIVISION")
+ *       Map<Division, VicePresident> organization;
+ *    }
+ *
+ *    Example 2:
+ *
+ *    @Entity
+ *    public class VideoStore {
+ *       @Id int id;
+ *       String name;
+ *       Address location;
+ *       ...
+ *       @ElementCollection
+ *       @CollectionTable(name="INVENTORY",
+ *                        joinColumns=@JoinColumn(name="STORE"))
+ *       @Column(name="COPIES_IN_STOCK")
+ *       @MapKeyJoinColumn(name="MOVIE", referencedColumnName="ID")
+ *       Map<Movie, Integer> videoInventory;
+ *       ...
+ *     }
+ *
+ *     @Entity
+ *     public class Movie {
+ *        @Id long id;
+ *        String title;
+ *        ...
+ *     }
+ *
+ *     Example 3:
+ *
+ *     @Entity
+ *     public class Student {
+ *        @Id int studentId;
+ *        ...
+ *        @ManyToMany  // students and courses are also many-many
+ *        @JoinTable(name="ENROLLMENTS",
+ *                   joinColumns=@JoinColumn(name="STUDENT"),
+ *                   inverseJoinColumns=@JoinColumn(name="SEMESTER"))
+ *        @MapKeyJoinColumn(name="COURSE")
+ *        Map<Course, Semester>  enrollment;
+ *        ...
+ *     }
+ * </pre>
+ *
+ * @see ForeignKey
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface MapKeyJoinColumn {
+	/**
+	 * (Optional) The name of the foreign key column for the map
+	 * key. The table in which it is found depends upon the
+	 * context.  
+         * <ul> 
+         * <li> If the join is for a map key for an
+	 * element collection, the foreign key column is in the
+	 * collection table for the map value.  
+         * <li> If the join is  for a map key for a ManyToMany entity
+         * relationship or for a  OneToMany entity relationship 
+         * using a join table, the foreign key column is in a join table. 
+         * <li> If the join is for a  OneToMany entity relationship using 
+         * a foreign key mapping strategy, the foreign key column for the 
+         * map key is in the table of the entity that is the value of the map.
+         * </ul>
+         *
+         * <p> 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 or embeddable class; "_"; "KEY".
+	 */
+	String name() default "";
+
+	/**
+	 * (Optional) The name of the column referenced by this foreign key column.
+	 * The referenced column is in the table of the target entity.
+         *
+         * <p> 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 "";
+
+	/**
+	 * (Optional) Whether the property is a unique key. This is a
+	 * shortcut for the <code>UniqueConstraint</code> annotation
+	 * at the table level and is useful for when the unique key
+	 * constraint is only a single field.
+	 */
+	boolean unique() default false;
+
+	/**
+	 * (Optional) Whether the foreign key column is nullable.
+	 */
+	boolean nullable() default false;
+
+	/**
+	 * (Optional) Whether the column is included in SQL INSERT statements
+	 * generated by the persistence provider.
+	 */
+	boolean insertable() default true;
+
+	/**
+	 * (Optional) Whether the column is included in SQL UPDATE statements
+	 * generated by the persistence provider.
+	 */
+	boolean updatable() default true;
+
+	/**
+	 * (Optional) The SQL fragment that is used when generating the DDL for the
+	 * column.
+         *  Defaults to SQL generated by the provider for the column.
+	 */
+	String columnDefinition() default "";
+
+	/**
+	 * (Optional) The name of the table that contains the foreign key column. 
+         * <ul>
+         * <li> If the join is for a map key for an element collection, the foreign key
+	 * column is in the collection table for the map value. 
+         * <li> If the join is for a map key for a ManyToMany entity relationship 
+         * or for a OneToMany entity relationship using a join table, 
+         * the foreign key column is in a join table.
+	 * <li> If the join is for a OneToMany entity relationship using a foreign
+	 * key mapping strategy, the foreign key column for the map key is in the
+	 * table of the entity that is the value of the map.
+         * </ul>
+         * <p> Default: 
+         * <ul>
+         * <li> If the map is for an element collection, the
+         * name of the collection table for the map value.
+         * <li> If the map is for a OneToMany or ManyToMany entity relationship 
+         * using a join table, the name of the join table for the map. 
+         * <li> If the map is for a OneToMany entity relationship using a
+         * foreign key mapping strategy, the name of the primary table
+         * of the entity that is the value of the map.
+         * </ul>
+	 */
+	String table() default "";
+
+        /**
+         *  (Optional) Used to specify or control the generation of a
+         *  foreign key constraint when table generation is in effect.  If
+         *  this element is not specified, the persistence provider's
+         *  default foreign key strategy will apply.
+         *
+         *  @since Java Persistence 2.1
+         */
+        ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/src/javax/persistence/MapKeyJoinColumns.java b/src/javax/persistence/MapKeyJoinColumns.java
new file mode 100644
index 0000000..357adfe
--- /dev/null
+++ b/src/javax/persistence/MapKeyJoinColumns.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Supports composite map keys that reference entities.  
+ * <p> The <code>MapKeyJoinColumns</code> annotation groups
+ * <code>MapKeyJoinColumn</code> annotations.  When the
+ * <code>MapKeyJoinColumns</code> annotation is used, both the
+ * <code>name</code> and the <code>referencedColumnName</code>
+ * elements must be specified in each of the grouped
+ * <code>MapKeyJoinColumn</code> annotations.
+ * 
+ * @see MapKeyJoinColumn
+ * @see ForeignKey
+ * 
+ * @since Java Persistence 2.0
+ */
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface MapKeyJoinColumns {
+	/**
+	 * (Required) The map key join columns that are used to map to the entity
+	 * that is the map key.
+	 */
+	MapKeyJoinColumn[] value();
+
+        /**
+         *  (Optional) Used to specify or control the generation of a
+         *  foreign key constraint when table generation is in effect.
+         *  If both this element and the <code>foreignKey</code>
+         *  element of any of the <code>MapKeyJoinColumn</code>
+         *  elements are specified, the behavior is undefined.  If no
+         *  foreign key annotation element is specified in either
+         *  location, the persistence provider's default foreign key
+         *  strategy will apply.
+         *
+         *  @since Java Persistence 2.1
+         */
+        ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/src/javax/persistence/MapKeyTemporal.java b/src/javax/persistence/MapKeyTemporal.java
new file mode 100644
index 0000000..151c072
--- /dev/null
+++ b/src/javax/persistence/MapKeyTemporal.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation must be specified for persistent map keys of type 
+ * {@link java.util.Date} and {@link java.util.Calendar}. It may only be 
+ * specified for map keys of these types.
+ * 
+ * <p> The <code>MapKeyTemporal</code> annotation can be applied to an
+ * element collection or relationship of type <code>java.util.Map</code>
+ * in conjunction with the <code>ElementCollection</code>,
+ * <code>OneToMany</code>, or <code>ManyToMany</code> annotation.
+ *
+ * <pre>
+ *     Example:
+ * 
+ *     @OneToMany
+ *     @MapKeyTemporal(DATE)
+ *     protected java.util.Map<java.util.Date, Employee> employees;
+ * </pre>
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface MapKeyTemporal {
+
+    /** (Required) The type used in mapping
+     * <code>java.util.Date</code> or
+     * <code>java.util.Calendar</code>. 
+     */
+    TemporalType value();
+}
+
diff --git a/src/javax/persistence/MappedSuperclass.java b/src/javax/persistence/MappedSuperclass.java
new file mode 100644
index 0000000..b82c7e9
--- /dev/null
+++ b/src/javax/persistence/MappedSuperclass.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 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.  
+ *
+ * <p> A class designated with the <code>MappedSuperclass</code> 
+ * 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 <code>AttributeOverride</code> and 
+ * <code>AssociationOverride</code> annotations or corresponding XML elements.
+ *
+ * <pre>
+ *    Example: Concrete class as a mapped superclass
+ *
+ *    @MappedSuperclass
+ *    public class Employee {
+ *    
+ *        @Id protected Integer empId;
+ *        @Version protected Integer version;
+ *        @ManyToOne @JoinColumn(name="ADDR")
+ *        protected Address address;
+ *    
+ *        public Integer getEmpId() { ... }
+ *        public void setEmpId(Integer id) { ... }
+ *        public Address getAddress() { ... }
+ *        public void setAddress(Address addr) { ... }
+ *    }
+ *    
+ *    // Default table is FTEMPLOYEE table
+ *    @Entity
+ *    public class FTEmployee extends Employee {
+ *    
+ *        // Inherited empId field mapped to FTEMPLOYEE.EMPID
+ *        // Inherited version field mapped to FTEMPLOYEE.VERSION
+ *        // Inherited address field mapped to FTEMPLOYEE.ADDR fk
+ *    
+ *        // Defaults to FTEMPLOYEE.SALARY
+ *        protected Integer salary;
+ *    
+ *        public FTEmployee() {}
+ *    
+ *        public Integer getSalary() { ... }
+ *    
+ *        public void setSalary(Integer salary) { ... }
+ *    }
+ *    
+ *    @Entity @Table(name="PT_EMP")
+ *    @AssociationOverride(
+ *        name="address", 
+ *        joincolumns=@JoinColumn(name="ADDR_ID"))
+ *    public class PartTimeEmployee extends Employee {
+ *    
+ *        // Inherited empId field mapped to PT_EMP.EMPID
+ *        // Inherited version field mapped to PT_EMP.VERSION
+ *        // address field mapping overridden to PT_EMP.ADDR_ID fk
+ *        @Column(name="WAGE")
+ *        protected Float hourlyWage;
+ *    
+ *        public PartTimeEmployee() {}
+ *    
+ *        public Float getHourlyWage() { ... }
+ *        public void setHourlyWage(Float wage) { ... }
+ *    }
+ * </pre>
+ *
+ * @see AttributeOverride 
+ * @see AssociationOverride
+ * @since Java Persistence 1.0
+ */
+ at Documented
+ at Target({TYPE})
+ at Retention(RUNTIME)
+public @interface MappedSuperclass {
+}
diff --git a/src/javax/persistence/MapsId.java b/src/javax/persistence/MapsId.java
new file mode 100644
index 0000000..b7d778a
--- /dev/null
+++ b/src/javax/persistence/MapsId.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Designates a <code>ManyToOne</code> or
+ * <code>OneToOne</code> relationship attribute that provides the
+ * mapping for an {@link EmbeddedId} primary key, an attribute within
+ * an <code>EmbeddedId</code> primary key, or a simple primary key of
+ * the parent entity. The <code>value</code> element specifies the
+ * attribute within a composite key to which the relationship
+ * attribute corresponds. If the entity's primary key is of the same
+ * Java type as the primary key of the entity referenced by the
+ * relationship, the value attribute is not specified.
+ * 
+ * <pre>
+ *    Example:
+ *
+ *    // parent entity has simple primary key
+ *
+ *    @Entity
+ *    public class Employee {
+ *       @Id long empId;
+ *       String name;
+ *       ...
+ *    } 
+ *
+ *    // dependent entity uses EmbeddedId for composite key
+ *
+ *    @Embeddable
+ *    public class DependentId {
+ *       String name;
+ *       long empid;   // corresponds to primary key type of Employee
+ *    }
+ *
+ *    @Entity
+ *    public class Dependent {
+ *       @EmbeddedId DependentId id;
+ *        ...
+ *       @MapsId("empid")  //  maps the empid attribute of embedded id
+ *       @ManyToOne Employee emp;
+ *    }
+ * </pre>
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface MapsId {
+
+    /**
+     * (Optional) The name of the attribute within the composite key
+     * to which the relationship attribute corresponds.  If not
+     * supplied, the relationship maps the entity's primary
+     * key.
+     */
+   String value() default ""; }
diff --git a/src/javax/persistence/NamedAttributeNode.java b/src/javax/persistence/NamedAttributeNode.java
new file mode 100644
index 0000000..eb4e862
--- /dev/null
+++ b/src/javax/persistence/NamedAttributeNode.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * A <code>NamedAttributeNode</code> is a member element of a
+ * <code>NamedEntityGraph</code>.
+ *
+ * @see NamedEntityGraph
+ * @see NamedSubgraph
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({})
+ at Retention(RUNTIME)
+public @interface NamedAttributeNode {
+
+    /**
+     * (Required) The name of the attribute that must be included in the graph.
+     */
+    String value();
+
+    /**
+     * (Optional) If the attribute references a managed type that has
+     * its own AttributeNodes, this element is used to refer to that
+     * NamedSubgraph definition.  
+     * If the target type has inheritance, multiple subgraphs can
+     * be specified.  These additional subgraphs are intended to add
+     * subclass-specific attributes.  Superclass subgraph entries will
+     * be merged into subclass subgraphs.  
+     *
+     * <p> The value of this element is the name of the subgraph as
+     * specified by the <code>name</code> element of the corresponding
+     * <code>NamedSubgraph</code> element.  If multiple subgraphs are
+     * specified due to inheritance, they are referenced by this name.
+     */
+    String subgraph() default "";
+
+   /**
+    * (Optional) If the attribute references a Map type, this element
+    * can be used to specify a subgraph for the Key in the case of an
+    * Entity key type.  A keySubgraph can not be specified without the
+    * Map attribute also being specified.  If the target type has
+    * inheritance, multiple subgraphs can be specified.  These
+    * additional subgraphs are intended to add subclass-specific
+    * attributes.  Superclass subgraph entries will be merged into
+    * subclass subgraphs.  
+    * 
+    * <p> The value of this element is the name of the key subgraph as
+    * specified by the <code>name</code> element of the corresponding
+    * <code>NamedSubgraph</code> element.  If multiple key subgraphs
+    * are specified due to inheritance, they are referenced by this
+    * name.
+    */
+    String keySubgraph() default "";
+}
+
+
diff --git a/src/javax/persistence/NamedEntityGraph.java b/src/javax/persistence/NamedEntityGraph.java
new file mode 100644
index 0000000..e5f1931
--- /dev/null
+++ b/src/javax/persistence/NamedEntityGraph.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to specify the path and boundaries for a find operation or query.
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({TYPE})
+ at Retention(RUNTIME)
+public @interface NamedEntityGraph {
+
+    /**
+     * (Optional) The name of the entity graph.
+     * Defaults to the entity name of the root entity.
+     */
+    String name() default "";
+
+    /**
+     * (Optional) A list of attributes of the entity that are included in
+     *  this graph.
+     */
+    NamedAttributeNode[] attributeNodes() default {};
+
+    /**
+     * (Optional) Includes all of the attributes of the annotated
+     * entity class as attribute nodes in the NamedEntityGraph without
+     * the need to explicitly list them.  Included attributes can
+     * still be fully specified by an attribute node referencing a
+     * subgraph.
+     */
+    boolean includeAllAttributes() default false;
+
+    /**
+     * (Optional) A list of subgraphs that are included in the
+     * entity graph. These are referenced by name from NamedAttributeNode
+     * definitions.
+     */
+    NamedSubgraph[] subgraphs() default {};
+
+    /**
+     * (Optional) A list of subgraphs that will add additional
+     * attributes for subclasses of the annotated entity class to the
+     * entity graph.  Specified attributes from superclasses are
+     * included in subclasses.
+     */
+    NamedSubgraph[] subclassSubgraphs() default {};
+}
+
diff --git a/src/javax/persistence/NamedEntityGraphs.java b/src/javax/persistence/NamedEntityGraphs.java
new file mode 100644
index 0000000..d95ecd2
--- /dev/null
+++ b/src/javax/persistence/NamedEntityGraphs.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to group <code>NamedEntityGraph</code> annotations.  
+ *
+ * @see NamedEntityGraph
+ * @since Java Persistence 2.1
+ */
+ at Target({TYPE})
+ at Retention(RUNTIME)
+public @interface NamedEntityGraphs{
+    NamedEntityGraph[] value();
+}
diff --git a/src/javax/persistence/NamedNativeQueries.java b/src/javax/persistence/NamedNativeQueries.java
new file mode 100644
index 0000000..fbec0a3
--- /dev/null
+++ b/src/javax/persistence/NamedNativeQueries.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple native SQL named queries.  Query names
+ * are scoped to the persistence unit.  The <code>NamedNativeQueries</code> 
+ * annotation can be applied to an entity or mapped superclass.
+ *
+ * @see NamedNativeQuery
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface NamedNativeQueries { 
+
+    /** (Required) Array of <code>NamedNativeQuery</code> annotations. */
+    NamedNativeQuery[] value ();
+}
diff --git a/src/javax/persistence/NamedNativeQuery.java b/src/javax/persistence/NamedNativeQuery.java
new file mode 100644
index 0000000..08c8e83
--- /dev/null
+++ b/src/javax/persistence/NamedNativeQuery.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a named native SQL query.
+ * Query names are scoped to the persistence unit.
+ * The <code>NamedNativeQuery</code> annotation can be applied to an 
+ * entity or mapped superclass.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface NamedNativeQuery { 
+
+    /**
+     * The name used to refer to the query with the {@link EntityManager} 
+     * methods that create query objects.
+     */
+    String name();
+
+    /** The SQL query string. */
+    String query();
+
+    /** Query properties and hints.  (May include vendor-specific query hints.) */
+    QueryHint[] hints() default {};
+
+    /** The class of the result. */
+    Class resultClass() default void.class; 
+
+    /** The name of a {@link SqlResultSetMapping}, as defined in metadata. */
+    String resultSetMapping() default "";
+}
diff --git a/src/javax/persistence/NamedQueries.java b/src/javax/persistence/NamedQueries.java
new file mode 100644
index 0000000..fea5120
--- /dev/null
+++ b/src/javax/persistence/NamedQueries.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple named Java Persistence query language queries.
+ * Query names are scoped to the persistence unit.
+ * The <code>NamedQueries</code> annotation can be applied to an entity or mapped superclass.
+ *
+ * @see NamedQuery
+ * 
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE})  
+ at Retention(RUNTIME) 
+public @interface NamedQueries { 
+
+    /** (Required) An array of <code>NamedQuery</code> annotations. */
+     NamedQuery [] value (); 
+}
diff --git a/src/javax/persistence/NamedQuery.java b/src/javax/persistence/NamedQuery.java
new file mode 100644
index 0000000..5a7202f
--- /dev/null
+++ b/src/javax/persistence/NamedQuery.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static javax.persistence.LockModeType.NONE;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/** 
+ * Specifies a static, named query in the Java Persistence query language.
+ * Query names are scoped to the persistence unit.
+ * The <code>NamedQuery</code> annotation can be applied to an entity or mapped superclass.
+ *
+ * <p> The following is an example of the definition of a named query 
+ * in the Java Persistence query language:
+ *
+ * <pre>
+ *    @NamedQuery(
+ *            name="findAllCustomersWithName",
+ *            query="SELECT c FROM Customer c WHERE c.name LIKE :custName"
+ *    )
+ * </pre>
+ *
+ * <p> The following is an example of the use of a named query:
+ *
+ * <pre>
+ *    @PersistenceContext
+ *    public EntityManager em;
+ *    ...
+ *    customers = em.createNamedQuery("findAllCustomersWithName")
+ *            .setParameter("custName", "Smith")
+ *            .getResultList();
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface NamedQuery {
+
+    /** 
+     * (Required) The name used to refer to the query with the {@link EntityManager} 
+     * methods that create query objects. 
+     */
+    String name();
+
+    /** (Required) 
+     * The query string in the Java Persistence query language. 
+     */
+    String query();
+
+    /** 
+     * (Optional) The lock mode type to use in query execution.  If a <code>lockMode</code>
+     * other than <code>LockModeType.NONE</code> is specified, the query must be executed in
+     * a transaction and the persistence context joined to the transaction.
+     * @since Java Persistence 2.0
+     */
+    LockModeType lockMode() default NONE;
+    
+    /** (Optional) Query properties and hints.  May include
+     * vendor-specific query hints. 
+     */
+    QueryHint[] hints() default {};
+}
diff --git a/src/javax/persistence/NamedStoredProcedureQueries.java b/src/javax/persistence/NamedStoredProcedureQueries.java
new file mode 100644
index 0000000..a9375ad
--- /dev/null
+++ b/src/javax/persistence/NamedStoredProcedureQueries.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple named stored procedure queries.  Query names
+ * are scoped to the persistence unit.  The <code>NamedStoredProcedureQueries</code> 
+ * annotation can be applied to an entity or mapped superclass.
+ *
+ * @see NamedStoredProcedureQuery
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface NamedStoredProcedureQueries { 
+
+    /** (Required) Array of <code>NamedStoredProcedureQuery</code> annotations. */
+    NamedStoredProcedureQuery[] value ();
+}
diff --git a/src/javax/persistence/NamedStoredProcedureQuery.java b/src/javax/persistence/NamedStoredProcedureQuery.java
new file mode 100644
index 0000000..245521a
--- /dev/null
+++ b/src/javax/persistence/NamedStoredProcedureQuery.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;  
+
+/**
+ * Specifies and names a stored procedure, its parameters, and its result type.
+ *
+ * <p>The <code>NamedStoredProcedureQuery</code> annotation can be applied to an 
+ * entity or mapped superclass.
+ *
+ * <p>The <code>name</code> element is the name that is passed as an argument to the
+ * {@link EntityManager#createNamedStoredProcedureQuery}
+ * method to create an executable <code>StoredProcedureQuery</code> object.
+ * Names are scoped to the persistence unit.
+ *
+ * <p>The <code>procedureName</code> element is the name of the stored procedure in
+ * the database.
+ *
+ * <p>The parameters of the stored procedure are specified by the
+ * <code>parameters</code> element. All parameters must be specified in the order in
+ * which they occur in the parameter list of the stored procedure.
+ *
+ * <p>The <code>resultClasses</code> element refers to the class (or classes) that are
+ * used to map the results. The <code>resultSetMappings</code> element names one or
+ * more result set mappings, as defined by the {@link SqlResultSetMapping}
+ * annotation.
+ *
+ * <p>If there are multiple result sets, it is assumed that they will be
+ * mapped using the same mechanism — e.g., either all via a set of
+ * result class mappings or all via a set of result set mappings. The
+ * order of the specification of these mappings must be the same as
+ * the order in which the result sets will be returned by the stored
+ * procedure invocation. If the stored procedure returns one or more
+ * result sets and no <code>resultClasses</code> or <code>resultSetMappings</code>
+ * element is specified, any result set will be returned as a list of type
+ * Object[]. The combining of different strategies for the mapping of
+ * stored procedure result sets is undefined.
+ *
+ * <p>The <code>hints</code> element may be used to specify query properties and
+ * hints. Properties defined by this specification must be observed by
+ * the provider. Vendor-specific hints that are not recognized by a
+ * provider must be ignored.
+ *
+ * <p>All parameters of a named stored procedure query must be specified
+ * using the <code>StoredProcedureParameter</code> annotation.
+ *
+ * @see StoredProcedureQuery
+ * @see StoredProcedureParameter
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface NamedStoredProcedureQuery { 
+
+    /**
+     * The name used to refer to the query with the {@link EntityManager} 
+     * methods that create stored procedure query objects.
+     */
+    String name();
+
+    /** The name of the stored procedure in the database. */
+    String procedureName();
+
+    /**
+     *  Information about all parameters of the stored procedure.
+     *  All parameters must be specified in the order in which they
+     *  occur in the parameter list of the stored procedure.
+     */
+    StoredProcedureParameter[] parameters() default {};
+
+    /** The class or classes that are used to map the results. */
+    Class[] resultClasses() default {}; 
+
+    /** The names of one or more result set mappings, as defined in metadata. */
+    String[] resultSetMappings() default {};
+
+    /** Query properties and hints.  (May include vendor-specific query hints.) */
+    QueryHint[] hints() default {};
+
+}
diff --git a/src/javax/persistence/NamedSubgraph.java b/src/javax/persistence/NamedSubgraph.java
new file mode 100644
index 0000000..afb137e
--- /dev/null
+++ b/src/javax/persistence/NamedSubgraph.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * A <code>NamedSubgraph</code> is a member element of a
+ * <code>NamedEntityGraph</code>.  The <code>NamedSubgraph</code> is
+ * only referenced from within a NamedEntityGraph and can not be
+ * referenced independently.  It is referenced by its <code>name</code>
+ * from a <code>NamedAttributeNode</code> element of the 
+ * <code>NamedEntityGraph</code>.
+ *
+ * @see NamedEntityGraph
+ * @see NamedAttributeNode
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({})
+ at Retention(RUNTIME)
+public @interface NamedSubgraph {
+
+    /**
+     * (Required) The name of the subgraph as referenced from a
+     * NamedAttributeNode element.
+     */
+    String name();
+
+    /**
+     * (Optional) The type represented by this subgraph.  The element
+     * must be specified when this subgraph is extending a definition
+     * on behalf of a subclass.
+     */
+    Class type() default void.class;
+
+    /** 
+     * (Required) The list of the attributes of the class that must
+     * be included.  If the named subgraph corresponds to a subclass
+     * of the class referenced by the corresponding attribute node,
+     * then only subclass-specific attributes are listed.
+     */
+    NamedAttributeNode[] attributeNodes();
+}
+
+
diff --git a/src/javax/persistence/NoResultException.java b/src/javax/persistence/NoResultException.java
new file mode 100644
index 0000000..d4bfd25
--- /dev/null
+++ b/src/javax/persistence/NoResultException.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when {@link
+ * Query#getSingleResult Query.getSingleResult()} or {@link
+ * TypedQuery#getSingleResult TypedQuery.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
+ * rollback.
+ * 
+ * @see Query#getSingleResult()
+ * @see TypedQuery#getSingleResult()
+ * 
+ * @since Java Persistence 1.0
+ */
+public class NoResultException extends PersistenceException {
+
+	/**
+	 * Constructs a new <code>NoResultException</code> exception with
+	 * <code>null</code> as its detail message.
+	 */
+	public NoResultException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new <code>NoResultException</code> exception with the
+	 * specified detail message.
+	 * 
+	 * @param message
+	 *            the detail message.
+	 */
+	public NoResultException(String message) {
+		super(message);
+	}
+}
diff --git a/src/javax/persistence/NonUniqueResultException.java b/src/javax/persistence/NonUniqueResultException.java
new file mode 100644
index 0000000..8473be6
--- /dev/null
+++ b/src/javax/persistence/NonUniqueResultException.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when {@link
+ * Query#getSingleResult Query.getSingleResult()} or {@link
+ * TypedQuery#getSingleResult TypedQuery.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 rollback.
+ *
+ * @see Query#getSingleResult()
+ * @see TypedQuery#getSingleResult()
+ *
+ * @since Java Persistence 1.0
+ */
+public class NonUniqueResultException extends PersistenceException {
+
+        /** 
+         * Constructs a new <code>NonUniqueResultException</code> exception 
+         * with <code>null</code> as its detail message.
+         */
+	public NonUniqueResultException() {
+		super();
+	}
+
+        /** 
+         * Constructs a new <code>NonUniqueResultException</code> exception 
+         * with the specified detail message.
+         * @param   message   the detail message.
+         */
+	public NonUniqueResultException(String message) {
+		super(message);
+	}
+}
+
diff --git a/src/javax/persistence/OneToMany.java b/src/javax/persistence/OneToMany.java
new file mode 100644
index 0000000..aa42ff8
--- /dev/null
+++ b/src/javax/persistence/OneToMany.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+/**
+ * Specifies a many-valued association with one-to-many multiplicity.
+ * 
+ * <p> 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.
+ * If the relationship is bidirectional, the
+ * <code> mappedBy</code> element must be used to specify the relationship field or
+ * property of the entity that is the owner of the relationship.
+ *
+ * <p> The <code>OneToMany</code> annotation may be used within an embeddable class
+ * contained within an entity class to specify a relationship to a
+ * collection of entities. If the relationship is bidirectional, the
+ * <code> mappedBy</code> element must be used to specify the relationship field or
+ * property of the entity that is the owner of the relationship.
+ *
+ * When the collection is a <code>java.util.Map</code>, the <code>cascade</code> 
+ * element and the <code>orphanRemoval</code> element apply to the map value.
+ *
+ * <pre>
+ *
+ *    Example 1: One-to-Many association using generics
+ *
+ *    // In Customer class:
+ *
+ *    @OneToMany(cascade=ALL, mappedBy="customer")
+ *    public Set<Order> getOrders() { return orders; }
+ *
+ *    In Order class:
+ *
+ *    @ManyToOne
+ *    @JoinColumn(name="CUST_ID", nullable=false)
+ *    public Customer getCustomer() { return customer; }
+ *
+ *
+ *    Example 2: One-to-Many association without using generics
+ *
+ *    // In Customer class:
+ *
+ *    @OneToMany(targetEntity=com.acme.Order.class, cascade=ALL,
+ *                mappedBy="customer")
+ *    public Set getOrders() { return orders; }
+ *
+ *    // In Order class:
+ *
+ *    @ManyToOne
+ *    @JoinColumn(name="CUST_ID", nullable=false)
+ *    public Customer getCustomer() { return customer; }
+ *
+ *
+ *    Example 3: Unidirectional One-to-Many association using a foreign key mapping
+ *
+ *    // In Customer class:
+ *
+ *    @OneToMany(orphanRemoval=true)
+ *    @JoinColumn(name="CUST_ID") // join column is in table for Order
+ *    public Set<Order> getOrders() {return orders;}
+ *    
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface OneToMany {
+
+    /**
+     * (Optional) 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.
+     *
+     * <p> Defaults to the parameterized type of
+     * the collection when defined using generics.
+     */
+    Class targetEntity() default void.class;
+
+    /** 
+     * (Optional) The operations that must be cascaded to 
+     * the target of the association.
+     * <p> Defaults to no operations being cascaded.
+     *
+     * <p> When the target collection is a {@link java.util.Map
+     * java.util.Map}, the <code>cascade</code> element applies to the
+     * map value.
+     */
+    CascadeType[] cascade() default {};
+
+    /** (Optional) 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 entities
+     * 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 "";
+
+    /**
+     * (Optional) Whether to apply the remove operation to entities that have
+     * been removed from the relationship and to cascade the remove operation to
+     * those entities.
+     * @since Java Persistence 2.0
+     */
+    boolean orphanRemoval() default false;
+}
diff --git a/src/javax/persistence/OneToOne.java b/src/javax/persistence/OneToOne.java
new file mode 100644
index 0000000..b22593b
--- /dev/null
+++ b/src/javax/persistence/OneToOne.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+/**
+ * Specifies 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.  If the relationship is
+ * bidirectional, the non-owning side must use the <code>mappedBy</code> element of
+ * the <code>OneToOne</code> annotation to specify the relationship field or
+ * property of the owning side.
+ *
+ * <p> The <code>OneToOne</code> annotation may be used within an
+ * embeddable class to specify a relationship from the embeddable
+ * class to an entity class. If the relationship is bidirectional and
+ * the entity containing the embeddable class is on the owning side of
+ * the relationship, the non-owning side must use the
+ * <code>mappedBy</code> element of the <code>OneToOne</code>
+ * annotation to specify the relationship field or property of the
+ * embeddable class. The dot (".") notation syntax must be used in the
+ * <code>mappedBy</code> element to indicate the relationship attribute within the
+ * embedded attribute.  The value of each identifier used with the dot
+ * notation is the name of the respective embedded field or property.
+ * 
+ * <pre>
+ *    Example 1: One-to-one association that maps a foreign key column
+ *
+ *    // On Customer class:
+ *
+ *    @OneToOne(optional=false)
+ *    @JoinColumn(
+ *    	name="CUSTREC_ID", unique=true, nullable=false, updatable=false)
+ *    public CustomerRecord getCustomerRecord() { return customerRecord; }
+ *
+ *    // On CustomerRecord class:
+ *
+ *    @OneToOne(optional=false, mappedBy="customerRecord")
+ *    public Customer getCustomer() { return customer; }
+ *
+ *
+ *    Example 2: One-to-one association that assumes both the source and target share the same primary key values. 
+ *
+ *    // On Employee class:
+ *
+ *    @Entity
+ *    public class Employee {
+ *    	@Id Integer id;
+ *    
+ *    	@OneToOne @MapsId
+ *    	EmployeeInfo info;
+ *    	...
+ *    }
+ *
+ *    // On EmployeeInfo class:
+ *
+ *    @Entity
+ *    public class EmployeeInfo {
+ *    	@Id Integer id;
+ *    	...
+ *    }
+ *
+ *
+ *    Example 3: One-to-one association from an embeddable class to another entity.
+ *
+ *    @Entity
+ *    public class Employee {
+ *       @Id int id;
+ *       @Embedded LocationDetails location;
+ *       ...
+ *    }
+ *
+ *    @Embeddable
+ *    public class LocationDetails {
+ *       int officeNumber;
+ *       @OneToOne ParkingSpot parkingSpot;
+ *       ...
+ *    }
+ *
+ *    @Entity
+ *    public class ParkingSpot {
+ *       @Id int id;
+ *       String garage;
+ *       @OneToOne(mappedBy="location.parkingSpot") Employee assignedTo;
+ *        ... 
+ *    } 
+ *
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface OneToOne {
+
+    /** 
+     * (Optional) The entity class that is the target of 
+     * the association. 
+     *
+     * <p> Defaults to the type of the field or property 
+     * that stores the association. 
+     */
+    Class targetEntity() default void.class;
+
+    /**
+     * (Optional) The operations that must be cascaded to 
+     * the target of the association.
+     *
+     * <p> By default no operations are cascaded.
+     */
+    CascadeType[] cascade() default {};
+
+    /** 
+     * (Optional) 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;
+
+    /** 
+     * (Optional) Whether the association is optional. If set 
+     * to false then a non-null relationship must always exist.
+     */
+    boolean optional() default true;
+
+    /** (Optional) The field that owns the relationship. This 
+      * element is only specified on the inverse (non-owning) 
+      * side of the association.
+     */
+    String mappedBy() default "";
+
+
+    /**
+     * (Optional) Whether to apply the remove operation to entities that have
+     * been removed from the relationship and to cascade the remove operation to
+     * those entities.
+     * @since Java Persistence 2.0
+     */
+    boolean orphanRemoval() default false;
+}
diff --git a/src/javax/persistence/OptimisticLockException.java b/src/javax/persistence/OptimisticLockException.java
new file mode 100644
index 0000000..17a7422
--- /dev/null
+++ b/src/javax/persistence/OptimisticLockException.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+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.
+ * 
+ * @see EntityManager#find(Class, Object, LockModeType)
+ * @see EntityManager#find(Class, Object, LockModeType, java.util.Map)
+ * @see EntityManager#lock(Object, LockModeType)
+ * @see EntityManager#lock(Object, LockModeType, java.util.Map)
+ * 
+ * @since Java Persistence 1.0
+ */
+public class OptimisticLockException extends PersistenceException {
+
+	/**
+	 * The object that caused the exception
+	 */
+	Object entity;
+
+	/**
+	 * Constructs a new <code>OptimisticLockException</code> exception with
+	 * <code>null</code> as its detail message.
+	 */
+	public OptimisticLockException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new <code>OptimisticLockException</code> exception with the
+	 * specified detail message.
+	 * 
+	 * @param message
+	 *            the detail message.
+	 */
+	public OptimisticLockException(String message) {
+		super(message);
+	}
+
+	/**
+	 * Constructs a new <code>OptimisticLockException</code> exception with the
+	 * specified detail message and cause.
+	 * 
+	 * @param message
+	 *            the detail message.
+	 * @param cause
+	 *            the cause.
+	 */
+	public OptimisticLockException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * Constructs a new <code>OptimisticLockException</code> exception with the
+	 * specified cause.
+	 * 
+	 * @param cause
+	 *            the cause.
+	 */
+	public OptimisticLockException(Throwable cause) {
+		super(cause);
+	}
+
+	/**
+	 * Constructs a new <code>OptimisticLockException</code> exception with the
+	 * specified entity.
+	 * 
+	 * @param entity
+	 *            the entity.
+	 */
+	public OptimisticLockException(Object entity) {
+		this.entity = entity;
+	}
+
+	/**
+	 * Constructs a new <code>OptimisticLockException</code> exception with the
+	 * specified detail message, cause, and entity.
+	 * 
+	 * @param message
+	 *            the detail message.
+	 * @param cause
+	 *            the cause.
+	 * @param entity
+	 *            the entity.
+	 */
+	public OptimisticLockException(String message, Throwable cause, Object entity) {
+		super(message, cause);
+		this.entity = entity;
+	}
+
+	/**
+	 * Returns the entity that caused this exception.
+	 * 
+	 * @return the entity.
+	 */
+	public Object getEntity() {
+		return this.entity;
+	}
+
+}
diff --git a/src/javax/persistence/OrderBy.java b/src/javax/persistence/OrderBy.java
new file mode 100644
index 0000000..0ed5eab
--- /dev/null
+++ b/src/javax/persistence/OrderBy.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the ordering of the elements of a collection valued
+ * association or element collection at the point when the association
+ * or collection is retrieved.
+ * 
+ * <p> The syntax of the <code>value</code> ordering element is an 
+ * <code>orderby_list</code>, as follows:
+ * 
+ * <pre>
+ *    orderby_list::= orderby_item [,orderby_item]*
+ *    orderby_item::= [property_or_field_name] [ASC | DESC]
+ * </pre>
+ * 
+ * <p> If <code>ASC</code> or <code>DESC</code> is not specified, 
+ * <code>ASC</code> (ascending order) is assumed.
+ *
+ * <p> If the ordering element is not specified for an entity association,
+ * ordering by the primary key of the associated entity is assumed.
+ *
+ * <p> The property or field name must correspond to that of a 
+ * persistent property or field of the associated class or embedded class
+ * within it.  The properties or fields used in the ordering must correspond to 
+ * columns for which comparison operators are supported.
+ *
+ * <p> The dot (".") notation is used to refer to an attribute within an
+ * embedded attribute.  The value of each identifier used with the dot
+ * notation is the name of the respective embedded field or property.
+ *
+ * <p> The <code>OrderBy</code> annotation may be applied to an element
+ * collection. When <code>OrderBy</code> is applied to an element collection of
+ * basic type, the ordering will be by value of the basic objects and
+ * the property or field name is not used. When specifying an ordering
+ * over an element collection of embeddable type, the dot notation
+ * must be used to specify the attribute or attributes that determine
+ * the ordering.  
+ *
+ * <p> The <code>OrderBy</code> annotation is not used when an order
+ * column is specified.
+ *
+ * 
+ * <pre>
+ *    Example 1:
+ *    
+ *    @Entity 
+ *    public class Course {
+ *       ...
+ *       @ManyToMany
+ *       @OrderBy("lastname ASC")
+ *       public List<Student> getStudents() {...};
+ *       ...
+ *    }
+ *    
+ *    Example 2:
+ *
+ *    @Entity 
+ *    public class Student {
+ *       ...
+ *       @ManyToMany(mappedBy="students")
+ *       @OrderBy // ordering by primary key is assumed
+ *       public List<Course> getCourses() {...};
+ *       ...
+ *    }
+ *
+ *    Example 3: 
+ *
+ *    @Entity 
+ *    public class Person {
+ *         ...
+ *       @ElementCollection
+ *       @OrderBy("zipcode.zip, zipcode.plusFour")
+ *       public Set<Address> getResidences() {...};
+ *       ...
+ *    }
+ *  
+ *    @Embeddable 
+ *    public class Address {
+ *       protected String street;
+ *       protected String city;
+ *       protected String state;
+ *       @Embedded protected Zipcode zipcode;
+ *    }
+ *
+ *    @Embeddable 
+ *    public class Zipcode {
+ *       protected String zip;
+ *       protected String plusFour;
+ *    }
+ * </pre>
+ *
+ * @see OrderColumn
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+
+public @interface OrderBy {
+
+   /**
+    * An <code>orderby_list</code>.  Specified as follows:
+    *
+    * <pre>
+    *    orderby_list::= orderby_item [,orderby_item]*
+    *    orderby_item::= [property_or_field_name] [ASC | DESC]
+    * </pre>
+    *
+    * <p> If <code>ASC</code> or <code>DESC</code> is not specified,
+    * <code>ASC</code> (ascending order) is assumed.
+    *
+    * <p> If the ordering element is not specified, ordering by
+    * the primary key of the associated entity is assumed.
+    */
+    String value() default "";
+}
diff --git a/src/javax/persistence/OrderColumn.java b/src/javax/persistence/OrderColumn.java
new file mode 100644
index 0000000..ec9fffa
--- /dev/null
+++ b/src/javax/persistence/OrderColumn.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a column that is used to maintain the persistent order of
+ * a list. The persistence provider is responsible for maintaining the
+ * order upon retrieval and in the database.  The persistence provider
+ * is responsible for updating the ordering upon flushing to the
+ * database to reflect any insertion, deletion, or reordering
+ * affecting the list.
+ *
+ * <p> The <code>OrderColumn</code> annotation is specified on a
+ * OneToMany or ManyToMany relationship or on an element
+ * collection. The <code>OrderColumn</code> annotation is specified on
+ * the side of the relationship that references the collection that is
+ * to be ordered. The order column is not visible as part of the state
+ * of the entity or embeddable class.
+ *
+ * <p> The {@link OrderBy} annotation should be used for ordering that
+ * is visible as persistent state and maintained by the
+ * application. The <code>OrderBy</code> annotation is not used when
+ * <code>OrderColumn</code> is specified.
+ * 
+ * <p> The order column must be of integral type.  The persistence
+ * provider maintains a contiguous (non-sparse) ordering of the values
+ * of the order column when updating the association or element collection.
+ * The order column value for the first element is 0.
+ *
+ * <pre>
+ *
+ *    Example:
+ *
+ *    @Entity
+ *    public class CreditCard {
+ *
+ *       @Id long ccNumber;
+ *
+ *       @OneToMany  // unidirectional
+ *       @OrderColumn
+ *       List<CardTransaction> transactionHistory;
+ *       ...
+ *    }
+ *
+ * </pre>
+ *
+ * @see OrderBy
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target( { METHOD, FIELD })
+ at Retention(RUNTIME)
+public @interface OrderColumn {
+
+	/** (Optional) The name of the ordering column. 
+         *  Defaults to the concatenation of the name of the 
+         *  referencing property or field; "_"; "ORDER".
+         */
+	String name() default "";
+
+	/** (Optional) Whether the database column is nullable. */
+	boolean nullable() default true;
+
+	/**
+	 * (Optional) Whether the column is included in SQL INSERT statements
+	 * generated by the persistence provider.
+	 */
+	boolean insertable() default true;
+
+	/**
+	 * (Optional) Whether the column is included in SQL UPDATE statements
+	 * generated by the persistence provider.
+	 */
+	boolean updatable() default true;
+
+	/**
+	 * (Optional) The SQL fragment that is used when generating the DDL for the
+	 * column.  Defaults to generated SQL to create a column of the inferred type.
+	 */
+	String columnDefinition() default "";
+}
diff --git a/src/javax/persistence/Parameter.java b/src/javax/persistence/Parameter.java
new file mode 100644
index 0000000..7050547
--- /dev/null
+++ b/src/javax/persistence/Parameter.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Type for query parameter objects.
+ * @param <T> the type of the parameter
+ *
+ * @see Query
+ * @see TypedQuery
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Parameter<T> {
+
+    /**
+     * Return the parameter name, or null if the parameter is
+     * not a named parameter or no name has been assigned.
+     * @return parameter name
+     */
+    String getName();
+
+    /**
+     * Return the parameter position, or null if the parameter
+     * is not a positional parameter. 
+     * @return position of parameter
+     */
+    Integer getPosition();
+
+    /**
+     * Return the Java type of the parameter. Values bound to the
+     * parameter must be assignable to this type.
+     * This method is required to be supported for criteria queries
+     * only.   Applications that use this method for Java 
+     * Persistence query language queries and native queries will 
+     * not be portable.
+     * @return the Java type of the parameter
+     * @throws IllegalStateException if invoked on a parameter
+     *         obtained from a Java persistence query language 
+     *         query or native query when the implementation does 
+     *         not support this use
+     */
+     Class<T> getParameterType();
+}
+
diff --git a/src/javax/persistence/ParameterMode.java b/src/javax/persistence/ParameterMode.java
new file mode 100644
index 0000000..1c5b9e0
--- /dev/null
+++ b/src/javax/persistence/ParameterMode.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the mode of a parameter of a stored procedure query.
+ *
+ * @see StoredProcedureQuery
+ * @see StoredProcedureParameter
+ *
+ * @since Java Persistence 2.1
+ */
+public enum ParameterMode {
+
+    /**
+     *  Stored procedure input parameter
+     */
+    IN,
+
+    /**
+     *  Stored procedure input/output parameter
+     */
+    INOUT,
+
+    /**
+     *  Stored procedure output parameter
+     */
+    OUT,
+
+    /**
+     *  Stored procedure reference cursor parameter.   Some databases use
+     *  REF_CURSOR parameters to return result sets from stored procedures.
+     */
+    REF_CURSOR,
+
+}
diff --git a/src/javax/persistence/Persistence.java b/src/javax/persistence/Persistence.java
new file mode 100644
index 0000000..fd26d97
--- /dev/null
+++ b/src/javax/persistence/Persistence.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashSet;
+import javax.persistence.spi.PersistenceProvider;
+import javax.persistence.spi.PersistenceProviderResolver;
+import javax.persistence.spi.PersistenceProviderResolverHolder;
+import javax.persistence.spi.LoadState;
+
+/**
+ * Bootstrap class that is used to obtain an {@link EntityManagerFactory}
+ * in Java SE environments.  It may also be used to cause schema
+ * generation to occur.
+ * 
+ * <p> The <code>Persistence</code> class is available in a Java EE
+ * container environment as well; however, support for the Java SE
+ * bootstrapping APIs is not required in container environments.
+ * 
+ * <p> The <code>Persistence</code> class is used to obtain a {@link
+ * javax.persistence.PersistenceUtil PersistenceUtil} instance in both
+ * Java EE and Java SE environments.
+ *
+ * @since Java Persistence 1.0
+ */
+public class Persistence {
+    
+    /**
+     * 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. 
+     *            These properties may include properties to control
+     *            schema generation.  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;
+        PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+
+        List<PersistenceProvider> providers = resolver.getPersistenceProviders();
+
+        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;
+    }
+
+
+    /**
+     * Create database schemas and/or tables and/or create DDL
+     * scripts as determined by the supplied properties.
+     * <p>
+     * Called when schema generation is to occur as a separate phase
+     * from creation of the entity manager factory.
+     * <p>
+     * @param persistenceUnitName the name of the persistence unit
+     * @param map properties for schema generation;  these may
+     *             also contain provider-specific properties.  The
+     *             value of these properties override any values that
+     *             may have been configured elsewhere..             
+     * @throws PersistenceException if insufficient or inconsistent
+     *         configuration information is provided or if schema
+     *         generation otherwise fails.
+     *
+     * @since Java Persistence 2.1
+     */
+    public static void generateSchema(String persistenceUnitName, Map map) {
+        PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+        List<PersistenceProvider> providers = resolver.getPersistenceProviders();
+        
+        for (PersistenceProvider provider : providers) {
+            if (provider.generateSchema(persistenceUnitName, map)) {
+                return;
+            }
+        }
+        
+        throw new PersistenceException("No Persistence provider to generate schema named " + persistenceUnitName);
+    }
+    
+
+    /**
+     * Return the PersistenceUtil instance
+     * @return PersistenceUtil instance
+     * @since Java Persistence 2.0
+     */
+    public static PersistenceUtil getPersistenceUtil() {
+       return new PersistenceUtilImpl();
+    }
+
+    
+    /**
+     * Implementation of PersistenceUtil interface
+     * @since Java Persistence 2.0
+     */
+    private static class PersistenceUtilImpl implements PersistenceUtil {
+        public boolean isLoaded(Object entity, String attributeName) {
+            PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+
+            List<PersistenceProvider> providers = resolver.getPersistenceProviders();
+
+            for (PersistenceProvider provider : providers) {
+                LoadState loadstate = provider.getProviderUtil().isLoadedWithoutReference(entity, attributeName);
+                if(loadstate == LoadState.LOADED) {
+                    return true;
+                } else if (loadstate == LoadState.NOT_LOADED) {
+                    return false;
+                } // else continue
+            }
+
+            //None of the providers could determine the load state try isLoadedWithReference
+            for (PersistenceProvider provider : providers) {
+                LoadState loadstate = provider.getProviderUtil().isLoadedWithReference(entity, attributeName);
+                if(loadstate == LoadState.LOADED) {
+                    return true;
+                } else if (loadstate == LoadState.NOT_LOADED) {
+                    return false;
+                } // else continue
+            }
+
+            //None of the providers could determine the load state.
+            return true;
+        }
+
+        public boolean isLoaded(Object entity) {
+            PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+
+            List<PersistenceProvider> providers = resolver.getPersistenceProviders();
+
+            for (PersistenceProvider provider : providers) {
+                LoadState loadstate = provider.getProviderUtil().isLoaded(entity);
+                if(loadstate == LoadState.LOADED) {
+                    return true;
+                } else if (loadstate == LoadState.NOT_LOADED) {
+                    return false;
+                } // else continue
+            }
+            //None of the providers could determine the load state
+            return true;
+        }
+    }
+
+    /**
+     * This final String is deprecated and should be removed and is only here for TCK backward compatibility
+     * @since Java Persistence 1.0
+     * @deprecated
+     */
+    @Deprecated
+    public static final String PERSISTENCE_PROVIDER = "javax.persistence.spi.PeristenceProvider";
+    
+    /**
+     * This instance variable is deprecated and should be removed and is only here for TCK backward compatibility
+     * @since Java Persistence 1.0
+     * @deprecated
+     */
+    @Deprecated
+    protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
+}
diff --git a/src/javax/persistence/PersistenceContext.java b/src/javax/persistence/PersistenceContext.java
new file mode 100644
index 0000000..ed2e240
--- /dev/null
+++ b/src/javax/persistence/PersistenceContext.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Expresses a dependency on a container-managed {@link EntityManager} and its
+ * associated persistence context.
+ *
+ * @since Java Persistence 1.0
+ */
+
+ at Target({TYPE, METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface PersistenceContext {
+
+    /**
+     * (Optional) The name by which the entity manager is to be accessed in the 
+     * environment referencing context; not needed when dependency 
+     * injection is used.
+     */
+    String name() default "";
+
+    /**
+     * (Optional) The name of the persistence unit as defined in the
+     * <code>persistence.xml</code> file. If the <code>unitName</code> element is
+     * specified, the persistence unit for the entity manager that is
+     * accessible in JNDI must have the same name.
+     */
+    String unitName() default "";
+
+    /**
+     * (Optional) Specifies whether a transaction-scoped persistence context 
+     * or an extended persistence context is to be used.
+     */
+    PersistenceContextType type() default PersistenceContextType.TRANSACTION;
+
+    /**
+     * (Optional) Specifies whether the persistence context is always
+     * automatically synchronized with the current transaction or whether
+     * the persistence context must be explicitly joined to the current
+     * transaction by means of the EntityManager 
+     * {@link EntityManager#joinTransaction <code>joinTransaction</code>} method.
+     * @since Java Persistence 2.1
+     */
+    SynchronizationType synchronization() default SynchronizationType.SYNCHRONIZED;
+
+    /**
+     * (Optional) 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 {};
+}
diff --git a/src/javax/persistence/PersistenceContextType.java b/src/javax/persistence/PersistenceContextType.java
new file mode 100644
index 0000000..dc730cd
--- /dev/null
+++ b/src/javax/persistence/PersistenceContextType.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Specifies whether a transaction-scoped or extended 
+ * persistence context is to be used in {@link PersistenceContext}. 
+ * If not specified, a transaction-scoped persistence context is used.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum PersistenceContextType {
+
+    /** Transaction-scoped persistence context */
+    TRANSACTION,
+
+    /** Extended persistence context */
+    EXTENDED
+}
diff --git a/src/javax/persistence/PersistenceContexts.java b/src/javax/persistence/PersistenceContexts.java
new file mode 100644
index 0000000..c4c3c9b
--- /dev/null
+++ b/src/javax/persistence/PersistenceContexts.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Declares one or more {@link PersistenceContext} annotations.
+ * It is used to express a dependency on container-managed
+ * entity manager persistence contexts.
+ *
+ *@see PersistenceContext
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE})
+ at Retention(RUNTIME)
+public @interface PersistenceContexts {
+
+    /** (Required) One or more <code>PersistenceContext</code> annotations. */
+    PersistenceContext[] value();
+
+}
diff --git a/src/javax/persistence/PersistenceException.java b/src/javax/persistence/PersistenceException.java
new file mode 100644
index 0000000..80cea82
--- /dev/null
+++ b/src/javax/persistence/PersistenceException.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+
+/**
+ * Thrown by the persistence provider when a problem occurs.
+ * All instances of <code>PersistenceException</code> except for instances of 
+ * {@link NoResultException}, {@link NonUniqueResultException},
+ * {@link LockTimeoutException}, and {@link QueryTimeoutException} will cause 
+ * the current transaction, if one is active and the persistence context has
+ * been joined to it, to be marked for rollback.
+ *
+ * @since Java Persistence 1.0
+ */
+public class PersistenceException extends RuntimeException {
+
+        /** 
+         * Constructs a new <code>PersistenceException</code> exception 
+         * with <code>null</code> as its detail message.
+         */
+	public PersistenceException() {
+		super();
+	}
+
+        /** 
+         * Constructs a new <code>PersistenceException</code> exception 
+         * with the specified detail message.
+         * @param   message   the detail message.
+         */
+	public PersistenceException(String message) {
+		super(message);
+	}
+
+        /** 
+         * Constructs a new <code>PersistenceException</code> 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 <code>PersistenceException</code> exception 
+         * with the specified cause.
+         * @param   cause     the cause.
+         */
+	public PersistenceException(Throwable cause) {
+		super(cause);
+	}
+}
+
diff --git a/src/javax/persistence/PersistenceProperty.java b/src/javax/persistence/PersistenceProperty.java
new file mode 100644
index 0000000..174e4ba
--- /dev/null
+++ b/src/javax/persistence/PersistenceProperty.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Describes a single container or persistence provider property.  Used in {@link 
+ * PersistenceContext}.
+ * 
+ * <p> 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.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({})
+ at Retention(RUNTIME)
+public @interface PersistenceProperty {
+
+    /** The name of the property */
+    String name();
+
+    /** The value of the property */
+    String value();
+
+}
diff --git a/src/javax/persistence/PersistenceUnit.java b/src/javax/persistence/PersistenceUnit.java
new file mode 100644
index 0000000..5ab73e4
--- /dev/null
+++ b/src/javax/persistence/PersistenceUnit.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * Expresses a dependency on an {@link EntityManagerFactory} and its
+ * associated persistence unit.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface PersistenceUnit {
+
+    /**
+     * (Optional) The name by which the entity manager factory is to be accessed 
+     * in the environment referencing context;  not needed when 
+     * dependency injection is used.
+     */
+    String name() default "";
+
+    /**
+     * (Optional) The name of the persistence unit as defined in the
+     * <code>persistence.xml</code> file. If specified, the
+     * persistence unit for the entity manager factory that is
+     * accessible in JNDI must have the same name.
+     */
+    String unitName() default "";
+
+}
diff --git a/src/javax/persistence/PersistenceUnitUtil.java b/src/javax/persistence/PersistenceUnitUtil.java
new file mode 100644
index 0000000..501e47c
--- /dev/null
+++ b/src/javax/persistence/PersistenceUnitUtil.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Utility interface between the application and the persistence
+ * provider managing the persistence unit.
+ *
+ * <p>The methods of this interface should only be invoked on entity
+ * instances obtained from or managed by entity managers for this
+ * persistence unit or on new entity instances.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface PersistenceUnitUtil extends PersistenceUtil {
+
+    /**
+     * Determine the load state of a given persistent attribute
+     * of an entity belonging to the persistence unit.
+     * @param entity  entity instance containing the attribute
+     * @param attributeName name of attribute whose load state is
+     *        to be determined
+     * @return false if entity's state has not been loaded or if 
+     *         the attribute state has not been loaded, else true
+     */
+    public boolean isLoaded(Object entity, String attributeName);
+
+    /**
+     * Determine the load state of an entity belonging to the
+     * persistence unit.  This method can be used to determine the
+     * load state of an entity passed as a reference.  An entity is
+     * considered loaded if all attributes for which
+     * <code>FetchType.EAGER</code> has been specified have been
+     * loaded.  
+     * <p> The <code>isLoaded(Object, String)</code> method
+     * should be used to determine the load state of an attribute.
+     * Not doing so might lead to unintended loading of state.
+     * @param entity   entity instance whose load state is to be determined
+     * @return false if the entity has not been loaded, else true
+     */
+    public boolean isLoaded(Object entity);
+
+    /**
+     *  Return the id of the entity.
+     *  A generated id is not guaranteed to be available until after
+     *  the database insert has occurred.
+     *  Returns null if the entity does not yet have an id.
+     *  @param entity  entity instance
+     *  @return id of the entity
+     *  @throws IllegalArgumentException if the object is found not 
+     *          to be an entity
+     */
+    public Object getIdentifier(Object entity);
+} 
diff --git a/src/javax/persistence/PersistenceUnits.java b/src/javax/persistence/PersistenceUnits.java
new file mode 100644
index 0000000..c08364b
--- /dev/null
+++ b/src/javax/persistence/PersistenceUnits.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * Declares one or more {@link PersistenceUnit} annotations.
+ *
+ * @since Java Persistence 1.0
+ */
+
+ at Target({TYPE})
+ at Retention(RUNTIME)
+public @interface PersistenceUnits {
+
+    /** (Required) One or more {@link PersistenceUnit} annotations. */
+    PersistenceUnit[] value();
+
+}
diff --git a/src/javax/persistence/PersistenceUtil.java b/src/javax/persistence/PersistenceUtil.java
new file mode 100644
index 0000000..1a68564
--- /dev/null
+++ b/src/javax/persistence/PersistenceUtil.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Utility interface between the application and the persistence
+ * provider(s). 
+ * 
+ * <p> The <code>PersistenceUtil</code> interface instance obtained from the 
+ * {@link Persistence} class is used to determine the load state of an 
+ * entity or entity attribute regardless of which persistence 
+ * provider in the environment created the entity.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface PersistenceUtil {
+
+    /**
+     * Determine the load state of a given persistent attribute.
+     * @param entity  entity containing the attribute
+     * @param attributeName name of attribute whose load state is
+     *        to be determined
+     * @return false if entity's state has not been loaded or
+     *  if the attribute state has not been loaded, else true
+     */
+    public boolean isLoaded(Object entity, String attributeName);
+
+    /**
+     * Determine the load state of an entity.
+     * This method can be used to determine the load state 
+     * of an entity passed as a reference.  An entity is
+     * considered loaded if all attributes for which 
+     * <code>FetchType.EAGER</code> has been specified have been loaded.
+     * <p> The <code>isLoaded(Object, String)</code> method should be used to 
+     * determine the load state of an attribute.
+     * Not doing so might lead to unintended loading of state.
+     * @param entity whose load state is to be determined
+     * @return false if the entity has not been loaded, else true
+     */
+    public boolean isLoaded(Object entity);
+}
diff --git a/src/javax/persistence/PessimisticLockException.java b/src/javax/persistence/PessimisticLockException.java
new file mode 100644
index 0000000..042acd6
--- /dev/null
+++ b/src/javax/persistence/PessimisticLockException.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an pessimistic 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.
+ *
+ * @since Java Persistence 2.0
+ */
+public class PessimisticLockException extends PersistenceException {
+    /** The object that caused the exception */
+    Object entity;
+
+    /** 
+     * Constructs a new <code>PessimisticLockException</code> exception 
+     * with <code>null</code> as its detail message.
+     */
+    public PessimisticLockException() {
+        super();
+    }
+
+    /** 
+     * Constructs a new <code>PessimisticLockException</code> exception 
+     * with the specified detail message.
+     * @param   message   the detail message.
+     */
+    public PessimisticLockException(String message) {
+        super(message);
+    }
+
+    /** 
+     * Constructs a new <code>PessimisticLockException</code> exception 
+     * with the specified detail message and cause.
+     * @param   message   the detail message.
+     * @param   cause     the cause.
+     */
+    public PessimisticLockException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /** 
+     * Constructs a new <code>PessimisticLockException</code> exception 
+     * with the specified cause.
+     * @param   cause     the cause.
+     */
+    public PessimisticLockException(Throwable cause) {
+        super(cause);
+    }
+
+    /** 
+     * Constructs a new <code>PessimisticLockException</code> exception 
+     * with the specified entity.
+     * @param   entity     the entity.
+     */
+    public PessimisticLockException(Object entity) {
+        this.entity = entity;
+    }
+
+    /** 
+     * Constructs a new <code>PessimisticLockException</code> exception 
+     * with the specified detail message, cause, and entity.
+     * @param   message   the detail message.
+     * @param   cause     the cause.
+     * @param   entity     the entity.
+     */
+    public PessimisticLockException(String message, Throwable cause, Object entity) {
+        super(message, cause);
+        this.entity = entity;
+    }
+    
+    /**
+     * Returns the entity that caused this exception.
+     * @return the entity.
+     */
+    public Object getEntity() {
+        return this.entity;
+    }
+}
+
+
+
diff --git a/src/javax/persistence/PessimisticLockScope.java b/src/javax/persistence/PessimisticLockScope.java
new file mode 100644
index 0000000..0a561c8
--- /dev/null
+++ b/src/javax/persistence/PessimisticLockScope.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Defines the values of the <code>javax.persistence.lock.scope</code>
+ * property for pessimistic locking.  This property may be passed as
+ * an argument to the methods of the {@link EntityManager},
+ * {@link Query}, and {@link TypedQuery} interfaces that
+ * allow lock modes to be specified or used with the
+ * {@link NamedQuery} annotation.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum PessimisticLockScope {
+
+    /**
+     * This value defines the default behavior for pessimistic locking.
+     *
+     * <p>The persistence provider must lock the database row(s) that
+     * correspond to the non-collection-valued persistent state of
+     * that instance.  If a joined inheritance strategy is used, or if
+     * the entity is otherwise mapped to a secondary table, this
+     * entails locking the row(s) for the entity instance in the
+     * additional table(s).  Entity relationships for which the locked
+     * entity contains the foreign key will also be locked, but not
+     * the state of the referenced entities (unless those entities are
+     * explicitly locked).  Element collections and relationships for
+     * which the entity does not contain the foreign key (such as
+     * relationships that are mapped to join tables or unidirectional
+     * one-to-many relationships for which the target entity contains
+     * the foreign key) will not be locked by default.
+     */
+    NORMAL,
+
+    /**
+     * In addition to the behavior for
+     * <code>PessimisticLockScope.NORMAL</code>, element collections
+     * and relationships owned by the entity that are contained in
+     * join tables will be locked if the
+     * <code>javax.persistence.lock.scope</code> property is specified
+     * with a value of <code>PessimisticLockScope.EXTENDED</code>.
+     * The state of entities referenced by such relationships will not
+     * be locked (unless those entities are explicitly locked).
+     * Locking such a relationship or element collection generally locks only
+     * the rows in the join table or collection table for that
+     * relationship or collection.  This means that phantoms will be
+     * possible.
+     */
+    EXTENDED
+}
diff --git a/src/javax/persistence/PostLoad.java b/src/javax/persistence/PostLoad.java
new file mode 100644
index 0000000..d8a2ea4
--- /dev/null
+++ b/src/javax/persistence/PostLoad.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD}) 
+ at Retention(RUNTIME)
+
+public @interface PostLoad {}
diff --git a/src/javax/persistence/PostPersist.java b/src/javax/persistence/PostPersist.java
new file mode 100644
index 0000000..fe2503b
--- /dev/null
+++ b/src/javax/persistence/PostPersist.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD})
+ at Retention(RUNTIME)
+
+public @interface PostPersist {}
diff --git a/src/javax/persistence/PostRemove.java b/src/javax/persistence/PostRemove.java
new file mode 100644
index 0000000..0cfb221
--- /dev/null
+++ b/src/javax/persistence/PostRemove.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD})
+ at Retention(RUNTIME)
+
+public @interface PostRemove {}
diff --git a/src/javax/persistence/PostUpdate.java b/src/javax/persistence/PostUpdate.java
new file mode 100644
index 0000000..08c35a9
--- /dev/null
+++ b/src/javax/persistence/PostUpdate.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD})
+ at Retention(RUNTIME)
+
+public @interface PostUpdate {}
diff --git a/src/javax/persistence/PrePersist.java b/src/javax/persistence/PrePersist.java
new file mode 100644
index 0000000..576244f
--- /dev/null
+++ b/src/javax/persistence/PrePersist.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD}) 
+ at Retention(RUNTIME)
+
+public @interface PrePersist {}
diff --git a/src/javax/persistence/PreRemove.java b/src/javax/persistence/PreRemove.java
new file mode 100644
index 0000000..287338b
--- /dev/null
+++ b/src/javax/persistence/PreRemove.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD})
+ at Retention(RUNTIME)
+
+public @interface PreRemove {}
diff --git a/src/javax/persistence/PreUpdate.java b/src/javax/persistence/PreUpdate.java
new file mode 100644
index 0000000..abc3915
--- /dev/null
+++ b/src/javax/persistence/PreUpdate.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding 
+ * lifecycle event. This annotation may be applied to methods 
+ * of an entity class, a mapped superclass, or a callback 
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD}) 
+ at Retention(RUNTIME)
+
+public @interface PreUpdate {}
diff --git a/src/javax/persistence/PrimaryKeyJoinColumn.java b/src/javax/persistence/PrimaryKeyJoinColumn.java
new file mode 100644
index 0000000..5da2697
--- /dev/null
+++ b/src/javax/persistence/PrimaryKeyJoinColumn.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a primary key column that is used as a foreign key to
+ * join to another table.
+ *
+ * <p> It is used to join the primary table of an entity subclass 
+ * in the {@link InheritanceType#JOINED JOINED} mapping strategy 
+ * to the primary table of its superclass; it is used within a 
+ * {@link SecondaryTable} annotation to join a secondary table 
+ * to a primary table; and it may be used in a {@link OneToOne} 
+ * mapping in which the primary key of the referencing entity 
+ * is used as a foreign key to the referenced entity. 
+ *
+ * <p> If no <code>PrimaryKeyJoinColumn</code> annotation is 
+ * specified for a subclass in the <code>JOINED</code>
+ * 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.
+ *
+ * <pre>
+ *
+ *    Example: Customer and ValuedCustomer subclass
+ *
+ *    @Entity
+ *    @Table(name="CUST")
+ *    @Inheritance(strategy=JOINED)
+ *    @DiscriminatorValue("CUST")
+ *    public class Customer { ... }
+ *    
+ *    @Entity
+ *    @Table(name="VCUST")
+ *    @DiscriminatorValue("VCUST")
+ *    @PrimaryKeyJoinColumn(name="CUST_ID")
+ *    public class ValuedCustomer extends Customer { ... }
+ * </pre>
+ *
+ * @see SecondaryTable
+ * @see Inheritance
+ * @see OneToOne
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface PrimaryKeyJoinColumn {
+
+    /** 
+     * (Optional) The name of the primary key column of the current table.
+     * <p> Defaults to the same name as the primary key column 
+     * of the primary table of the superclass (<code>JOINED</code> mapping strategy); the same 
+     * name as the primary key column of the primary table 
+     * (<code>SecondaryTable</code> mapping); or the same name as the 
+     * primary key column for the table for the referencing entity 
+     * (<code>OneToOne</code> mapping).
+     */
+    String name() default "";
+
+    /** 
+     * (Optional) The name of the primary key column of the table
+     * being joined to.  <p> Defaults to the same name as the primary
+     * key column of the primary table of the superclass
+     * (<code>JOINED</code> mapping strategy); the same name as the
+     * primary key column of the primary table
+     * (<code>SecondaryTable</code> mapping); or the same name as the
+     * primary key column for the table for the referencing entity
+     * (<code>OneToOne</code> mapping).
+     */
+    String referencedColumnName() default "";
+
+    /**
+     * (Optional) The SQL fragment that is used when generating the 
+     * DDL for the column. This should not be specified for a 
+     * <code>OneToOne</code> primary key association.
+     * <p> Defaults to the generated SQL to create a column of the 
+     * inferred type.
+     */
+    String columnDefinition() default "";
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *  foreign key constraint for the primary key join column 
+     *  when table generation is in effect.  If
+     *  this element is not specified, the persistence provider's
+     *  default foreign key strategy will apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/src/javax/persistence/PrimaryKeyJoinColumns.java b/src/javax/persistence/PrimaryKeyJoinColumns.java
new file mode 100644
index 0000000..2befe5d
--- /dev/null
+++ b/src/javax/persistence/PrimaryKeyJoinColumns.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Groups {@link PrimaryKeyJoinColumn} annotations.
+ * It is used to map composite foreign keys.
+ *
+ * <pre>
+ *    Example: ValuedCustomer subclass
+ *
+ *    @Entity
+ *    @Table(name="VCUST")
+ *    @DiscriminatorValue("VCUST")
+ *    @PrimaryKeyJoinColumns({
+ *        @PrimaryKeyJoinColumn(name="CUST_ID", 
+ *            referencedColumnName="ID"),
+ *        @PrimaryKeyJoinColumn(name="CUST_TYPE",
+ *            referencedColumnName="TYPE")
+ *    })
+ *    public class ValuedCustomer extends Customer { ... }
+ * </pre>
+ *
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface PrimaryKeyJoinColumns {
+
+    /** One or more <code>PrimaryKeyJoinColumn</code> annotations. */
+    PrimaryKeyJoinColumn[] value();
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *  foreign key constraint when table generation is in effect. 
+     *  If both this element and the <code>foreignKey</code> element 
+     *  of any of the <code>PrimaryKeyJoinColumn</code> elements are specified, 
+     *  the behavior is undefined.  If no foreign key annotation element
+     *  is specified in either location, the persistence provider's
+     *  default foreign key strategy will apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+}
diff --git a/src/javax/persistence/Query.java b/src/javax/persistence/Query.java
new file mode 100644
index 0000000..0bd870f
--- /dev/null
+++ b/src/javax/persistence/Query.java
@@ -0,0 +1,455 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * Interface used to control query execution.
+ *
+ * @see TypedQuery
+ * @see StoredProcedureQuery
+ * @see Parameter
+ *
+ * @since Java Persistence 1.0
+ */
+public interface Query {
+
+    /**
+     * Execute a SELECT query and return the query results
+     * as an untyped List.
+     * @return a list of the results
+     * @throws IllegalStateException if called for a Java
+     *         Persistence query language UPDATE or DELETE statement
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws TransactionRequiredException if a lock mode other than
+     *         <code>NONE</code> has been set and there is no transaction
+     *         or the persistence context has not been joined to the transaction
+     * @throws PessimisticLockException if pessimistic locking
+     *         fails and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking
+     *         fails and only the statement is rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    List getResultList();
+
+    /**
+     * Execute a SELECT query that returns a single untyped 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
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws TransactionRequiredException if a lock mode other than
+     *         <code>NONE</code> has been set and there is no transaction
+     *         or the persistence context has not been joined to the transaction
+     * @throws PessimisticLockException if pessimistic locking
+     *         fails and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking
+     *         fails and only the statement is rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    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 or for
+     *         a criteria query
+     * @throws TransactionRequiredException if there is 
+     *         no transaction or the persistence context has not
+     *         been joined to the transaction
+     * @throws QueryTimeoutException if the statement execution 
+     *         exceeds the query timeout value set and only 
+     *         the statement is rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    int executeUpdate();
+
+    /**
+     * Set the maximum number of results to retrieve.
+     * @param maxResult  maximum number of results to retrieve
+     * @return the same query instance
+     * @throws IllegalArgumentException if the argument is negative
+     */
+    Query setMaxResults(int maxResult);
+
+    /**
+     * The maximum number of results the query object was set to
+     * retrieve. Returns <code>Integer.MAX_VALUE</code> if <code>setMaxResults</code> was not
+     * applied to the query object.
+     * @return maximum number of results
+     * @since Java Persistence 2.0
+     */
+    int getMaxResults();
+
+    /**
+     * 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 the argument is negative
+     */
+    Query setFirstResult(int startPosition);
+
+    /**
+     * The position of the first result the query object was set to
+     * retrieve. Returns 0 if <code>setFirstResult</code> was not applied to the
+     * query object.
+     * @return position of the first result
+     * @since Java Persistence 2.0
+     */
+    int getFirstResult();
+
+    /**
+     * Set a query property or hint. The hints elements may be used 
+     * to specify query properties and hints. Properties defined by
+     * this specification must be observed by the provider. 
+     * Vendor-specific hints that are not recognized by a provider
+     * must be silently ignored. Portable applications should not
+     * rely on the standard timeout hint. Depending on the database
+     * in use and the locking mechanisms used by the provider,
+     * this hint may or may not be observed.
+     * @param hintName  name of the property or hint
+     * @param value  value for the property or hint
+     * @return the same query instance
+     * @throws IllegalArgumentException if the second argument is not
+     *         valid for the implementation
+     */
+    Query setHint(String hintName, Object value);
+
+    /**
+     * Get the properties and hints and associated values that are 
+     * in effect for the query instance.
+     * @return query properties and hints
+     * @since Java Persistence 2.0
+     */
+    Map<String, Object> getHints();
+
+    /**
+     * Bind the value of a <code>Parameter</code> object.
+     * @param param  parameter object
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter
+     *         does not correspond to a parameter of the
+     *         query
+     * @since Java Persistence 2.0
+     */
+    <T> Query setParameter(Parameter<T> param, T value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a <code>Parameter</code> object.
+     * @param param parameter object
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     * @since Java Persistence 2.0
+     */
+    Query setParameter(Parameter<Calendar> param, Calendar value, 
+                       TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a <code>Parameter</code> object.
+     * @param param parameter object
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     * @since Java Persistence 2.0
+     */
+    Query setParameter(Parameter<Date> param, Date value, 
+                       TemporalType temporalType);
+
+    /**
+     * Bind an argument value to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if
+     *         the argument is of incorrect type
+     */
+    Query setParameter(String name, Object value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if
+     *         the value argument is of incorrect type
+     */
+    Query setParameter(String name, Calendar value, 
+                       TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if
+     *         the value argument is of incorrect type
+     */
+    Query setParameter(String name, Date value, 
+                       TemporalType temporalType);
+
+    /**
+     * Bind an argument value to a positional parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the
+     *         query or if the argument is of incorrect type
+     */
+    Query setParameter(int position, Object value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a positional
+     * parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query or
+     *         if the value argument is of incorrect type
+     */
+    Query setParameter(int position, Calendar value,  
+                       TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a positional parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query or
+     *         if the value argument is of incorrect type
+     */
+    Query setParameter(int position, Date value,  
+                       TemporalType temporalType);
+
+    /**
+     * Get the parameter objects corresponding to the declared
+     * parameters of the query.
+     * Returns empty set if the query has no parameters.
+     * This method is not required to be supported for native
+     * queries.
+     * @return set of the parameter objects
+     * @throws IllegalStateException if invoked on a native
+     *         query when the implementation does not support 
+     *         this use
+     * @since Java Persistence 2.0
+     */
+    Set<Parameter<?>> getParameters();
+
+    /**
+     * Get the parameter object corresponding to the declared
+     * parameter of the given name.
+     * This method is not required to be supported for native
+     * queries.
+     * @param name  parameter name
+     * @return parameter object
+     * @throws IllegalArgumentException if the parameter of the
+     *         specified name does not exist
+     * @throws IllegalStateException if invoked on a native
+     *         query when the implementation does not support 
+     *         this use
+     * @since Java Persistence 2.0
+     */
+    Parameter<?> getParameter(String name);
+
+    /**
+     * Get the parameter object corresponding to the declared
+     * parameter of the given name and type.
+     * This method is required to be supported for criteria queries
+     * only.
+     * @param name  parameter name
+     * @param type  type
+     * @return parameter object
+     * @throws IllegalArgumentException if the parameter of the
+     *         specified name does not exist or is not assignable
+     *         to the type
+     * @throws IllegalStateException if invoked on a native
+     *         query or Java Persistence query language query when
+     *         the implementation does not support this use
+     * @since Java Persistence 2.0
+     */
+    <T> Parameter<T> getParameter(String name, Class<T> type);
+
+    /**
+     * Get the parameter object corresponding to the declared
+     * positional parameter with the given position.
+     * This method is not required to be supported for native
+     * queries.
+     * @param position  position
+     * @return parameter object
+     * @throws IllegalArgumentException if the parameter with the
+     *         specified position does not exist
+     * @throws IllegalStateException if invoked on a native
+     *         query when the implementation does not support 
+     *         this use
+     * @since Java Persistence 2.0
+     */
+    Parameter<?> getParameter(int position);
+
+    /**
+     * Get the parameter object corresponding to the declared
+     * positional parameter with the given position and type.
+     * This method is not required to be supported by the provider.
+     * @param position  position
+     * @param type  type
+     * @return parameter object
+     * @throws IllegalArgumentException if the parameter with the
+     *         specified position does not exist or is not assignable
+     *         to the type
+     * @throws IllegalStateException if invoked on a native
+     *         query or Java Persistence query language query when
+     *         the implementation does not support this use
+     * @since Java Persistence 2.0
+     */
+    <T> Parameter<T> getParameter(int position, Class<T> type);
+
+    /**
+     * Return a boolean indicating whether a value has been bound 
+     * to the parameter.
+     * @param param parameter object
+     * @return boolean indicating whether parameter has been bound
+     * @since Java Persistence 2.0
+     */
+    boolean isBound(Parameter<?> param);
+
+    /**
+     * Return the input value bound to the parameter.
+     * (Note that OUT parameters are unbound.)
+     * @param param parameter object
+     * @return parameter value
+     * @throws IllegalArgumentException if the parameter is not 
+     *         a parameter of the query
+     * @throws IllegalStateException if the parameter has not been
+     *         been bound
+     * @since Java Persistence 2.0
+     */
+    <T> T getParameterValue(Parameter<T> param);
+
+    /**
+     * Return the input value bound to the named parameter.
+     * (Note that OUT parameters are unbound.)
+     * @param name  parameter name
+     * @return parameter value
+     * @throws IllegalStateException if the parameter has not been
+     *         been bound
+     * @throws IllegalArgumentException if the parameter of the
+     *         specified name does not exist
+     * @since Java Persistence 2.0
+     */
+    Object getParameterValue(String name);
+
+    /**
+     * Return the input value bound to the positional parameter.
+     * (Note that OUT parameters are unbound.)
+     * @param position  position
+     * @return parameter value
+     * @throws IllegalStateException if the parameter has not been
+     *         been bound
+     * @throws IllegalArgumentException if the parameter with the
+     *         specified position does not exist
+     * @since Java Persistence 2.0
+     */
+    Object getParameterValue(int position);
+
+    /**
+     * 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  flush mode
+     * @return the same query instance
+     */
+    Query setFlushMode(FlushModeType flushMode);
+
+    /**
+     * Get the flush mode in effect for the query execution. 
+     * If a flush mode has not been set for the query object, 
+     * returns the flush mode in effect for the entity manager.
+     * @return flush mode
+     * @since Java Persistence 2.0
+     */
+    FlushModeType getFlushMode();
+
+    /**
+     * Set the lock mode type to be used for the query execution.
+     * @param lockMode  lock mode
+     * @return the same query instance
+     * @throws IllegalStateException if the query is found not to be 
+     *         a Java Persistence query language SELECT query
+     *         or a CriteriaQuery query
+     * @since Java Persistence 2.0
+     */
+    Query setLockMode(LockModeType lockMode);
+
+    /**
+     * Get the current lock mode for the query.  Returns null if a lock
+     * mode has not been set on the query object.
+     * @return lock mode
+     * @throws IllegalStateException if the query is found not to be
+     *         a Java Persistence query language SELECT query or
+     *         a Criteria API query
+     * @since Java Persistence 2.0
+     */
+    LockModeType getLockMode();
+
+    /**
+     * Return an object of the specified type to allow access to 
+     * the provider-specific API.  If the provider's query 
+     * implementation does not support the specified class, the 
+     * <code>PersistenceException</code> is thrown.
+     * @param cls  the class of the object to be returned.  This is
+     *             normally either the underlying query 
+     *             implementation class or an interface that it 
+     *             implements.
+     * @return an instance of the specified class
+     * @throws PersistenceException if the provider does not support
+     *         the call
+     * @since Java Persistence 2.0
+     */
+    <T> T unwrap(Class<T> cls);
+}
diff --git a/src/javax/persistence/QueryHint.java b/src/javax/persistence/QueryHint.java
new file mode 100644
index 0000000..6111f17
--- /dev/null
+++ b/src/javax/persistence/QueryHint.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to supply a query property or hint to the {@link NamedQuery} or {@link
+ * NamedNativeQuery} annotation.
+ *
+ * <p> Vendor-specific hints that are not recognized by a provider are ignored.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({}) 
+ at Retention(RUNTIME)
+public @interface QueryHint { 
+
+    /** Name of the hint. */
+    String name(); 
+
+    /** Value of the hint. */
+    String value();
+}
diff --git a/src/javax/persistence/QueryTimeoutException.java b/src/javax/persistence/QueryTimeoutException.java
new file mode 100644
index 0000000..3704c69
--- /dev/null
+++ b/src/javax/persistence/QueryTimeoutException.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when a query times out
+ * and only the statement is rolled back.
+ * The current transaction, if one is active, will be not
+ * be marked for rollback.
+ *
+ * @since Java Persistence 2.0
+ */
+public class QueryTimeoutException extends PersistenceException {
+
+    /** The query object that caused the exception */
+    Query query;
+
+    /** 
+     * Constructs a new <code>QueryTimeoutException</code> exception 
+     * with <code>null</code> as its detail message.
+     */
+    public QueryTimeoutException() {
+        super();
+    }
+
+    /** 
+     * Constructs a new <code>QueryTimeoutException</code> exception 
+     * with the specified detail message.
+     * @param   message   the detail message.
+     */
+    public QueryTimeoutException(String message) {
+        super(message);
+    }
+
+    /** 
+     * Constructs a new <code>QueryTimeoutException</code> exception 
+     * with the specified detail message and cause.
+     * @param   message   the detail message.
+     * @param   cause     the cause.
+     */
+    public QueryTimeoutException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /** 
+     * Constructs a new <code>QueryTimeoutException</code> exception 
+     * with the specified cause.
+     * @param   cause     the cause.
+     */
+    public QueryTimeoutException(Throwable cause) {
+        super(cause);
+    }
+
+
+    /** 
+     * Constructs a new <code>QueryTimeoutException</code> exception 
+     * with the specified query.
+     * @param   query     the query.
+     */
+    public QueryTimeoutException(Query query) {
+        this.query = query;
+    }
+
+    /** 
+     * Constructs a new <code>QueryTimeoutException</code> exception 
+     * with the specified detail message, cause, and query.
+     * @param   message   the detail message.
+     * @param   cause     the cause.
+     * @param   query     the query.
+     */
+    public QueryTimeoutException(String message, Throwable cause, Query query) {
+        super(message, cause);
+        this.query = query;
+    }
+    
+    /**
+     * Returns the query that caused this exception.
+     * @return the query.
+     */
+    public Query getQuery() {
+        return this.query;
+    }
+}
+
+
diff --git a/src/javax/persistence/RollbackException.java b/src/javax/persistence/RollbackException.java
new file mode 100644
index 0000000..c04fb6b
--- /dev/null
+++ b/src/javax/persistence/RollbackException.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+/**
+ * Thrown by the persistence provider when 
+ * {@link EntityTransaction#commit() EntityTransaction.commit()} fails.
+ *
+ * @see javax.persistence.EntityTransaction#commit()
+ *
+ * @since Java Persistence 1.0
+ */
+public class RollbackException extends PersistenceException {
+	
+        /** 
+         * Constructs a new <code>RollbackException</code> exception 
+         * with <code>null</code> as its detail message.
+         */
+	public RollbackException() {
+		super();
+	}
+
+        /** 
+         * Constructs a new <code>RollbackException</code> exception 
+         * with the specified detail message.
+         * @param   message   the detail message.
+         */
+	public RollbackException(String message) {
+		super(message);
+	}
+
+        /** 
+         * Constructs a new <code>RollbackException</code> exception 
+         * with the specified detail message and cause.
+         * @param   message   the detail message.
+         * @param   cause     the cause.
+         */
+	public RollbackException(String message, Throwable cause) {
+		super(message, cause);
+	}
+	
+        /** 
+         * Constructs a new <code>RollbackException</code> exception 
+         * with the specified cause.
+         * @param   cause     the cause.
+         */
+	public RollbackException(Throwable cause) {
+		super(cause);
+	}
+}
+
+
diff --git a/src/javax/persistence/SecondaryTable.java b/src/javax/persistence/SecondaryTable.java
new file mode 100644
index 0000000..7ce3ffd
--- /dev/null
+++ b/src/javax/persistence/SecondaryTable.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies 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.
+ *
+ * <p> If no <code>SecondaryTable</code> 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.
+ *
+ * <pre>
+ *    Example 1: Single secondary table with a single primary key column.
+ *
+ *    @Entity
+ *    @Table(name="CUSTOMER")
+ *    @SecondaryTable(name="CUST_DETAIL", 
+ *        pkJoinColumns=@PrimaryKeyJoinColumn(name="CUST_ID"))
+ *    public class Customer { ... } 
+ *
+ *
+ *    Example 2: Single secondary table with multiple primary key columns.
+ *
+ *    @Entity
+ *    @Table(name="CUSTOMER")
+ *    @SecondaryTable(name="CUST_DETAIL",
+ *        pkJoinColumns={
+ *            @PrimaryKeyJoinColumn(name="CUST_ID"),
+ *            @PrimaryKeyJoinColumn(name="CUST_TYPE")})
+ *    public class Customer { ... }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target(TYPE) 
+ at Retention(RUNTIME)
+
+public @interface SecondaryTable {
+
+    /** (Required) The name of the table. */
+    String name();
+
+    /** (Optional) The catalog of the table.
+     * <p> Defaults to the default catalog.
+     */
+    String catalog() default "";
+
+    /** (Optional) The schema of the table.
+     * <p> Defaults to the default schema for user.
+     */
+    String schema() default "";
+
+    /** 
+     * (Optional) The columns that are used to join with 
+     * the primary table.
+     * <p> Defaults to the column(s) of the same name(s) 
+     * as the primary key column(s) in the primary table.
+     */
+    PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+
+    /**
+     *  (Optional) Used to specify or control the generation of a
+     *   foreign key constraint for the columns corresponding to the
+     *   <code>pkJoinColumns</code> element when table generation is
+     *   in effect.  If both this element and the
+     *   <code>foreignKey</code> element of any of the
+     *   <code>pkJoinColumns</code> elements are specified, the
+     *   behavior is undefined.  If no foreign key annotation element
+     *   is specified in either location, the persistence provider's
+     *   default foreign key strategy will apply.
+     *
+     *  @since Java Persistence 2.1
+     */
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    /**
+     * (Optional) 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 <code>Column</code> and <code>JoinColumn</code> 
+     * annotations and constraints entailed by primary key mappings.
+     * <p> Defaults to no additional constraints.
+     */
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    /**
+     * (Optional) Indexes for the table.  These are only used if
+     * table generation is in effect. 
+     *
+     * @since Java Persistence 2.1 
+     */
+    Index[] indexes() default {};
+}
diff --git a/src/javax/persistence/SecondaryTables.java b/src/javax/persistence/SecondaryTables.java
new file mode 100644
index 0000000..fdbe90d
--- /dev/null
+++ b/src/javax/persistence/SecondaryTables.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple secondary tables for an entity.
+ *
+ * <pre>
+ *    Example 1: Multiple secondary tables assuming primary key columns are named the same in all tables.
+ *
+ *    @Entity
+ *    @Table(name="EMPLOYEE")
+ *    @SecondaryTables({
+ *        @SecondaryTable(name="EMP_DETAIL"),
+ *        @SecondaryTable(name="EMP_HIST")
+ *    })
+ *    public class Employee { ... }
+ *    
+ *
+ *    Example 2: Multiple secondary tables with differently named primary key columns. 
+ *
+ *    @Entity
+ *    @Table(name="EMPLOYEE")
+ *    @SecondaryTables({
+ *        @SecondaryTable(name="EMP_DETAIL", 
+ *            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPL_ID")),
+ *        @SecondaryTable(name="EMP_HIST", 
+ *            pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPLOYEE_ID"))
+ *    })
+ *    public class Employee { ... }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target(TYPE) 
+ at Retention(RUNTIME)
+
+public @interface SecondaryTables {
+
+    /** (Required) The secondary tables for an entity. */
+    SecondaryTable[] value();
+}
diff --git a/src/javax/persistence/SequenceGenerator.java b/src/javax/persistence/SequenceGenerator.java
new file mode 100644
index 0000000..8a0440b
--- /dev/null
+++ b/src/javax/persistence/SequenceGenerator.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Defines a primary key generator that may be referenced by name when
+ * a generator element is specified for the {@link 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).
+ *
+ * <pre>
+ *   Example:
+ *
+ *   @SequenceGenerator(name="EMP_SEQ", allocationSize=25)
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface SequenceGenerator {
+
+    /** 
+     * (Required) A unique generator name that can be referenced 
+     * by one or more classes to be the generator for primary key 
+     * values.
+     */
+    String name();
+
+    /**
+     * (Optional) The name of the database sequence object from 
+     * which to obtain primary key values.
+     * <p> Defaults to a provider-chosen value.
+     */
+    String sequenceName() default "";
+
+    /** (Optional) The catalog of the sequence generator. 
+     *
+     * @since Java Persistence 2.0
+     */
+    String catalog() default "";
+
+    /** (Optional) The schema of the sequence generator. 
+     *
+     * @since Java Persistence 2.0
+     */
+    String schema() default "";
+
+    /** 
+     * (Optional) The value from which the sequence object 
+     * is to start generating.
+     */
+    int initialValue() default 1;
+
+    /**
+     * (Optional) The amount to increment by when allocating 
+     * sequence numbers from the sequence.
+     */
+    int allocationSize() default 50;
+}
diff --git a/src/javax/persistence/SharedCacheMode.java b/src/javax/persistence/SharedCacheMode.java
new file mode 100644
index 0000000..b7ca900
--- /dev/null
+++ b/src/javax/persistence/SharedCacheMode.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Specifies how the provider must use a second-level cache for the
+ * persistence unit.  Corresponds to the value of the <code>persistence.xml</code>
+ * <code>shared-cache-mode</code> element, and returned as the result of
+ * {@link javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()}.
+ * 
+ * @since Java Persistence 2.0
+ */
+public enum SharedCacheMode {
+
+    /**
+     * All entities and entity-related state and data are cached.
+     */
+    ALL, 
+
+    /**
+     * Caching is disabled for the persistence unit.
+     */
+    NONE, 
+
+    /**
+     * Caching is enabled for all entities for <code>Cacheable(true)</code>
+     * is specified.  All other entities are not cached.
+     */
+    ENABLE_SELECTIVE, 
+
+    /**
+     * Caching is enabled for all entities except those for which
+     * <code>Cacheable(false) is specified.  Entities for which
+     * <code>Cacheable(false) is specified are not cached.
+     */
+    DISABLE_SELECTIVE, 
+
+    /**
+     * 
+     * Caching behavior is undefined: provider-specific defaults may apply.
+     */
+    UNSPECIFIED
+}
diff --git a/src/javax/persistence/SqlResultSetMapping.java b/src/javax/persistence/SqlResultSetMapping.java
new file mode 100644
index 0000000..0db0dd5
--- /dev/null
+++ b/src/javax/persistence/SqlResultSetMapping.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/** 
+ * Specifies the mapping of the result of a native SQL query or stored 
+ * procedure.
+ *
+ * <pre>
+ *    Example:
+ *
+ *    Query q = em.createNativeQuery(
+ *        "SELECT o.id AS order_id, " +
+ *            "o.quantity AS order_quantity, " +
+ *            "o.item AS order_item, " +
+ *            "i.name AS item_name, " +
+ *        "FROM Order o, Item i " +
+ *        "WHERE (order_quantity > 25) AND (order_item = i.id)",
+ *    "OrderResults");
+ *    
+ *    @SqlResultSetMapping(name="OrderResults", 
+ *        entities={ 
+ *            @EntityResult(entityClass=com.acme.Order.class, fields={
+ *                @FieldResult(name="id", column="order_id"),
+ *                @FieldResult(name="quantity", column="order_quantity"), 
+ *                @FieldResult(name="item", column="order_item")})},
+ *        columns={
+ *            @ColumnResult(name="item_name")}
+ *    )
+ * </pre>
+ *
+ * @see Query
+ * @see StoredProcedureQuery
+ * @see NamedNativeQuery
+ * @see NamedStoredProcedureQuery
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface SqlResultSetMapping { 
+
+    /** 
+     * The name given to the result set mapping, and used to refer 
+     * to it in the methods of the {@link Query} and 
+     * {@link StoredProcedureQuery} APIs.
+     */
+    String name(); 
+
+    /** Specifies the result set mapping to entities. */
+    EntityResult[] entities() default {};
+
+    /** 
+     * Specifies the result set mapping to constructors. 
+     * @since Java Persistence 2.1
+     */
+    ConstructorResult[] classes() default {};
+
+    /** Specifies the result set mapping to scalar values. */
+    ColumnResult[] columns() default {};
+}
diff --git a/src/javax/persistence/SqlResultSetMappings.java b/src/javax/persistence/SqlResultSetMappings.java
new file mode 100644
index 0000000..82f073b
--- /dev/null
+++ b/src/javax/persistence/SqlResultSetMappings.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Is used to define one or more {@link SqlResultSetMapping} annotations.
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE}) 
+ at Retention(RUNTIME)
+public @interface SqlResultSetMappings { 
+
+    /** One or more <code>SqlResultSetMapping</code> annotations. */
+    SqlResultSetMapping[] value();
+}
diff --git a/src/javax/persistence/StoredProcedureParameter.java b/src/javax/persistence/StoredProcedureParameter.java
new file mode 100644
index 0000000..0a9bf2e
--- /dev/null
+++ b/src/javax/persistence/StoredProcedureParameter.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a parameter of a named stored procedure query.  All
+ * parameters of a named stored procedure query must be specified.
+ *
+ * @see NamedStoredProcedureQuery
+ * @see ParameterMode 
+ *
+ * @since Java Persistence 2.1
+ */
+ at Target({}) 
+ at Retention(RUNTIME)
+public @interface StoredProcedureParameter { 
+
+    /** 
+     *  The name of the parameter as defined by the stored procedure in the database.
+     *  If a name is not specified, it is assumed that the stored procedure uses
+     *  positional parameters.
+     */
+    String name() default "";
+
+    /**
+     *  Specifies whether the parameter is an IN, INOUT, OUT, or REF_CURSOR parameter.
+     *  REF_CURSOR parameters are used by some databases to return result sets from
+     *  a stored procedure.
+     */
+    ParameterMode mode() default ParameterMode.IN;
+
+    /** JDBC type of the paramter. */
+    Class type();
+
+}
diff --git a/src/javax/persistence/StoredProcedureQuery.java b/src/javax/persistence/StoredProcedureQuery.java
new file mode 100644
index 0000000..7b4265f
--- /dev/null
+++ b/src/javax/persistence/StoredProcedureQuery.java
@@ -0,0 +1,398 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Interface used to control stored procedure query execution.
+ *
+ * <p>
+ * Stored procedure query execution may be controlled in accordance with 
+ * the following:
+ * <p>
+ * <ul>
+ * <li>The <code>setParameter</code> methods are used to set the values of 
+ * all required <code>IN</code> and <code>INOUT</code> parameters.  
+ * It is not required to set the values of stored procedure parameters 
+ * for which default values have been defined by the stored procedure.</li>
+ * <li>
+ * When <code>getResultList</code> and <code>getSingleResult</code> are
+ * called on a <code>StoredProcedureQuery</code> object, the provider 
+ * will call <code>execute</code> on an unexecuted stored procedure 
+ * query before processing <code>getResultList</code> or
+ * <code>getSingleResult</code>.</li>
+ * <li>
+ * When <code>executeUpdate</code> is called on a 
+ * <code>StoredProcedureQuery</code> object, the provider will call 
+ * <code>execute</code> on an unexecuted stored procedure query
+ *  followed by <code>getUpdateCount</code>.  The results of 
+ * <code>executeUpdate</code> will be those of <code>getUpdateCount</code>.</li>
+ * <li>
+ * The <code>execute</code> method supports both the simple case where 
+ * scalar results are passed back only via <code>INOUT</code> and 
+ * <code>OUT</code> parameters as well as the most general case 
+ * (multiple result sets and/or update counts, possibly also in 
+ * combination with output parameter values).</li>
+ * <li>
+ * The <code>execute</code> method returns true if the first result is a 
+ * result set, and false if it is an update count or there are no results 
+ * other than through <code>INOUT</code> and <code>OUT</code> parameters, 
+ * if any.</li>
+ * <li>
+ * If the <code>execute</code> method returns true, the pending result set 
+ * can be obtained by calling <code>getResultList</code> or
+ * <code>getSingleResult</code>.</li>
+ * <li>
+ * The <code>hasMoreResults</code> method can then be used to test 
+ * for further results.</li>
+ * <li>
+ * If <code>execute</code> or <code>hasMoreResults</code> returns false, 
+ * the <code>getUpdateCount</code> method can be called to obtain the 
+ * pending result if it is an update count.  The <code>getUpdateCount</code>
+ * method will return either the update count (zero or greater) or -1 
+ * if there is no update count (i.e., either the next result is a result set 
+ * or there is no next update count).</li>
+ * <li>
+ * For portability, results that correspond to JDBC result sets and 
+ * update counts need to be processed before the values of any 
+ * <code>INOUT</code> or <code>OUT</code> parameters are extracted.</li>
+ * <li>
+ * After results returned through <code>getResultList</code> and 
+ * <code>getUpdateCount</code> have been exhausted, results returned through 
+ * <code>INOUT</code> and <code>OUT</code> parameters can be retrieved.</li>
+ * <li>
+ * The <code>getOutputParameterValue</code> methods are used to retrieve 
+ * the values passed back from the procedure through <code>INOUT</code> 
+ * and <code>OUT</code> parameters.</li>
+ * <li>
+ * When using <code>REF_CURSOR</code> parameters for result sets the
+ * update counts should be exhausted before calling <code>getResultList</code>
+ * to retrieve the result set.  Alternatively, the <code>REF_CURSOR</code>
+ * result set can be retrieved through <code>getOutputParameterValue</code>.
+ * Result set mappings will be applied to results corresponding to
+ * <code>REF_CURSOR</code> parameters in the order the <code>REF_CURSOR</code>
+ * parameters were registered with the query.</li>
+ * <li>
+ * In the simplest case, where results are returned only via 
+ * <code>INOUT</code> and <code>OUT</code> parameters, <code>execute</code>
+ * can be followed immediately by calls to 
+ * <code>getOutputParameterValue</code>.</li>
+ * </ul>
+ *
+ * @see Query
+ * @see Parameter
+ *
+ * @since Java Persistence 2.1
+ */
+public interface StoredProcedureQuery extends Query {
+
+    /**
+     * Set a query property or hint. The hints elements may be used 
+     * to specify query properties and hints. Properties defined by
+     * this specification must be observed by the provider. 
+     * Vendor-specific hints that are not recognized by a provider
+     * must be silently ignored. Portable applications should not
+     * rely on the standard timeout hint. Depending on the database
+     * in use, this hint may or may not be observed.
+     * @param hintName  name of the property or hint
+     * @param value  value for the property or hint
+     * @return the same query instance
+     * @throws IllegalArgumentException if the second argument is not
+     *         valid for the implementation
+     */
+    StoredProcedureQuery setHint(String hintName, Object value);
+
+    /**
+     * Bind the value of a <code>Parameter</code> object.
+     * @param param  parameter object
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     */
+    <T> StoredProcedureQuery setParameter(Parameter<T> param, 
+                                          T value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a <code>Parameter</code> object.
+     * @param param parameter object
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     */
+    StoredProcedureQuery setParameter(Parameter<Calendar> param,
+                                      Calendar value, 
+                                      TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a <code>Parameter</code> object.
+     * @param param parameter object
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     */
+    StoredProcedureQuery setParameter(Parameter<Date> param, 
+                                      Date value, 
+                                      TemporalType temporalType);
+
+    /**
+     * Bind an argument value to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if the
+     *         argument is of incorrect type
+     */
+    StoredProcedureQuery setParameter(String name, Object value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if the
+     *         value argument is of incorrect type
+     */
+    StoredProcedureQuery setParameter(String name, 
+                                      Calendar value, 
+                                      TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if the
+     *         value argument is of incorrect type
+     */
+    StoredProcedureQuery setParameter(String name, 
+                                      Date value, 
+                                      TemporalType temporalType);
+
+    /**
+     * Bind an argument value to a positional parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query
+     *         or if the argument is of incorrect type
+     */
+    StoredProcedureQuery setParameter(int position, Object value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a positional
+     * parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query or
+     *         if the value argument is of incorrect type
+     */
+    StoredProcedureQuery setParameter(int position, 
+                                      Calendar value,  
+                                      TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a positional parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query or
+     *         if the value argument is of incorrect type
+     */
+    StoredProcedureQuery setParameter(int position, 
+                                      Date 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  flush mode
+     * @return the same query instance
+     */
+    StoredProcedureQuery setFlushMode(FlushModeType flushMode);
+
+    /**
+     * Register a positional parameter.
+     * All parameters must be registered.
+     * @param position  parameter position
+     * @param type  type of the parameter
+     * @param mode  parameter mode 
+     * @return the same query instance
+     */
+    StoredProcedureQuery registerStoredProcedureParameter(
+	  int position,
+	  Class type,
+	  ParameterMode mode);
+
+    /**
+     * Register a named parameter.
+     * @param parameterName  name of the parameter as registered or
+     *             specified in metadata
+     * @param type  type of the parameter
+     * @param mode  parameter mode 
+     * @return the same query instance
+     */
+    StoredProcedureQuery registerStoredProcedureParameter(
+	  String parameterName,
+	  Class type,
+	  ParameterMode mode);
+
+    /**
+     *  Retrieve a value passed back from the procedure
+     *  through an INOUT or OUT parameter.
+     *  For portability, all results corresponding to result sets
+     *  and update counts must be retrieved before the values of 
+     *  output parameters.
+     *  @param position  parameter position
+     *  @return the result that is passed back through the parameter
+     *  @throws IllegalArgumentException if the position does
+     *          not correspond to a parameter of the query or is
+     *          not an INOUT or OUT parameter
+     */
+    Object getOutputParameterValue(int position);
+
+    /**
+     *  Retrieve a value passed back from the procedure
+     *  through an INOUT or OUT parameter.
+     *  For portability, all results corresponding to result sets
+     *  and update counts must be retrieved before the values of 
+     *  output parameters.
+     *  @param parameterName  name of the parameter as registered or
+     *              specified in metadata
+     *  @return the result that is passed back through the parameter
+     *  @throws IllegalArgumentException if the parameter name does
+     *          not correspond to a parameter of the query or is
+     *          not an INOUT or OUT parameter
+     */
+    Object getOutputParameterValue(String parameterName);
+
+    /**
+     * Return true if the first result corresponds to a result set,
+     * and false if it is an update count or if there are no results
+     * other than through INOUT and OUT parameters, if any.
+     * @return  true if first result corresponds to result set
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    boolean execute();
+
+    /**
+     * Return the update count of -1 if there is no pending result or
+     * if the first result is not an update count.  The provider will
+     * call <code>execute</code> on the query if needed.
+     * @return the update count or -1 if there is no pending result
+     * or if the next result is not an update count.
+     * @throws TransactionRequiredException if there is 
+     *         no transaction or the persistence context has not
+     *         been joined to the transaction
+     * @throws QueryTimeoutException if the statement execution 
+     *         exceeds the query timeout value set and only 
+     *         the statement is rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    int executeUpdate();
+
+    /**
+     * Retrieve the list of results from the next result set.
+     * The provider will call <code>execute</code> on the query
+     * if needed.
+     * A <code>REF_CURSOR</code> result set, if any, will be retrieved
+     * in the order the <code>REF_CURSOR</code> parameter was 
+     * registered with the query.
+     * @return a list of the results or null is the next item is not 
+     * a result set
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    List getResultList();
+
+    /**
+     * Retrieve a single result from the next result set.
+     * The provider will call <code>execute</code> on the query
+     * if needed.
+     * A <code>REF_CURSOR</code> result set, if any, will be retrieved
+     * in the order the <code>REF_CURSOR</code> parameter was 
+     * registered with the query.
+     * @return the result or null if the next item is not a result set
+     * @throws NoResultException if there is no result in the next
+     *         result set
+     * @throws NonUniqueResultException if more than one result
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    Object getSingleResult();
+
+    /**
+     * Return true if the next result corresponds to a result set,
+     * and false if it is an update count or if there are no results
+     * other than through INOUT and OUT parameters, if any.
+     * @return  true if next result corresponds to result set
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    boolean hasMoreResults();
+
+    /**
+     * Return the update count or  -1 if there is no pending result
+     * or if the next result is not an update count.
+     * @return  update count or -1 if there is no pending result or if
+     *          the next result is not an update count
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    int getUpdateCount();
+
+}
diff --git a/src/javax/persistence/Subgraph.java b/src/javax/persistence/Subgraph.java
new file mode 100644
index 0000000..95c565a
--- /dev/null
+++ b/src/javax/persistence/Subgraph.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import javax.persistence.metamodel.Attribute;
+import java.util.List;
+
+/**
+ * This type represents a subgraph for an attribute node that
+ * corresponds to a Managed Type. Using this class, an entity subgraph
+ * can be embedded within an EntityGraph.
+ *
+ * @param <T> The type of the attribute.
+ *
+ * @see EntityGraph
+ * @see AttributeNode
+ * @see NamedSubgraph
+ *
+ * @since Java Persistence 2.1
+ */
+public interface Subgraph<T> {
+
+    /**
+     * Add one or more attribute nodes to the entity graph.
+     *
+     * @param attributeName  name of the attribute     
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this managed type.
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public void addAttributeNodes(String ... attributeName);
+
+    /**
+     * Add one or more attribute nodes to the entity graph.
+     * @param attribute  attribute
+     *
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public void addAttributeNodes(Attribute<T, ?> ... attribute);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type. This allows for construction of multi-node entity graphs
+     * that include related managed types.
+     *
+     * @param attribute  attribute
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type
+     * @throws IllegalStateException if the EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addSubgraph(Attribute<T, X> attribute);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type with inheritance.  This allows for multiple subclass
+     * subgraphs to be defined for this node of the entity
+     * graph. Subclass subgraphs will automatically include the specified
+     * attributes of superclass subgraphs
+     *
+     * @param attribute  attribute
+     * @param type  entity subclass
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<? extends X> addSubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type. This allows for construction of multi-node entity graphs
+     * that include related managed types.
+     *
+     * @param attributeName  name of the attribute 
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this managed type.
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addSubgraph(String attributeName);
+
+    /**
+     * Add a node to the graph that corresponds to a managed
+     * type with inheritance.  This allows for multiple subclass
+     * subgraphs to be defined for this node of the entity
+     * graph. Subclass subgraphs will automatically include the
+     * specified attributes of superclass subgraphs
+     *
+     * @param attributeName  name of the attribute 
+     * @param type  entity subclass
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute is not 
+     *         an attribute of this managed type.
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addSubgraph(String attributeName, Class<X> type);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type. This allows for construction of
+     * multinode entity graphs that include related managed types.
+     *
+     * @param attribute  attribute
+     * @return subgraph for the key attribute
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type entity
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addKeySubgraph(Attribute<T, X> attribute);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type with inheritance. This allows for
+     * construction of multi-node entity graphs that include related
+     * managed types.  Subclass subgraphs will automatically include
+     * the specified attributes of superclass subgraphs
+     *
+     * @param attribute  attribute
+     * @param type  entity subclass
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type entity
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<? extends X> addKeySubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type. This allows for construction of
+     * multi-node entity graphs that include related managed types.
+     *
+     * @param attributeName  name of the attribute
+     * @return subgraph for the key attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this entity.
+     * @throws IllegalArgumentException if the attribute's target 
+     *         type is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been
+     *          statically defined
+     */
+    public <X> Subgraph<X> addKeySubgraph(String attributeName);
+
+    /**
+     * Add a node to the graph that corresponds to a map key
+     * that is a managed type with inheritance. This allows for
+     * construction of multi-node entity graphs that include related
+     * managed types.  Subclass subgraphs will include the specified
+     * attributes of superclass subgraphs
+     *
+     * @param attributeName  name of the attribute
+     * @param type  entity subclass
+     * @return subgraph for the attribute
+     * @throws IllegalArgumentException if the attribute is not an 
+     *         attribute of this entity.
+     * @throws IllegalArgumentException if the attribute's target
+     *         type is not a managed type
+     * @throws IllegalStateException if this EntityGraph has been 
+     *         statically defined
+     */
+    public <X> Subgraph<X> addKeySubgraph(String attributeName, Class<X> type);
+
+    /**
+     * Return the attribute nodes corresponding to the attributes of
+     * this managed type that are included in the subgraph.
+     * @return list of attribute nodes included in the subgraph or
+     * empty List if none have been defined
+     */
+    public List<AttributeNode<?>> getAttributeNodes();
+
+    /**
+     * Return the type for which this subgraph was defined.
+     * @return managed type referenced by the subgraph
+     */
+    public Class<T> getClassType();
+}
diff --git a/src/javax/persistence/SynchronizationType.java b/src/javax/persistence/SynchronizationType.java
new file mode 100644
index 0000000..de79e4a
--- /dev/null
+++ b/src/javax/persistence/SynchronizationType.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Specifies whether the persistence context is always automatically 
+ * synchronized with the current transaction or whether the persistence context
+ * must be explicitly joined to the current transaction by means of the
+ * {@link EntityManager#joinTransaction} method.
+ *
+ * @since Java Persistence 2.1
+ */
+public enum SynchronizationType {
+
+    /** Persistence context is automatically synchronized with the current transaction */
+    SYNCHRONIZED,
+
+    /** Persistence context must be explicitly joined to the current transaction */
+    UNSYNCHRONIZED,
+}
diff --git a/src/javax/persistence/Table.java b/src/javax/persistence/Table.java
new file mode 100644
index 0000000..e92b77c
--- /dev/null
+++ b/src/javax/persistence/Table.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the primary table for the annotated entity. Additional
+ * tables may be specified using {@link SecondaryTable} or {@link
+ * SecondaryTables} annotation.
+ *
+ * <p> If no <code>Table</code> annotation is specified for an entity 
+ * class, the default values apply.
+ *
+ * <pre>
+ *    Example:
+ *
+ *    @Entity
+ *    @Table(name="CUST", schema="RECORDS")
+ *    public class Customer { ... }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target(TYPE) 
+ at Retention(RUNTIME)
+public @interface Table {
+
+    /**
+     * (Optional) The name of the table.
+     * <p> Defaults to the entity name.
+     */
+    String name() default "";
+
+    /** (Optional) The catalog of the table.
+     * <p> Defaults to the default catalog.
+     */
+    String catalog() default "";
+
+    /** (Optional) The schema of the table.
+     * <p> Defaults to the default schema for user.
+     */
+    String schema() default "";
+
+    /**
+     * (Optional) 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 <code>Column</code> and <code>JoinColumn</code> 
+     * annotations and constraints entailed by primary key mappings.
+     * <p> Defaults to no additional constraints.
+     */
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    /**
+     * (Optional) Indexes for the table.  These are only used if
+     * table generation is in effect.  Note that it is not necessary
+     * to specify an index for a primary key, as the primary key
+     * index will be created automatically.
+     *
+     * @since Java Persistence 2.1 
+     */
+    Index[] indexes() default {};
+}
diff --git a/src/javax/persistence/TableGenerator.java b/src/javax/persistence/TableGenerator.java
new file mode 100644
index 0000000..4c4a0a7
--- /dev/null
+++ b/src/javax/persistence/TableGenerator.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Defines a primary key generator that may be 
+ * referenced by name when a generator element is specified for 
+ * the {@link 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).
+ *
+ * <pre>
+ *    Example 1:
+ *    
+ *    @Entity public class Employee {
+ *        ...
+ *        @TableGenerator(
+ *            name="empGen", 
+ *            table="ID_GEN", 
+ *            pkColumnName="GEN_KEY", 
+ *            valueColumnName="GEN_VALUE", 
+ *            pkColumnValue="EMP_ID", 
+ *            allocationSize=1)
+ *        @Id
+ *        @GeneratedValue(strategy=TABLE, generator="empGen")
+ *        int id;
+ *        ...
+ *    }
+ *    
+ *    Example 2:
+ *    
+ *    @Entity public class Address {
+ *        ...
+ *        @TableGenerator(
+ *            name="addressGen", 
+ *            table="ID_GEN", 
+ *            pkColumnName="GEN_KEY", 
+ *            valueColumnName="GEN_VALUE", 
+ *            pkColumnValue="ADDR_ID")
+ *        @Id
+ *        @GeneratedValue(strategy=TABLE, generator="addressGen")
+ *        int id;
+ *        ...
+ *    }
+ * </pre>
+ *
+ * @see GeneratedValue
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({TYPE, METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface TableGenerator {
+
+    /** 
+     * (Required) A unique generator name that can be referenced 
+     * by one or more classes to be the generator for id values.
+     */
+    String name();
+
+    /** 
+     * (Optional) Name of table that stores the generated id values. 
+     * <p> Defaults to a name chosen by persistence provider.
+     */
+    String table() default "";
+
+    /** (Optional) The catalog of the table. 
+     * <p> Defaults to the default catalog.
+     */
+    String catalog() default "";
+
+    /** (Optional) The schema of the table. 
+     * <p> Defaults to the default schema for user.
+     */
+    String schema() default "";
+
+    /** 
+     * (Optional) Name of the primary key column in the table.
+     * <p> Defaults to a provider-chosen name.
+     */
+    String pkColumnName() default "";
+
+    /** 
+     * (Optional) Name of the column that stores the last value generated.
+     * <p> Defaults to a provider-chosen name.
+     */
+    String valueColumnName() default "";
+
+    /**
+     * (Optional) The primary key value in the generator table 
+     * that distinguishes this set of generated values from others 
+     * that may be stored in the table.
+     * <p> Defaults to a provider-chosen value to store in the 
+     * primary key column of the generator table
+     */
+    String pkColumnValue() default "";
+
+    /** 
+     * (Optional) The initial value to be used to initialize the column
+     * that stores the last value generated.
+     */
+    int initialValue() default 0;
+
+    /**
+     * (Optional) The amount to increment by when allocating id 
+     * numbers from the generator.
+     */
+    int allocationSize() default 50;
+
+    /**
+     * (Optional) 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.
+     * <p> Defaults to no additional constraints.
+     */
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    /**
+     * (Optional) Indexes for the table.  These are only used if
+     * table generation is in effect.  Note that it is not necessary
+     * to specify an index for a primary key, as the primary key
+     * index will be created automatically.
+     *
+     * @since Java Persistence 2.1 
+     */
+    Index[] indexes() default {};
+}
diff --git a/src/javax/persistence/Temporal.java b/src/javax/persistence/Temporal.java
new file mode 100644
index 0000000..b6c40ec
--- /dev/null
+++ b/src/javax/persistence/Temporal.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation must be specified for persistent fields 
+ * or properties of type <code>java.util.Date</code> and 
+ * <code>java.util.Calendar</code>. It may only be specified for fields 
+ * or properties of these types.
+ * 
+ * <p> The <code>Temporal</code> annotation may be used in 
+ * conjunction with the {@link Basic} annotation, the {@link Id}
+ * annotation, or the {@link ElementCollection} annotation (when
+ * the element collection value is of such a temporal type.
+ *
+ * <pre>
+ *     Example:
+ * 
+ *     @Temporal(DATE)
+ *     protected java.util.Date endDate;
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD}) 
+ at Retention(RUNTIME)
+public @interface Temporal {
+
+    /** The type used in mapping <code>java.util.Date</code> or <code>java.util.Calendar</code>. */
+    TemporalType value();
+}
diff --git a/src/javax/persistence/TemporalType.java b/src/javax/persistence/TemporalType.java
new file mode 100644
index 0000000..a0ad8dd
--- /dev/null
+++ b/src/javax/persistence/TemporalType.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Type used to indicate a specific mapping of <code>java.util.Date</code> 
+ * or <code>java.util.Calendar</code>.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum TemporalType {
+
+    /** Map as <code>java.sql.Date</code> */
+    DATE, 
+
+    /** Map as <code>java.sql.Time</code> */
+    TIME, 
+
+    /** Map as <code>java.sql.Timestamp</code> */
+    TIMESTAMP
+}
diff --git a/src/javax/persistence/TransactionRequiredException.java b/src/javax/persistence/TransactionRequiredException.java
new file mode 100644
index 0000000..abd2274
--- /dev/null
+++ b/src/javax/persistence/TransactionRequiredException.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when a transaction is required but is not
+ * active.
+ * 
+ * @since Java Persistence 1.0
+ */
+public class TransactionRequiredException extends PersistenceException {
+
+	/**
+	 * Constructs a new <code>TransactionRequiredException</code> exception with
+	 * <code>null</code> as its detail message.
+	 */
+	public TransactionRequiredException() {
+		super();
+	}
+
+	/**
+	 * Constructs a new <code>TransactionRequiredException</code> exception with
+	 * the specified detail message.
+	 * 
+	 * @param message
+	 *            the detail message.
+	 */
+	public TransactionRequiredException(String message) {
+		super(message);
+	}
+}
diff --git a/src/javax/persistence/Transient.java b/src/javax/persistence/Transient.java
new file mode 100644
index 0000000..81446af
--- /dev/null
+++ b/src/javax/persistence/Transient.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 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.
+ *
+ * <pre>
+ *    Example:
+ *
+ *    @Entity
+ *    public class Employee {
+ *        @Id int id;
+ *        @Transient User currentUser;
+ *        ...
+ *    }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+
+public @interface Transient {}
diff --git a/src/javax/persistence/Tuple.java b/src/javax/persistence/Tuple.java
new file mode 100644
index 0000000..6a68b14
--- /dev/null
+++ b/src/javax/persistence/Tuple.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.util.List;
+
+/**
+ * Interface for extracting the elements of a query result tuple.
+ *
+ * @see TupleElement
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Tuple {
+
+    /**
+     * Get the value of the specified tuple element.
+     * @param tupleElement  tuple element
+     * @return value of tuple element
+     * @throws IllegalArgumentException if tuple element
+     *         does not correspond to an element in the
+     *         query result tuple
+     */
+    <X> X get(TupleElement<X> tupleElement);
+
+    /**
+     * Get the value of the tuple element to which the
+     * specified alias has been assigned.
+     * @param alias  alias assigned to tuple element
+     * @param type of the tuple element
+     * @return value of the tuple element
+     * @throws IllegalArgumentException if alias
+     *         does not correspond to an element in the
+     *         query result tuple or element cannot be
+     *         assigned to the specified type
+     */
+    <X> X get(String alias, Class<X> type); 
+
+    /**
+     * Get the value of the tuple element to which the
+     * specified alias has been assigned.
+     * @param alias  alias assigned to tuple element
+     * @return value of the tuple element
+     * @throws IllegalArgumentException if alias
+     *         does not correspond to an element in the
+     *         query result tuple
+     */
+    Object get(String alias); 
+
+    /**
+     * Get the value of the element at the specified
+     * position in the result tuple. The first position is 0.
+     * @param i  position in result tuple
+     * @param type  type of the tuple element
+     * @return value of the tuple element
+     * @throws IllegalArgumentException if i exceeds
+     *         length of result tuple  or element cannot be
+     *         assigned to the specified type
+     */
+    <X> X get(int i, Class<X> type);
+
+    /**
+     * Get the value of the element at the specified
+     * position in the result tuple. The first position is 0.
+     * @param i  position in result tuple
+     * @return value of the tuple element
+     * @throws IllegalArgumentException if i exceeds
+     *         length of result tuple
+     */
+    Object get(int i);
+
+    /**
+     * Return the values of the result tuple elements as an array.
+     * @return tuple element values
+     */
+    Object[] toArray();
+
+    /**
+     * Return the tuple elements.
+     * @return tuple elements
+     */
+    List<TupleElement<?>> getElements();
+}
diff --git a/src/javax/persistence/TupleElement.java b/src/javax/persistence/TupleElement.java
new file mode 100644
index 0000000..ff9ff49
--- /dev/null
+++ b/src/javax/persistence/TupleElement.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+/**
+ * The <code>TupleElement</code> interface defines an element that is returned in
+ * a query result tuple.
+ * @param <X> the type of the element
+ *
+ * @see Tuple
+ *
+ * @since Java Persistence 2.0
+ */
+public interface TupleElement<X> {
+    
+    /**
+     * Return the Java type of the tuple element.
+     * @return the Java type of the tuple element
+     */
+    Class<? extends X> getJavaType();
+
+    /**
+     * Return the alias assigned to the tuple element or null, 
+     * if no alias has been assigned.
+     * @return alias
+     */
+    String getAlias();
+}
diff --git a/src/javax/persistence/TypedQuery.java b/src/javax/persistence/TypedQuery.java
new file mode 100644
index 0000000..3a42b49
--- /dev/null
+++ b/src/javax/persistence/TypedQuery.java
@@ -0,0 +1,244 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.util.List;
+import java.util.Date;
+import java.util.Calendar;
+
+/**
+ * Interface used to control the execution of typed queries.
+ * @param <X> query result type
+ *
+ * @see Query
+ * @see Parameter
+ *
+ * @since Java Persistence 2.0
+ */
+public interface TypedQuery<X> extends Query {
+	
+    /**
+     * Execute a SELECT query and return the query results
+     * as a typed List.
+     * @return a list of the results
+     * @throws IllegalStateException if called for a Java
+     *         Persistence query language UPDATE or DELETE statement
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws TransactionRequiredException if a lock mode other than
+     *         <code>NONE</code> has been set and there is no transaction
+     *         or the persistence context has not been joined to the
+     *         transaction
+     * @throws PessimisticLockException if pessimistic locking
+     *         fails and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking
+     *         fails and only the statement is rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    List<X> 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
+     * @throws QueryTimeoutException if the query execution exceeds
+     *         the query timeout value set and only the statement is
+     *         rolled back
+     * @throws TransactionRequiredException if a lock mode other than
+     *         <code>NONE</code> has been set and there is no transaction
+     *         or the persistence context has not been joined to the
+     *         transaction
+     * @throws PessimisticLockException if pessimistic locking
+     *         fails and the transaction is rolled back
+     * @throws LockTimeoutException if pessimistic locking
+     *         fails and only the statement is rolled back
+     * @throws PersistenceException if the query execution exceeds 
+     *         the query timeout value set and the transaction 
+     *         is rolled back 
+     */
+    X getSingleResult();
+
+    /**
+     * Set the maximum number of results to retrieve.
+     * @param maxResult  maximum number of results to retrieve
+     * @return the same query instance
+     * @throws IllegalArgumentException if the argument is negative
+     */
+    TypedQuery<X> 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 the argument is negative
+     */
+    TypedQuery<X> setFirstResult(int startPosition);
+
+    /**
+     * Set a query property or hint. The hints elements may be used 
+     * to specify query properties and hints. Properties defined by
+     * this specification must be observed by the provider. 
+     * Vendor-specific hints that are not recognized by a provider
+     * must be silently ignored. Portable applications should not
+     * rely on the standard timeout hint. Depending on the database
+     * in use and the locking mechanisms used by the provider,
+     * this hint may or may not be observed.
+     * @param hintName  name of property or hint
+     * @param value  value for the property or hint
+     * @return the same query instance
+     * @throws IllegalArgumentException if the second argument is not
+     *         valid for the implementation
+     */
+    TypedQuery<X> setHint(String hintName, Object value);
+
+    /**
+     * Bind the value of a <code>Parameter</code> object.
+     * @param param  parameter object
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter
+     *         does not correspond to a parameter of the
+     *         query
+     */
+     <T> TypedQuery<X> setParameter(Parameter<T> param, T value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a <code>Parameter</code> object.
+     * @param param  parameter object
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     */
+    TypedQuery<X> setParameter(Parameter<Calendar> param, 
+                               Calendar value,  
+                               TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a <code>Parameter</code> object.
+     * @param param  parameter object
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter does not
+     *         correspond to a parameter of the query
+     */
+    TypedQuery<X> setParameter(Parameter<Date> param, Date value,  
+                               TemporalType temporalType);
+
+    /**
+     * Bind an argument value to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does 
+     *         not correspond to a parameter of the query or if
+     *         the argument is of incorrect type
+     */
+    TypedQuery<X> setParameter(String name, Object value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a named parameter.
+     * @param name  parameter name
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does
+     *         not correspond to a parameter of the query or if 
+     *         the value argument is of incorrect type
+     */
+    TypedQuery<X> setParameter(String name, Calendar value, 
+                               TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a named parameter.
+     * @param name   parameter name
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if the parameter name does
+     *         not correspond to a parameter of the query or if 
+     *         the value argument is of incorrect type
+     */
+    TypedQuery<X> setParameter(String name, Date value, 
+                               TemporalType temporalType);
+
+    /**
+     * Bind an argument value to a positional parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the
+     *         query or if the argument is of incorrect type
+     */
+    TypedQuery<X> setParameter(int position, Object value);
+
+    /**
+     * Bind an instance of <code>java.util.Calendar</code> to a positional
+     * parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query
+     *         or if the value argument is of incorrect type
+     */
+    TypedQuery<X> setParameter(int position, Calendar value,  
+                               TemporalType temporalType);
+
+    /**
+     * Bind an instance of <code>java.util.Date</code> to a positional parameter.
+     * @param position  position
+     * @param value  parameter value
+     * @param temporalType  temporal type
+     * @return the same query instance
+     * @throws IllegalArgumentException if position does not
+     *         correspond to a positional parameter of the query
+     *         or if the value argument is of incorrect type
+     */
+    TypedQuery<X> setParameter(int position, Date 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  flush mode
+      * @return the same query instance
+      */
+     TypedQuery<X> setFlushMode(FlushModeType flushMode);
+
+     /**
+      * Set the lock mode type to be used for the query execution.
+      * @param lockMode  lock mode
+      * @return the same query instance
+      * @throws IllegalStateException if the query is found not to 
+      *         be a Java Persistence query language SELECT query
+      *         or a CriteriaQuery query
+      */
+     TypedQuery<X> setLockMode(LockModeType lockMode);
+
+}
diff --git a/src/javax/persistence/UniqueConstraint.java b/src/javax/persistence/UniqueConstraint.java
new file mode 100644
index 0000000..2351b45
--- /dev/null
+++ b/src/javax/persistence/UniqueConstraint.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that a unique constraint is to be included in
+ * the generated DDL for a primary or secondary table.
+ *
+ * <pre>
+ *    Example:
+ *    @Entity
+ *    @Table(
+ *        name="EMPLOYEE", 
+ *        uniqueConstraints=
+ *            @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
+ *    )
+ *    public class Employee { ... }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({}) 
+ at Retention(RUNTIME)
+public @interface UniqueConstraint {
+
+    /** (Optional) Constraint name.  A provider-chosen name will be chosen
+     * if a name is not specified.
+     *
+     * @since Java Persistence 2.0
+     */
+    String name() default "";
+
+    /** (Required) An array of the column names that make up the constraint. */
+    String[] columnNames();
+}
diff --git a/src/javax/persistence/ValidationMode.java b/src/javax/persistence/ValidationMode.java
new file mode 100644
index 0000000..2118538
--- /dev/null
+++ b/src/javax/persistence/ValidationMode.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * The validation mode to be used by the provider for the persistence
+ * unit.
+ * 
+ * @since Java Persistence 2.0
+ */
+public enum ValidationMode {
+   
+    /**
+     * If a Bean Validation provider is present in the environment,
+     * the persistence provider must perform the automatic validation
+     * of entities.  If no Bean Validation provider is present in the
+     * environment, no lifecycle event validation takes place.
+     * This is the default behavior.
+     */
+    AUTO,
+
+    /**
+     * The persistence provider must perform the lifecycle event
+     * validation.  It is an error if there is no Bean Validation
+     * provider present in the environment.
+     */
+    CALLBACK,
+
+    /**
+     * The persistence provider must not perform lifecycle event validation.
+     */
+    NONE
+    }
diff --git a/src/javax/persistence/Version.java b/src/javax/persistence/Version.java
new file mode 100644
index 0000000..af82cd9
--- /dev/null
+++ b/src/javax/persistence/Version.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 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.
+ *
+ * <p> Only a single <code>Version</code> property or field 
+ * should be used per class; applications that use more than one 
+ * <code>Version</code> property or field will not be portable. 
+ * 
+ * <p> The <code>Version</code> property should be mapped to 
+ * the primary table for the entity class; applications that 
+ * map the <code>Version</code> property to a table other than 
+ * the primary table will not be portable.
+ * 
+ * <p> The following types are supported for version properties: 
+ * <code>int</code>, <code>Integer</code>, <code>short</code>, 
+ * <code>Short</code>, <code>long</code>, <code>Long</code>, 
+ * <code>java.sql.Timestamp</code>.
+ *
+ * <pre>
+ *    Example:
+ *
+ *    @Version
+ *    @Column(name="OPTLOCK")
+ *    protected int getVersionNum() { return versionNum; }
+ * </pre>
+ *
+ * @since Java Persistence 1.0
+ */
+ at Target({METHOD, FIELD})
+ at Retention(RUNTIME)
+public @interface Version {}
diff --git a/src/javax/persistence/criteria/AbstractQuery.java b/src/javax/persistence/criteria/AbstractQuery.java
new file mode 100644
index 0000000..53624dd
--- /dev/null
+++ b/src/javax/persistence/criteria/AbstractQuery.java
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+import javax.persistence.metamodel.EntityType;
+
+/**
+ * The <code>AbstractQuery</code> interface defines functionality that is common
+ * to both top-level queries and subqueries.
+ * It is not intended to be used directly in query construction.
+ *
+ * <p> All queries must have:
+ *         a set of root entities (which may in turn own joins).
+ * <p> All queries may have:
+ *         a conjunction of restrictions.
+ *
+ * @param <T>  the type of the result
+ *
+ * @since Java Persistence 2.0
+ */
+public interface AbstractQuery<T> extends CommonAbstractCriteria {
+
+    /**
+     * Create and add a query root corresponding to the given entity,
+     * forming a cartesian product with any existing roots.
+     * @param entityClass  the entity class
+     * @return query root corresponding to the given entity
+     */
+    <X> Root<X> from(Class<X> entityClass);
+
+    /**
+     * Create and add a query root corresponding to the given entity,
+     * forming a cartesian product with any existing roots.
+     * @param entity  metamodel entity representing the entity
+     *                of type X
+     * @return query root corresponding to the given entity
+     */
+    <X> Root<X> from(EntityType<X> entity);
+
+    /**
+     * Modify the query to restrict the query results according
+     * to the specified boolean expression.
+     * Replaces the previously added restriction(s), if any.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified query
+     */    
+    AbstractQuery<T> where(Expression<Boolean> restriction);
+
+    /**
+     * Modify the query to restrict the query results according 
+     * to the conjunction of the specified restriction predicates.
+     * Replaces the previously added restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified query
+     */
+    AbstractQuery<T> where(Predicate... restrictions);
+
+    /**
+     * Specify the expressions that are used to form groups over
+     * the query results.
+     * Replaces the previous specified grouping expressions, if any.
+     * If no grouping expressions are specified, any previously 
+     * added grouping expressions are simply removed.
+     * @param grouping  zero or more grouping expressions
+     * @return the modified query
+     */
+    AbstractQuery<T> groupBy(Expression<?>... grouping);
+
+    /**
+     * Specify the expressions that are used to form groups over
+     * the query results.
+     * Replaces the previous specified grouping expressions, if any.
+     * If no grouping expressions are specified, any previously 
+     * added grouping expressions are simply removed.
+     * @param grouping  list of zero or more grouping expressions
+     * @return the modified query
+     */
+    AbstractQuery<T> groupBy(List<Expression<?>> grouping);
+
+    /**
+     * Specify a restriction over the groups of the query.
+     * Replaces the previous having restriction(s), if any.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified query
+     */
+    AbstractQuery<T> having(Expression<Boolean> restriction);
+
+    /**
+     * Specify restrictions over the groups of the query
+     * according the conjunction of the specified restriction 
+     * predicates.
+     * Replaces the previously having added restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified query
+     */
+    AbstractQuery<T> having(Predicate... restrictions);
+
+    /**
+     * Specify whether duplicate query results will be eliminated.
+     * A true value will cause duplicates to be eliminated.
+     * A false value will cause duplicates to be retained.
+     * If distinct has not been specified, duplicate results must
+     * be retained.
+     * @param distinct  boolean value specifying whether duplicate
+     *        results must be eliminated from the query result or
+     *        whether they must be retained
+     * @return the modified query
+     */
+    AbstractQuery<T> distinct(boolean distinct);
+
+    /**
+     * Return the query roots.  These are the roots that have
+     * been defined for the <code>CriteriaQuery</code> or <code>Subquery</code> itself,
+     * including any subquery roots defined as a result of
+     * correlation. Returns empty set if no roots have been defined.
+     * Modifications to the set do not affect the query.
+     * @return the set of query roots
+     */   
+    Set<Root<?>> getRoots();
+
+    /**
+     *  Return the selection of the query, or null if no selection
+     *  has been set.
+     *  @return selection item 
+     */
+    Selection<T> getSelection();
+
+    /**
+     * Return a list of the grouping expressions.  Returns empty
+     * list if no grouping expressions have been specified.
+     * Modifications to the list do not affect the query.
+     * @return the list of grouping expressions
+     */
+    List<Expression<?>> getGroupList();
+
+    /**
+     * Return the predicate that corresponds to the restriction(s)
+     * over the grouping items, or null if no restrictions have 
+     * been specified.
+     * @return having clause predicate
+     */
+    Predicate getGroupRestriction();
+
+    /**
+     * Return whether duplicate query results must be eliminated or
+     * retained.
+     * @return boolean indicating whether duplicate query results 
+     *         must be eliminated
+     */
+    boolean isDistinct();
+
+    /**
+     * Return the result type of the query or subquery.  If a result
+     * type was specified as an argument to the
+     * <code>createQuery</code> or <code>subquery</code> method, that
+     * type will be returned.  If the query was created using the
+     * <code>createTupleQuery</code> method, the result type is
+     * <code>Tuple</code>.  Otherwise, the result type is
+     * <code>Object</code>.
+     * @return result type
+     */
+    Class<T> getResultType();  	
+}
diff --git a/src/javax/persistence/criteria/CollectionJoin.java b/src/javax/persistence/criteria/CollectionJoin.java
new file mode 100644
index 0000000..b661644
--- /dev/null
+++ b/src/javax/persistence/criteria/CollectionJoin.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.Collection;
+import javax.persistence.metamodel.CollectionAttribute;
+
+/**
+ * The <code>CollectionJoin</code> interface is the type of the result of
+ * joining to a collection over an association or element 
+ * collection that has been specified as a <code>java.util.Collection</code>.
+ *
+ * @param <Z> the source type of the join
+ * @param <E> the element type of the target <code>Collection</code> 
+ *
+ * @since Java Persistence 2.0
+ */
+public interface CollectionJoin<Z, E> 
+		extends PluralJoin<Z, Collection<E>, E> {
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restriction  a simple or compound boolean expression
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    CollectionJoin<Z, E> on(Expression<Boolean> restriction);
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restrictions  zero or more restriction predicates
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    CollectionJoin<Z, E> on(Predicate... restrictions);
+
+    /**
+     * Return the metamodel representation for the collection
+     * attribute.
+     * @return metamodel type representing the <code>Collection</code> that is
+     *         the target of the join
+     */
+    CollectionAttribute<? super Z, E> getModel();
+}
diff --git a/src/javax/persistence/criteria/CommonAbstractCriteria.java b/src/javax/persistence/criteria/CommonAbstractCriteria.java
new file mode 100644
index 0000000..71ecb58
--- /dev/null
+++ b/src/javax/persistence/criteria/CommonAbstractCriteria.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+/**
+ * The <code>CommonAbstractCriteria</code> interface defines functionality 
+ * that is common to both top-level criteria queries and subqueries as 
+ * well as to update and delete criteria operations.
+ * It is not intended to be used directly in query construction.
+ *
+ * <p> Note that criteria queries and criteria update and delete operations
+ * are typed differently.
+ * Criteria queries are typed according to the query result type.
+ * Update and delete operations are typed according to the target of the
+ * update or delete.
+ *
+ * @since Java Persistence 2.1
+ */
+public interface CommonAbstractCriteria {
+
+    /**
+     * Create a subquery of the query. 
+     * @param type  the subquery result type
+     * @return subquery 
+     */
+    <U> Subquery<U> subquery(Class<U> type);
+
+    /**
+     * Return the predicate that corresponds to the where clause
+     * restriction(s), or null if no restrictions have been
+     * specified.
+     * @return where clause predicate
+     */
+    Predicate getRestriction();
+ 
+}
diff --git a/src/javax/persistence/criteria/CompoundSelection.java b/src/javax/persistence/criteria/CompoundSelection.java
new file mode 100644
index 0000000..66b1feb
--- /dev/null
+++ b/src/javax/persistence/criteria/CompoundSelection.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+/**
+ * The <code>CompoundSelection</code> interface defines a compound selection item
+ * (tuple, array, or result of constructor).
+ *
+ * @param <X> the type of the selection item
+ *
+ * @since Java Persistence 2.0
+ */
+public interface CompoundSelection<X> extends Selection<X> {}
diff --git a/src/javax/persistence/criteria/CriteriaBuilder.java b/src/javax/persistence/criteria/CriteriaBuilder.java
new file mode 100644
index 0000000..9d4231f
--- /dev/null
+++ b/src/javax/persistence/criteria/CriteriaBuilder.java
@@ -0,0 +1,1532 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import javax.persistence.Tuple;
+
+/**
+ * Used to construct criteria queries, compound selections, 
+ * expressions, predicates, orderings.
+ *
+ * <p> Note that <code>Predicate</code> is used instead of <code>Expression<Boolean></code> 
+ * in this API in order to work around the fact that Java 
+ * generics are not compatible with varags.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface CriteriaBuilder {
+
+    /**
+     *  Create a <code>CriteriaQuery</code> object.
+     *  @return criteria query object
+     */
+    CriteriaQuery<Object> createQuery();
+
+    /**
+     *  Create a <code>CriteriaQuery</code> object with the specified result 
+     *  type.
+     *  @param resultClass  type of the query result
+     *  @return criteria query object
+     */
+    <T> CriteriaQuery<T> createQuery(Class<T> resultClass);
+
+    /**
+     *  Create a <code>CriteriaQuery</code> object that returns a tuple of 
+     *  objects as its result.
+     *  @return criteria query object
+     */
+    CriteriaQuery<Tuple> createTupleQuery();
+
+    // methods to construct queries for bulk updates and deletes:
+
+    /**
+     *  Create a <code>CriteriaUpdate</code> query object to perform a bulk update operation.
+     *  @param targetEntity  target type for update operation
+     *  @return the query object
+     *  @since Java Persistence 2.1
+     */
+    <T> CriteriaUpdate<T> createCriteriaUpdate(Class<T> targetEntity);
+
+    /**
+     *  Create a <code>CriteriaDelete</code> query object to perform a bulk delete operation.
+     *  @param targetEntity  target type for delete operation
+     *  @return the query object
+     *  @since Java Persistence 2.1
+     */
+    <T> CriteriaDelete<T> createCriteriaDelete(Class<T> targetEntity);
+
+
+    // selection construction methods:
+	
+    /**
+     * Create a selection item corresponding to a constructor.
+     * This method is used to specify a constructor that will be
+     * applied to the results of the query execution. If the
+     * constructor is for an entity class, the resulting entities
+     * will be in the new state after the query is executed.
+     * @param resultClass  class whose instance is to be constructed
+     * @param selections  arguments to the constructor
+     * @return compound selection item
+     * @throws IllegalArgumentException if an argument is a 
+     *         tuple- or array-valued selection item
+     */
+    <Y> CompoundSelection<Y> construct(Class<Y> resultClass, Selection<?>... selections);
+
+    /**
+     * Create a tuple-valued selection item.
+     * @param selections  selection items
+     * @return tuple-valued compound selection
+     * @throws IllegalArgumentException if an argument is a 
+     *         tuple- or array-valued selection item
+     */
+    CompoundSelection<Tuple> tuple(Selection<?>... selections);
+
+    /**
+     * Create an array-valued selection item.
+     * @param selections  selection items
+     * @return array-valued compound selection
+     * @throws IllegalArgumentException if an argument is a 
+     *         tuple- or array-valued selection item
+     */
+    CompoundSelection<Object[]> array(Selection<?>... selections);
+
+
+    //ordering:
+	
+    /**
+     * Create an ordering by the ascending value of the expression.
+     * @param x  expression used to define the ordering
+     * @return ascending ordering corresponding to the expression
+     */
+    Order asc(Expression<?> x);
+
+    /**
+     * Create an ordering by the descending value of the expression.
+     * @param x  expression used to define the ordering
+     * @return descending ordering corresponding to the expression
+     */
+    Order desc(Expression<?> x);
+
+	
+    //aggregate functions:
+	
+    /**
+     * Create an aggregate expression applying the avg operation.
+     * @param x  expression representing input value to avg operation
+     * @return avg expression
+     */
+    <N extends Number> Expression<Double> avg(Expression<N> x);
+
+    /**
+     * Create an aggregate expression applying the sum operation.
+     * @param x  expression representing input value to sum operation
+     * @return sum expression
+     */
+    <N extends Number> Expression<N> sum(Expression<N> x);
+
+    /**
+     * Create an aggregate expression applying the sum operation to an
+     * Integer-valued expression, returning a Long result.
+     * @param x  expression representing input value to sum operation
+     * @return sum expression
+     */
+    Expression<Long> sumAsLong(Expression<Integer> x);
+
+    /**
+     * Create an aggregate expression applying the sum operation to a
+     * Float-valued expression, returning a Double result.
+     * @param x  expression representing input value to sum operation
+     * @return sum expression
+     */
+    Expression<Double> sumAsDouble(Expression<Float> x);
+    
+    /**
+     * Create an aggregate expression applying the numerical max 
+     * operation.
+     * @param x  expression representing input value to max operation
+     * @return max expression
+     */
+    <N extends Number> Expression<N> max(Expression<N> x);
+    
+    /**
+     * Create an aggregate expression applying the numerical min 
+     * operation.
+     * @param x  expression representing input value to min operation
+     * @return min expression
+     */
+    <N extends Number> Expression<N> min(Expression<N> x);
+
+    /**
+     * Create an aggregate expression for finding the greatest of
+     * the values (strings, dates, etc).
+     * @param x  expression representing input value to greatest
+     *           operation
+     * @return greatest expression
+     */
+    <X extends Comparable<? super X>> Expression<X> greatest(Expression<X> x);
+    
+    /**
+     * Create an aggregate expression for finding the least of
+     * the values (strings, dates, etc).
+     * @param x  expression representing input value to least
+     *           operation
+     * @return least expression
+     */
+    <X extends Comparable<? super X>> Expression<X> least(Expression<X> x);
+
+    /**
+     * Create an aggregate expression applying the count operation.
+     * @param x  expression representing input value to count 
+     *           operation
+     * @return count expression
+     */
+    Expression<Long> count(Expression<?> x);
+
+    /**
+     * Create an aggregate expression applying the count distinct 
+     * operation.
+     * @param x  expression representing input value to 
+     *        count distinct operation
+     * @return count distinct expression
+     */
+    Expression<Long> countDistinct(Expression<?> x);
+	
+
+
+    //subqueries:
+	
+    /**
+     * Create a predicate testing the existence of a subquery result.
+     * @param subquery  subquery whose result is to be tested
+     * @return exists predicate
+     */
+    Predicate exists(Subquery<?> subquery);
+	
+    /**
+     * Create an all expression over the subquery results.
+     * @param subquery  subquery
+     * @return all expression
+     */
+    <Y> Expression<Y> all(Subquery<Y> subquery);
+	
+    /**
+     * Create a some expression over the subquery results.
+     * This expression is equivalent to an <code>any</code> expression.
+     * @param subquery  subquery
+     * @return some expression
+     */
+    <Y> Expression<Y> some(Subquery<Y> subquery);
+	
+    /**
+     * Create an any expression over the subquery results. 
+     * This expression is equivalent to a <code>some</code> expression.
+     * @param subquery  subquery
+     * @return any expression
+     */
+    <Y> Expression<Y> any(Subquery<Y> subquery);
+
+
+    //boolean functions:
+	
+    /**
+     * Create a conjunction of the given boolean expressions.
+     * @param x  boolean expression
+     * @param y  boolean expression
+     * @return and predicate
+     */
+    Predicate and(Expression<Boolean> x, Expression<Boolean> y);
+    
+    /**
+     * Create a conjunction of the given restriction predicates.
+     * A conjunction of zero predicates is true.
+     * @param restrictions  zero or more restriction predicates
+     * @return and predicate
+     */
+    Predicate and(Predicate... restrictions);
+
+    /**
+     * Create a disjunction of the given boolean expressions.
+     * @param x  boolean expression
+     * @param y  boolean expression
+     * @return or predicate
+     */
+    Predicate or(Expression<Boolean> x, Expression<Boolean> y);
+
+    /**
+     * Create a disjunction of the given restriction predicates.
+     * A disjunction of zero predicates is false.
+     * @param restrictions  zero or more restriction predicates
+     * @return or predicate
+     */
+    Predicate or(Predicate... restrictions);
+
+    /**
+     * Create a negation of the given restriction. 
+     * @param restriction  restriction expression
+     * @return not predicate
+     */
+    Predicate not(Expression<Boolean> restriction);
+	
+    /**
+     * Create a conjunction (with zero conjuncts).
+     * A conjunction with zero conjuncts is true.
+     * @return and predicate
+     */
+    Predicate conjunction();
+
+    /**
+     * Create a disjunction (with zero disjuncts).
+     * A disjunction with zero disjuncts is false.
+     * @return or predicate
+     */
+    Predicate disjunction();
+
+	
+    //turn Expression<Boolean> into a Predicate
+    //useful for use with varargs methods
+
+    /**
+     * Create a predicate testing for a true value.
+     * @param x  expression to be tested
+     * @return predicate
+     */
+    Predicate isTrue(Expression<Boolean> x);
+
+    /**
+     * Create a predicate testing for a false value.
+     * @param x  expression to be tested
+     * @return predicate
+     */
+    Predicate isFalse(Expression<Boolean> x);
+
+	
+    //null tests:
+
+    /**
+     * Create a predicate to test whether the expression is null.
+     * @param x expression
+     * @return is-null predicate
+     */
+    Predicate isNull(Expression<?> x);
+
+    /**
+     * Create a predicate to test whether the expression is not null.
+     * @param x expression
+     * @return is-not-null predicate
+     */
+    Predicate isNotNull(Expression<?> x);
+
+    //equality:
+	
+    /**
+     * Create a predicate for testing the arguments for equality.
+     * @param x  expression
+     * @param y  expression
+     * @return equality predicate
+     */
+    Predicate equal(Expression<?> x, Expression<?> y);
+	
+    /**
+     * Create a predicate for testing the arguments for equality.
+     * @param x  expression
+     * @param y  object
+     * @return equality predicate
+     */
+    Predicate equal(Expression<?> x, Object y);
+
+    /**
+     * Create a predicate for testing the arguments for inequality.
+     * @param x  expression
+     * @param y  expression
+     * @return inequality predicate
+     */
+    Predicate notEqual(Expression<?> x, Expression<?> y);
+	
+    /**
+     * Create a predicate for testing the arguments for inequality.
+     * @param x  expression
+     * @param y  object
+     * @return inequality predicate
+     */
+    Predicate notEqual(Expression<?> x, Object y);
+
+	
+    //comparisons for generic (non-numeric) operands:
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than the second.
+     * @param x  expression
+     * @param y  expression
+     * @return greater-than predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Expression<? extends Y> y);
+	
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than the second.
+     * @param x  expression
+     * @param y  value
+     * @return greater-than predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Y y);
+    
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than or equal to the second.
+     * @param x  expression
+     * @param y  expression
+     * @return greater-than-or-equal predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than or equal to the second.
+     * @param x  expression
+     * @param y  value
+     * @return greater-than-or-equal predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Y y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than the second.
+     * @param x  expression
+     * @param y  expression
+     * @return less-than predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than the second.
+     * @param x  expression
+     * @param y  value
+     * @return less-than predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Y y);
+	
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than or equal to the second.
+     * @param x  expression
+     * @param y  expression
+     * @return less-than-or-equal predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than or equal to the second.
+     * @param x  expression
+     * @param y  value
+     * @return less-than-or-equal predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Y y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * between the second and third arguments in value.
+     * @param v  expression 
+     * @param x  expression
+     * @param y  expression
+     * @return between predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Expression<? extends Y> x, Expression<? extends Y> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * between the second and third arguments in value.
+     * @param v  expression 
+     * @param x  value
+     * @param y  value
+     * @return between predicate
+     */
+    <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Y x, Y y);
+	
+
+    //comparisons for numeric operands:
+	
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than the second.
+     * @param x  expression
+     * @param y  expression
+     * @return greater-than predicate
+     */
+    Predicate gt(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than the second.
+     * @param x  expression
+     * @param y  value
+     * @return greater-than predicate
+     */
+    Predicate gt(Expression<? extends Number> x, Number y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than or equal to the second.
+     * @param x  expression
+     * @param y  expression
+     * @return greater-than-or-equal predicate
+     */
+    Predicate ge(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * greater than or equal to the second.
+     * @param x  expression
+     * @param y  value
+     * @return greater-than-or-equal predicate
+     */	
+    Predicate ge(Expression<? extends Number> x, Number y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than the second.
+     * @param x  expression
+     * @param y  expression
+     * @return less-than predicate
+     */
+    Predicate lt(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than the second.
+     * @param x  expression
+     * @param y  value
+     * @return less-than predicate
+     */
+    Predicate lt(Expression<? extends Number> x, Number y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than or equal to the second.
+     * @param x  expression
+     * @param y  expression
+     * @return less-than-or-equal predicate
+     */
+    Predicate le(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    /**
+     * Create a predicate for testing whether the first argument is 
+     * less than or equal to the second.
+     * @param x  expression
+     * @param y  value
+     * @return less-than-or-equal predicate
+     */
+    Predicate le(Expression<? extends Number> x, Number y);
+	
+
+    //numerical operations:
+	
+    /**
+     * Create an expression that returns the arithmetic negation
+     * of its argument.
+     * @param x expression
+     * @return arithmetic negation
+     */
+    <N extends Number> Expression<N> neg(Expression<N> x);
+
+    /**
+     * Create an expression that returns the absolute value
+     * of its argument.
+     * @param x expression
+     * @return absolute value
+     */
+    <N extends Number> Expression<N> abs(Expression<N> x);
+	
+    /**
+     * Create an expression that returns the sum
+     * of its arguments.
+     * @param x expression
+     * @param y expression
+     * @return sum
+     */
+    <N extends Number> Expression<N> sum(Expression<? extends N> x, Expression<? extends N> y);
+	
+    /**
+     * Create an expression that returns the sum
+     * of its arguments.
+     * @param x expression
+     * @param y value
+     * @return sum
+     */
+    <N extends Number> Expression<N> sum(Expression<? extends N> x, N y);
+
+    /**
+     * Create an expression that returns the sum
+     * of its arguments.
+     * @param x value
+     * @param y expression
+     * @return sum
+     */
+    <N extends Number> Expression<N> sum(N x, Expression<? extends N> y);
+
+    /**
+     * Create an expression that returns the product
+     * of its arguments.
+     * @param x expression
+     * @param y expression
+     * @return product
+     */
+    <N extends Number> Expression<N> prod(Expression<? extends N> x, Expression<? extends N> y);
+
+    /**
+     * Create an expression that returns the product
+     * of its arguments.
+     * @param x expression
+     * @param y value
+     * @return product
+     */
+    <N extends Number> Expression<N> prod(Expression<? extends N> x, N y);
+
+    /**
+     * Create an expression that returns the product
+     * of its arguments.
+     * @param x value
+     * @param y expression
+     * @return product
+     */
+    <N extends Number> Expression<N> prod(N x, Expression<? extends N> y);
+
+    /**
+     * Create an expression that returns the difference
+     * between its arguments.
+     * @param x expression
+     * @param y expression
+     * @return difference
+     */
+    <N extends Number> Expression<N> diff(Expression<? extends N> x, Expression<? extends N> y);
+
+    /**
+     * Create an expression that returns the difference
+     * between its arguments.
+     * @param x expression
+     * @param y value
+     * @return difference
+     */
+    <N extends Number> Expression<N> diff(Expression<? extends N> x, N y);
+
+    /**
+     * Create an expression that returns the difference
+     * between its arguments.
+     * @param x value
+     * @param y expression
+     * @return difference
+     */
+    <N extends Number> Expression<N> diff(N x, Expression<? extends N> y);
+	
+    /**
+     * Create an expression that returns the quotient
+     * of its arguments.
+     * @param x expression
+     * @param y expression
+     * @return quotient
+     */
+    Expression<Number> quot(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    /**
+     * Create an expression that returns the quotient
+     * of its arguments.
+     * @param x expression
+     * @param y value
+     * @return quotient
+     */
+    Expression<Number> quot(Expression<? extends Number> x, Number y);
+
+    /**
+     * Create an expression that returns the quotient
+     * of its arguments.
+     * @param x value
+     * @param y expression
+     * @return quotient
+     */
+    Expression<Number> quot(Number x, Expression<? extends Number> y);
+	
+    /**
+     * Create an expression that returns the modulus
+     * of its arguments.
+     * @param x expression
+     * @param y expression
+     * @return modulus
+     */
+    Expression<Integer> mod(Expression<Integer> x, Expression<Integer> y);
+	
+    /**
+     * Create an expression that returns the modulus
+     * of its arguments.
+     * @param x expression
+     * @param y value
+     * @return modulus
+     */
+    Expression<Integer> mod(Expression<Integer> x, Integer y);
+
+    /**
+     * Create an expression that returns the modulus
+     * of its arguments.
+     * @param x value
+     * @param y expression
+     * @return modulus
+     */
+    Expression<Integer> mod(Integer x, Expression<Integer> y);
+
+    /**
+     * Create an expression that returns the square root
+     * of its argument.
+     * @param x expression
+     * @return square root
+     */	
+    Expression<Double> sqrt(Expression<? extends Number> x);
+
+	
+    //typecasts:
+    
+    /**
+     * Typecast.  Returns same expression object.
+     * @param number  numeric expression
+     * @return Expression<Long>
+     */
+    Expression<Long> toLong(Expression<? extends Number> number);
+
+    /**
+     * Typecast.  Returns same expression object.
+     * @param number  numeric expression
+     * @return Expression<Integer>
+     */
+    Expression<Integer> toInteger(Expression<? extends Number> number);
+
+    /**
+     * Typecast. Returns same expression object.
+     * @param number  numeric expression
+     * @return Expression<Float>
+     */
+    Expression<Float> toFloat(Expression<? extends Number> number);
+
+    /**
+     * Typecast.  Returns same expression object.
+     * @param number  numeric expression
+     * @return Expression<Double>
+     */
+    Expression<Double> toDouble(Expression<? extends Number> number);
+
+    /**
+     * Typecast.  Returns same expression object.
+     * @param number  numeric expression
+     * @return Expression<BigDecimal>
+     */
+    Expression<BigDecimal> toBigDecimal(Expression<? extends Number> number);
+
+    /**
+     * Typecast.  Returns same expression object.
+     * @param number  numeric expression
+     * @return Expression<BigInteger>
+     */
+    Expression<BigInteger> toBigInteger(Expression<? extends Number> number);
+	
+    /**
+     * Typecast.  Returns same expression object.
+     * @param character expression
+     * @return Expression<String>
+     */
+    Expression<String> toString(Expression<Character> character);
+
+	
+    //literals:
+
+    /**
+     * Create an expression for a literal.
+     * @param value  value represented by the expression
+     * @return expression literal
+     * @throws IllegalArgumentException if value is null
+     */
+    <T> Expression<T> literal(T value);
+
+    /**
+     * Create an expression for a null literal with the given type.
+     * @param resultClass  type of the null literal
+     * @return null expression literal
+     */
+    <T> Expression<T> nullLiteral(Class<T> resultClass);
+
+    //parameters:
+
+    /**
+     * Create a parameter expression.
+     * @param paramClass parameter class
+     * @return parameter expression
+     */
+    <T> ParameterExpression<T> parameter(Class<T> paramClass);
+
+    /**
+     * Create a parameter expression with the given name.
+     * @param paramClass parameter class
+     * @param name  name that can be used to refer to 
+     *              the parameter
+     * @return parameter expression
+     */
+    <T> ParameterExpression<T> parameter(Class<T> paramClass, String name);
+
+
+    //collection operations:
+	
+    /**
+     *  Create a predicate that tests whether a collection is empty.
+     *  @param collection expression
+     *  @return is-empty predicate
+     */
+    <C extends Collection<?>> Predicate isEmpty(Expression<C> collection);
+
+    /**
+     *  Create a predicate that tests whether a collection is
+     *  not empty.
+     *  @param collection expression
+     *  @return is-not-empty predicate
+     */
+    <C extends Collection<?>> Predicate isNotEmpty(Expression<C> collection);
+
+    /**
+     * Create an expression that tests the size of a collection.
+     * @param collection expression
+     * @return size expression
+     */ 
+    <C extends java.util.Collection<?>> Expression<Integer> size(Expression<C> collection);
+	
+    /**
+     * Create an expression that tests the size of a collection.
+     * @param collection collection
+     * @return size expression
+     */ 
+    <C extends Collection<?>> Expression<Integer> size(C collection);
+	
+    /**
+     *  Create a predicate that tests whether an element is
+     *  a member of a collection.
+     *  If the collection is empty, the predicate will be false.
+     *  @param elem element expression
+     *  @param collection expression
+     *  @return is-member predicate
+     */
+    <E, C extends Collection<E>> Predicate isMember(Expression<E> elem, Expression<C> collection);
+
+    /**
+     *  Create a predicate that tests whether an element is
+     *  a member of a collection.
+     *  If the collection is empty, the predicate will be false.
+     *  @param elem element
+     *  @param collection expression
+     *  @return is-member predicate
+     */
+    <E, C extends Collection<E>> Predicate isMember(E elem, Expression<C> collection);
+
+    /**
+     *  Create a predicate that tests whether an element is
+     *  not a member of a collection.
+     *  If the collection is empty, the predicate will be true.
+     *  @param elem element expression
+     *  @param collection expression
+     *  @return is-not-member predicate
+     */
+    <E, C extends Collection<E>> Predicate isNotMember(Expression<E> elem, Expression<C> collection);
+	
+    /**
+     *  Create a predicate that tests whether an element is
+     *  not a member of a collection.
+     *  If the collection is empty, the predicate will be true.
+     *  @param elem element
+     *  @param collection expression
+     *  @return is-not-member predicate
+     */
+    <E, C extends Collection<E>> Predicate isNotMember(E elem, Expression<C> collection);
+
+
+    //get the values and keys collections of the Map, which may then
+    //be passed to size(), isMember(), isEmpty(), etc
+
+    /**
+     * Create an expression that returns the values of a map.
+     * @param map  map
+     * @return collection expression
+     */
+    <V, M extends Map<?, V>> Expression<Collection<V>> values(M map);
+
+    /**
+     * Create an expression that returns the keys of a map.
+     * @param map  map
+     * @return set expression
+     */
+    <K, M extends Map<K, ?>> Expression<Set<K>> keys(M map);
+
+	
+    //string functions:
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * satisfies the given pattern.
+     * @param x  string expression
+     * @param pattern  string expression
+     * @return like predicate
+     */
+    Predicate like(Expression<String> x, Expression<String> pattern);
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * satisfies the given pattern.
+     * @param x  string expression
+     * @param pattern  string 
+     * @return like predicate
+     */
+    Predicate like(Expression<String> x, String pattern);
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * satisfies the given pattern.
+     * @param x  string expression
+     * @param pattern  string expression
+     * @param escapeChar  escape character expression
+     * @return like predicate
+     */
+    Predicate like(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar);
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * satisfies the given pattern.
+     * @param x  string expression
+     * @param pattern  string expression
+     * @param escapeChar  escape character
+     * @return like predicate
+     */
+    Predicate like(Expression<String> x, Expression<String> pattern, char escapeChar);
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * satisfies the given pattern.
+     * @param x  string expression
+     * @param pattern  string 
+     * @param escapeChar  escape character expression
+     * @return like predicate
+     */
+    Predicate like(Expression<String> x, String pattern, Expression<Character> escapeChar);
+
+    /**
+     * Create a predicate for testing whether the expression
+     * satisfies the given pattern.
+     * @param x  string expression
+     * @param pattern  string 
+     * @param escapeChar  escape character
+     * @return like predicate
+     */
+    Predicate like(Expression<String> x, String pattern, char escapeChar);
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * does not satisfy the given pattern.
+     * @param x  string expression
+     * @param pattern  string expression
+     * @return not-like predicate
+     */
+    Predicate notLike(Expression<String> x, Expression<String> pattern);
+	
+    /**
+     * Create a predicate for testing whether the expression
+     * does not satisfy the given pattern.
+     * @param x  string expression
+     * @param pattern  string 
+     * @return not-like predicate
+     */
+    Predicate notLike(Expression<String> x, String pattern);
+
+    /**
+     * Create a predicate for testing whether the expression
+     * does not satisfy the given pattern.
+     * @param x  string expression
+     * @param pattern  string expression
+     * @param escapeChar  escape character expression
+     * @return not-like predicate
+     */
+    Predicate notLike(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar);
+
+    /**
+     * Create a predicate for testing whether the expression
+     * does not satisfy the given pattern.
+     * @param x  string expression
+     * @param pattern  string expression
+     * @param escapeChar  escape character
+     * @return not-like predicate
+     */
+    Predicate notLike(Expression<String> x, Expression<String> pattern, char escapeChar);
+
+    /**
+     * Create a predicate for testing whether the expression
+     * does not satisfy the given pattern.
+     * @param x  string expression
+     * @param pattern  string 
+     * @param escapeChar  escape character expression
+     * @return not-like predicate
+     */
+    Predicate notLike(Expression<String> x, String pattern, Expression<Character> escapeChar);
+	
+   /**
+     * Create a predicate for testing whether the expression
+     * does not satisfy the given pattern.
+     * @param x  string expression
+     * @param pattern  string 
+     * @param escapeChar  escape character
+     * @return not-like predicate
+     */
+    Predicate notLike(Expression<String> x, String pattern, char escapeChar);
+
+    /**
+     *  Create an expression for string concatenation.
+     *  @param x  string expression
+     *  @param y  string expression
+     *  @return expression corresponding to concatenation
+     */
+    Expression<String> concat(Expression<String> x, Expression<String> y);
+	
+    /**
+     *  Create an expression for string concatenation.
+     *  @param x  string expression
+     *  @param y  string 
+     *  @return expression corresponding to concatenation
+     */
+    Expression<String> concat(Expression<String> x, String y);
+
+    /**
+     *  Create an expression for string concatenation.
+     *  @param x  string 
+     *  @param y  string expression
+     *  @return expression corresponding to concatenation
+     */
+    Expression<String> concat(String x, Expression<String> y);
+	
+    /**
+     *  Create an expression for substring extraction.
+     *  Extracts a substring starting at the specified position
+     *  through to end of the string.
+     *  First position is 1.
+     *  @param x  string expression
+     *  @param from  start position expression 
+     *  @return expression corresponding to substring extraction
+     */
+    Expression<String> substring(Expression<String> x, Expression<Integer> from);
+	
+    /**
+     *  Create an expression for substring extraction.
+     *  Extracts a substring starting at the specified position
+     *  through to end of the string.
+     *  First position is 1.
+     *  @param x  string expression
+     *  @param from  start position 
+     *  @return expression corresponding to substring extraction
+     */
+    Expression<String> substring(Expression<String> x, int from);
+
+    /**
+     *  Create an expression for substring extraction.
+     *  Extracts a substring of given length starting at the
+     *  specified position.
+     *  First position is 1.
+     *  @param x  string expression
+     *  @param from  start position expression 
+     *  @param len  length expression
+     *  @return expression corresponding to substring extraction
+     */
+    Expression<String> substring(Expression<String> x, Expression<Integer> from, Expression<Integer> len);
+	
+    /**
+     *  Create an expression for substring extraction.
+     *  Extracts a substring of given length starting at the
+     *  specified position.
+     *  First position is 1.
+     *  @param x  string expression
+     *  @param from  start position 
+     *  @param len  length
+     *  @return expression corresponding to substring extraction
+     */
+    Expression<String> substring(Expression<String> x, int from, int len);
+	
+    /**
+     *  Used to specify how strings are trimmed.
+     */
+    public static enum Trimspec { 
+
+        /**
+         * Trim from leading end.
+         */
+        LEADING,
+ 
+        /**
+         * Trim from trailing end.
+         */
+        TRAILING, 
+
+        /**
+         * Trim from both ends.
+         */
+        BOTH 
+    }
+	
+    /**
+     * Create expression to trim blanks from both ends of
+     * a string.
+     * @param x  expression for string to trim
+     * @return trim expression
+     */
+    Expression<String> trim(Expression<String> x);
+	
+    /**
+     * Create expression to trim blanks from a string.
+     * @param ts  trim specification
+     * @param x  expression for string to trim
+     * @return trim expression
+     */
+    Expression<String> trim(Trimspec ts, Expression<String> x);
+
+    /**
+     * Create expression to trim character from both ends of
+     * a string.
+     * @param t  expression for character to be trimmed
+     * @param x  expression for string to trim
+     * @return trim expression
+     */
+    Expression<String> trim(Expression<Character> t, Expression<String> x);
+
+    /**
+     * Create expression to trim character from a string.
+     * @param ts  trim specification
+     * @param t  expression for character to be trimmed
+     * @param x  expression for string to trim
+     * @return trim expression
+     */
+    Expression<String> trim(Trimspec ts, Expression<Character> t, Expression<String> x);
+	
+    /**
+     * Create expression to trim character from both ends of
+     * a string.
+     * @param t  character to be trimmed
+     * @param x  expression for string to trim
+     * @return trim expression
+     */
+    Expression<String> trim(char t, Expression<String> x);
+	
+    /**
+     * Create expression to trim character from a string.
+     * @param ts  trim specification
+     * @param t  character to be trimmed
+     * @param x  expression for string to trim
+     * @return trim expression
+     */
+    Expression<String> trim(Trimspec ts, char t, Expression<String> x);
+	
+    /**
+     * Create expression for converting a string to lowercase.
+     * @param x  string expression
+     * @return expression to convert to lowercase
+     */
+    Expression<String> lower(Expression<String> x);
+	
+    /**
+     * Create expression for converting a string to uppercase.
+     * @param x  string expression
+     * @return expression to convert to uppercase
+     */
+    Expression<String> upper(Expression<String> x);
+	
+    /**
+     * Create expression to return length of a string.
+     * @param x  string expression
+     * @return length expression
+     */
+    Expression<Integer> length(Expression<String> x);
+	
+	
+    /**
+     * Create expression to locate the position of one string
+     * within another, returning position of first character
+     * if found.
+     * The first position in a string is denoted by 1.  If the
+     * string to be located is not found, 0 is returned.
+     * @param x  expression for string to be searched
+     * @param pattern  expression for string to be located
+     * @return expression corresponding to position
+     */
+    Expression<Integer> locate(Expression<String> x, Expression<String> pattern);
+	
+    /**
+     * Create expression to locate the position of one string
+     * within another, returning position of first character
+     * if found.
+     * The first position in a string is denoted by 1.  If the
+     * string to be located is not found, 0 is returned.
+     * @param x  expression for string to be searched
+     * @param pattern  string to be located
+     * @return expression corresponding to position
+     */
+    Expression<Integer> locate(Expression<String> x, String pattern);
+
+    /**
+     * Create expression to locate the position of one string
+     * within another, returning position of first character
+     * if found.
+     * The first position in a string is denoted by 1.  If the
+     * string to be located is not found, 0 is returned.
+     * @param x  expression for string to be searched
+     * @param pattern  expression for string to be located
+     * @param from  expression for position at which to start search
+     * @return expression corresponding to position
+     */
+    Expression<Integer> locate(Expression<String> x, Expression<String> pattern, Expression<Integer> from);
+
+    /**
+     * Create expression to locate the position of one string
+     * within another, returning position of first character
+     * if found.
+     * The first position in a string is denoted by 1.  If the
+     * string to be located is not found, 0 is returned.
+     * @param x  expression for string to be searched
+     * @param pattern  string to be located
+     * @param from  position at which to start search
+     * @return expression corresponding to position
+     */	
+    Expression<Integer> locate(Expression<String> x, String pattern, int from);
+	
+
+    // Date/time/timestamp functions:
+
+    /**
+     *  Create expression to return current date.
+     *  @return expression for current date
+     */
+    Expression<java.sql.Date> currentDate();
+
+    /**
+     *  Create expression to return current timestamp.
+     *  @return expression for current timestamp
+     */	
+    Expression<java.sql.Timestamp> currentTimestamp();
+
+    /**
+     *  Create expression to return current time.
+     *  @return expression for current time
+     */	
+    Expression<java.sql.Time> currentTime();
+	
+
+    //in builders:
+	
+    /**
+     *  Interface used to build in predicates.
+     */
+    public static interface In<T> extends Predicate {
+
+         /**
+          * Return the expression to be tested against the
+          * list of values.
+          * @return expression
+          */
+         Expression<T> getExpression();
+	
+         /**
+          *  Add to list of values to be tested against.
+          *  @param value value
+          *  @return in predicate
+          */
+         In<T> value(T value);
+
+         /**
+          *  Add to list of values to be tested against.
+          *  @param value expression
+          *  @return in predicate
+          */
+         In<T> value(Expression<? extends T> value);
+     }
+	
+    /**
+     *  Create predicate to test whether given expression
+     *  is contained in a list of values.
+     *  @param  expression to be tested against list of values
+     *  @return  in predicate
+     */
+    <T> In<T> in(Expression<? extends T> expression);
+	
+
+    // coalesce, nullif:
+
+    /**
+     * Create an expression that returns null if all its arguments
+     * evaluate to null, and the value of the first non-null argument
+     * otherwise.
+     * @param x expression
+     * @param y expression
+     * @return coalesce expression
+     */
+    <Y> Expression<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    /**
+     * Create an expression that returns null if all its arguments
+     * evaluate to null, and the value of the first non-null argument
+     * otherwise.
+     * @param x expression
+     * @param y value
+     * @return coalesce expression
+     */
+    <Y> Expression<Y> coalesce(Expression<? extends Y> x, Y y);
+    
+    /**
+     * Create an expression that tests whether its argument are
+     * equal, returning null if they are and the value of the
+     * first expression if they are not.
+     * @param x expression
+     * @param y expression
+     * @return nullif expression
+     */
+    <Y> Expression<Y> nullif(Expression<Y> x, Expression<?> y);
+
+    /**
+     * Create an expression that tests whether its argument are
+     * equal, returning null if they are and the value of the
+     * first expression if they are not.
+     * @param x expression
+     * @param y value
+     * @return nullif expression 
+     */
+    <Y> Expression<Y> nullif(Expression<Y> x, Y y);
+
+
+    // coalesce builder:
+
+    /**
+     *  Interface used to build coalesce expressions.  
+     *   
+     * A coalesce expression is equivalent to a case expression
+     * that returns null if all its arguments evaluate to null,
+     * and the value of its first non-null argument otherwise.
+     */
+    public static interface Coalesce<T> extends Expression<T> {
+
+         /**
+          * Add an argument to the coalesce expression.
+          * @param value  value
+          * @return coalesce expression
+          */
+         Coalesce<T> value(T value);
+
+         /**
+          * Add an argument to the coalesce expression.
+          * @param value expression
+          * @return coalesce expression
+          */
+         Coalesce<T> value(Expression<? extends T> value);
+	}
+	
+    /**
+     * Create a coalesce expression.
+     * @return coalesce expression
+     */
+    <T> Coalesce<T> coalesce();
+
+
+    //case builders:
+
+    /**
+     *  Interface used to build simple case expressions.
+     *  Case conditions are evaluated in the order in which
+     *  they are specified.
+     */
+    public static interface SimpleCase<C,R> extends Expression<R> {
+
+		/**
+		 * Return the expression to be tested against the
+		 * conditions.
+		 * @return expression
+		 */
+		Expression<C> getExpression();
+
+		/**
+		 * Add a when/then clause to the case expression.
+		 * @param condition  "when" condition
+		 * @param result  "then" result value
+		 * @return simple case expression
+		 */
+		SimpleCase<C, R> when(C condition, R result);
+
+		/**
+		 * Add a when/then clause to the case expression.
+		 * @param condition  "when" condition
+		 * @param result  "then" result expression
+		 * @return simple case expression
+		 */
+		SimpleCase<C, R> when(C condition, Expression<? extends R> result);
+
+		/**
+		 * Add an "else" clause to the case expression.
+		 * @param result  "else" result
+		 * @return expression
+		 */
+		Expression<R> otherwise(R result);
+
+		/**
+		 * Add an "else" clause to the case expression.
+		 * @param result  "else" result expression
+		 * @return expression
+		 */
+		Expression<R> otherwise(Expression<? extends R> result);
+	}
+	
+    /**
+     *  Create a simple case expression.
+     *  @param expression  to be tested against the case conditions
+     *  @return simple case expression
+     */
+    <C, R> SimpleCase<C,R> selectCase(Expression<? extends C> expression);
+
+
+    /**
+     *  Interface used to build general case expressions.
+     *  Case conditions are evaluated in the order in which
+     *  they are specified.
+     */
+    public static interface Case<R> extends Expression<R> {
+
+		/**
+		 * Add a when/then clause to the case expression.
+		 * @param condition  "when" condition
+		 * @param result  "then" result value
+		 * @return general case expression
+		 */
+		Case<R> when(Expression<Boolean> condition, R result);
+
+		/**
+		 * Add a when/then clause to the case expression.
+		 * @param condition  "when" condition
+		 * @param result  "then" result expression
+		 * @return general case expression
+		 */
+		Case<R> when(Expression<Boolean> condition, Expression<? extends R> result);
+
+		/**
+		 * Add an "else" clause to the case expression.
+		 * @param result  "else" result
+		 * @return expression
+		 */
+		Expression<R> otherwise(R result);
+
+		/**
+		 * Add an "else" clause to the case expression.
+		 * @param result  "else" result expression
+		 * @return expression
+		 */
+		Expression<R> otherwise(Expression<? extends R> result);
+	}
+	
+    /**
+     *  Create a general case expression.
+     *  @return general case expression
+     */
+    <R> Case<R> selectCase();
+
+    /**
+     * Create an expression for the execution of a database
+     * function.
+     * @param name  function name
+     * @param type  expected result type
+     * @param args  function arguments
+     * @return expression
+     */
+   <T> Expression<T> function(String name, Class<T> type,
+Expression<?>... args);
+
+
+    // methods for downcasting:
+
+    /**
+     *  Downcast Join object to the specified type.
+     *  @param join  Join object
+     *  @param type type to be downcast to
+     *  @return  Join object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, T, V extends T> Join<X, V> treat(Join<X, T> join, Class<V> type);
+
+    /**
+     *  Downcast CollectionJoin object to the specified type.
+     *  @param join  CollectionJoin object
+     *  @param type type to be downcast to
+     *  @return  CollectionJoin object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, T, E extends T> CollectionJoin<X, E> treat(CollectionJoin<X, T> join, Class<E> type);
+
+    /**
+     *  Downcast SetJoin object to the specified type.
+     *  @param join  SetJoin object
+     *  @param type type to be downcast to
+     *  @return  SetJoin object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, T, E extends T> SetJoin<X, E> treat(SetJoin<X, T> join, Class<E> type);
+
+    /**
+     *  Downcast ListJoin object to the specified type.
+     *  @param join  ListJoin object
+     *  @param type type to be downcast to
+     *  @return  ListJoin object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, T, E extends T> ListJoin<X, E> treat(ListJoin<X, T> join, Class<E> type);
+
+    /**
+     *  Downcast MapJoin object to the specified type.
+     *  @param join  MapJoin object
+     *  @param type type to be downcast to
+     *  @return  MapJoin object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, K, T, V extends T> MapJoin<X, K, V> treat(MapJoin<X, K, T> join, Class<V> type);
+
+
+    /**
+     *  Downcast Path object to the specified type.
+     *  @param path  path
+     *  @param type type to be downcast to
+     *  @return  Path object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, T extends X> Path<T> treat(Path<X> path, Class<T> type);
+
+    /**
+     *  Downcast Root object to the specified type.
+     *  @param root  root
+     *  @param type type to be downcast to
+     *  @return  Root object of the specified type
+     *  @since Java Persistence 2.1
+     */
+    <X, T extends X> Root<T> treat(Root<X> root, Class<T> type);
+
+}
+
+
+
+
diff --git a/src/javax/persistence/criteria/CriteriaDelete.java b/src/javax/persistence/criteria/CriteriaDelete.java
new file mode 100644
index 0000000..4cc3157
--- /dev/null
+++ b/src/javax/persistence/criteria/CriteriaDelete.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.EntityType;
+
+/**
+ * The <code>CriteriaDelete</code> interface defines functionality for performing
+ * bulk delete operations using the Criteria API
+ *
+ * <p>Criteria API bulk delete operations map directly to database 
+ * delete operations.  The persistence context is not synchronized 
+ * with the result of the bulk delete.
+ *
+ * <p> A <code>CriteriaDelete</code> object must have a single root.
+ *
+ * @param <T>  the entity type that is the target of the delete
+ *
+ * @since Java Persistence 2.1
+ */
+public interface CriteriaDelete<T> extends CommonAbstractCriteria {
+
+
+    /**
+     * Create and add a query root corresponding to the entity
+     * that is the target of the delete.
+     * A <code>CriteriaDelete</code> object has a single root, the entity that 
+     * is being deleted.
+     * @param entityClass  the entity class
+     * @return query root corresponding to the given entity
+     */
+    Root<T> from(Class<T> entityClass);
+
+    /**
+     * Create and add a query root corresponding to the entity
+     * that is the target of the delete.
+     * A <code>CriteriaDelete</code> object has a single root, the entity that 
+     * is being deleted.
+     * @param entity  metamodel entity representing the entity
+     *                of type X
+     * @return query root corresponding to the given entity
+     */
+    Root<T> from(EntityType<T> entity);
+
+   /**
+    * Return the query root.
+    * @return the query root
+    */
+   Root<T> getRoot();
+
+    /**
+     * Modify the delete query to restrict the target of the deletion 
+     * according to the specified boolean expression.
+     * Replaces the previously added restriction(s), if any.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified delete query
+     */    
+   CriteriaDelete<T> where(Expression<Boolean> restriction);
+
+    /**
+     * Modify the delete query to restrict the target of the deletion
+     * according to the conjunction of the specified restriction 
+     * predicates.
+     * Replaces the previously added restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified delete query
+     */
+   CriteriaDelete<T> where(Predicate... restrictions);
+
+}
diff --git a/src/javax/persistence/criteria/CriteriaQuery.java b/src/javax/persistence/criteria/CriteriaQuery.java
new file mode 100644
index 0000000..ceebbea
--- /dev/null
+++ b/src/javax/persistence/criteria/CriteriaQuery.java
@@ -0,0 +1,317 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The <code>CriteriaQuery</code> interface defines functionality that is specific 
+ * to top-level queries.
+ *
+ * @param <T>  the type of the defined result
+ *
+ * @since Java Persistence 2.0
+ */
+public interface CriteriaQuery<T> extends AbstractQuery<T> {
+	
+    /**
+     * Specify the item that is to be returned in the query result.
+     * Replaces the previously specified selection(s), if any.
+     * 
+     * <p> Note: Applications using the string-based API may need to
+     * specify the type of the select item when it results from
+     * a get or join operation and the query result type is 
+     * specified. 
+     *
+     * <pre>
+     *     For example:
+     *
+     *     CriteriaQuery<String> q = cb.createQuery(String.class);
+     *     Root<Order> order = q.from(Order.class);
+     *     q.select(order.get("shippingAddress").<String>get("state"));
+     * 
+     *     CriteriaQuery<Product> q2 = cb.createQuery(Product.class);
+     *     q2.select(q2.from(Order.class)
+     *                 .join("items")
+     *                 .<Item,Product>join("product"));
+     * 
+     * </pre>
+     * @param selection  selection specifying the item that
+     *        is to be returned in the query result
+     * @return the modified query
+     * @throws IllegalArgumentException if the selection is
+     *         a compound selection and more than one selection 
+     *         item has the same assigned alias
+     */
+    CriteriaQuery<T> select(Selection<? extends T> selection);
+
+    /**
+     * Specify the selection items that are to be returned in the 
+     * query result.
+     * Replaces the previously specified selection(s), if any.
+     *
+     * The type of the result of the query execution depends on
+     * the specification of the type of the criteria query object 
+     * created as well as the arguments to the multiselect method.
+     * <p> An argument to the multiselect method must not be a tuple-
+     * or array-valued compound selection item. 
+     *
+     * <p>The semantics of this method are as follows: 
+     * <ul> 
+     * <li> 
+     * If the type of the criteria query is
+     * <code>CriteriaQuery<Tuple></code> (i.e., a criteria
+     * query object created by either the
+     * <code>createTupleQuery</code> method or by passing a
+     * <code>Tuple</code> class argument to the
+     * <code>createQuery</code> method), a <code>Tuple</code> object
+     * corresponding to the arguments of the <code>multiselect</code>
+     * method, in the specified order, will be instantiated and
+     * returned for each row that results from the query execution.
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<X></code> for
+     * some user-defined class X (i.e., a criteria query object
+     * created by passing a X class argument to the <code>createQuery</code> 
+     * method), the arguments to the <code>multiselect</code> method will be 
+     * passed to the X constructor and an instance of type X will be 
+     * returned for each row.  
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<X[]></code> for
+     * some class X, an instance of type X[] will be returned for 
+     * each row.   The elements of the array will correspond to the 
+     * arguments of the <code>multiselect</code> method, in the
+     * specified order.  
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<Object></code>
+     * or if the criteria query was created without specifying a 
+     * type, and only a single argument is passed to the <code>multiselect</code>
+     * method, an instance of type <code>Object</code> will be returned for 
+     * each row.
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<Object></code>
+     * or if the criteria query was created without specifying a 
+     * type, and more than one argument is passed to the <code>multiselect</code>
+     * method, an instance of type <code>Object[]</code> will be instantiated 
+     * and returned for each row.  The elements of the array will 
+     * correspond to the arguments to the <code> multiselect</code>  method,
+     * in the specified order.
+     * </ul>
+     *
+     * @param selections  selection items corresponding to the
+     *        results to be returned by the query
+     * @return the modified query
+     * @throws IllegalArgumentException if a selection item is
+     *         not valid or if more than one selection item has
+     *         the same assigned alias
+     */
+    CriteriaQuery<T> multiselect(Selection<?>... selections);
+
+
+    /**
+     * Specify the selection items that are to be returned in the 
+     * query result.
+     * Replaces the previously specified selection(s), if any.
+     *
+     * <p> The type of the result of the query execution depends on
+     * the specification of the type of the criteria query object 
+     * created as well as the argument to the <code>multiselect</code> method.
+     * An element of the list passed to the <code>multiselect</code> method 
+     * must not be a tuple- or array-valued compound selection item. 
+     *
+     * <p> The semantics of this method are as follows:
+     * <ul>
+     * <li> If the type of the criteria query is <code>CriteriaQuery<Tuple></code>
+     * (i.e., a criteria query object created by either the 
+     * <code>createTupleQuery</code> method or by passing a <code>Tuple</code> class argument 
+     * to the <code>createQuery</code> method), a <code>Tuple</code> object corresponding to 
+     * the elements of the list passed to the <code>multiselect</code> method, 
+     * in the specified order, will be instantiated and returned for each 
+     * row that results from the query execution.
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<X></code> for
+     * some user-defined class X (i.e., a criteria query object
+     * created by passing a X class argument to the <code>createQuery</code> 
+     * method), the elements of the list passed to the <code>multiselect</code>
+     * method will be passed to the X constructor and an instance
+     * of type X will be returned for each row.  
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<X[]></code> for
+     * some class X, an instance of type X[] will be returned for 
+     * each row.   The elements of the array will correspond to the 
+     * elements of the list passed to the <code>multiselect</code> method,
+     * in the specified order.  
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<Object></code>
+     * or if the criteria query was created without specifying a 
+     * type, and the list passed to the <code>multiselect</code> method contains 
+     * only a single element, an instance of type <code>Object</code> will be 
+     * returned for each row.
+     *
+     * <li> If the type of the criteria query is <code>CriteriaQuery<Object></code>
+     * or if the criteria query was created without specifying a 
+     * type, and the list passed to the <code>multiselect</code> method contains 
+     * more than one element, an instance of type <code>Object[]</code> will be 
+     * instantiated and returned for each row.  The elements of the 
+     * array will correspond to the elements of the list passed to
+     * the <code>multiselect</code> method, in the specified order.
+     * </ul>
+     *
+     * @param selectionList  list of selection items corresponding 
+     *        to the results to be returned by the query
+     * @return the modified query
+     * @throws IllegalArgumentException if a selection item is
+     *         not valid or if more than one selection item has
+     *         the same assigned alias
+     */
+    CriteriaQuery<T> multiselect(List<Selection<?>> selectionList);
+
+    /**
+     * Modify the query to restrict the query result according
+     * to the specified boolean expression.
+     * Replaces the previously added restriction(s), if any.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified query
+     */
+    CriteriaQuery<T> where(Expression<Boolean> restriction);
+
+    /**
+     * Modify the query to restrict the query result according 
+     * to the conjunction of the specified restriction predicates.
+     * Replaces the previously added restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified query
+     */
+    CriteriaQuery<T> where(Predicate... restrictions);
+
+    /**
+     * Specify the expressions that are used to form groups over
+     * the query results.
+     * Replaces the previous specified grouping expressions, if any.
+     * If no grouping expressions are specified, any previously 
+     * added grouping expressions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param grouping  zero or more grouping expressions
+     * @return the modified query
+     */
+    CriteriaQuery<T> groupBy(Expression<?>... grouping);
+
+    /**
+     * Specify the expressions that are used to form groups over
+     * the query results.
+     * Replaces the previous specified grouping expressions, if any.
+     * If no grouping expressions are specified, any previously 
+     * added grouping expressions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param grouping  list of zero or more grouping expressions
+     * @return the modified query
+     */
+    CriteriaQuery<T> groupBy(List<Expression<?>> grouping);
+
+    /**
+     * Specify a restriction over the groups of the query.
+     * Replaces the previous having restriction(s), if any.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified query
+     */
+    CriteriaQuery<T> having(Expression<Boolean> restriction);
+
+    /**
+     * Specify restrictions over the groups of the query
+     * according the conjunction of the specified restriction 
+     * predicates.
+     * Replaces the previously added having restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified query
+     */
+    CriteriaQuery<T> having(Predicate... restrictions);
+
+    /**
+     * Specify the ordering expressions that are used to
+     * order the query results.
+     * Replaces the previous ordering expressions, if any.
+     * If no ordering expressions are specified, the previous
+     * ordering, if any, is simply removed, and results will
+     * be returned in no particular order.
+     * The left-to-right sequence of the ordering expressions
+     * determines the precedence, whereby the leftmost has highest
+     * precedence.
+     * @param o  zero or more ordering expressions
+     * @return the modified query
+     */
+    CriteriaQuery<T> orderBy(Order... o);
+
+    /**
+     * Specify the ordering expressions that are used to
+     * order the query results.
+     * Replaces the previous ordering expressions, if any.
+     * If no ordering expressions are specified, the previous
+     * ordering, if any, is simply removed, and results will
+     * be returned in no particular order.
+     * The order of the ordering expressions in the list
+     * determines the precedence, whereby the first element in the
+     * list has highest precedence.
+     * @param o  list of zero or more ordering expressions
+     * @return the modified query
+     */
+    CriteriaQuery<T> orderBy(List<Order> o);
+
+    /**
+     * Specify whether duplicate query results will be eliminated.
+     * A true value will cause duplicates to be eliminated.
+     * A false value will cause duplicates to be retained.
+     * If distinct has not been specified, duplicate results must
+     * be retained.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param distinct  boolean value specifying whether duplicate
+     *        results must be eliminated from the query result or
+     *        whether they must be retained
+     * @return the modified query.
+     */
+    CriteriaQuery<T> distinct(boolean distinct);
+    
+    /**
+     * Return the ordering expressions in order of precedence.
+     * Returns empty list if no ordering expressions have been
+     * specified.
+     * Modifications to the list do not affect the query.
+     * @return the list of ordering expressions
+     */
+    List<Order> getOrderList();
+ 
+    /**
+     * Return the parameters of the query.  Returns empty set if
+     * there are no parameters.
+     * Modifications to the set do not affect the query.
+     * @return the query parameters
+     */
+    Set<ParameterExpression<?>> getParameters();
+}
diff --git a/src/javax/persistence/criteria/CriteriaUpdate.java b/src/javax/persistence/criteria/CriteriaUpdate.java
new file mode 100644
index 0000000..7ae0da0
--- /dev/null
+++ b/src/javax/persistence/criteria/CriteriaUpdate.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.EntityType;
+
+/**
+ * The <code>CriteriaUpdate</code> interface defines functionality for performing
+ * bulk update operations using the Criteria API.
+ *
+ * <p>Criteria API bulk update operations map directly to database update
+ * operations, bypassing any optimistic locking checks.  Portable 
+ * applications using bulk update operations must manually update the 
+ * value of the version column, if desired, and/or manually validate 
+ * the value of the version column.
+ * The persistence context is not synchronized with the result of the
+ * bulk update.
+ *
+ * <p> A <code>CriteriaUpdate</code> object must have a single root.
+ *
+ * @param <T>  the entity type that is the target of the update
+ *
+ * @since Java Persistence 2.1
+ */
+public interface CriteriaUpdate<T> extends CommonAbstractCriteria {
+
+   /**
+    * Create and add a query root corresponding to the entity
+    * that is the target of the update.
+    * A <code>CriteriaUpdate</code> object has a single root, the entity that
+    * is being updated.
+    * @param entityClass  the entity class
+    * @return query root corresponding to the given entity
+    */
+   Root<T> from(Class<T> entityClass);
+
+   /**
+    * Create and add a query root corresponding to the entity
+    * that is the target of the update.
+    * A <code>CriteriaUpdate</code> object has a single root, the entity that
+    * is being updated.
+    * @param entity  metamodel entity representing the entity
+    *                of type X
+    * @return query root corresponding to the given entity
+    */
+   Root<T> from(EntityType<T> entity);
+
+   /**
+    * Return the query root.
+    * @return the query root
+    */
+   Root<T> getRoot();
+
+   /**
+    * Update the value of the specified attribute.
+    * @param attribute  attribute to be updated
+    * @param value  new value
+    * @return  the modified update query
+    */
+   <Y, X extends Y> CriteriaUpdate<T> set( SingularAttribute<? super T, Y> attribute, X value);
+
+   /**
+    * Update the value of the specified attribute.
+    * @param attribute  attribute to be updated
+    * @param value  new value
+    * @return  the modified update query
+    */
+   <Y> CriteriaUpdate<T> set( SingularAttribute<? super T, Y> attribute, Expression<? extends Y> value);
+
+   /**
+    * Update the value of the specified attribute.
+    * @param attribute  attribute to be updated
+    * @param value  new value
+    * @return  the modified update query
+    */
+   <Y, X extends Y> CriteriaUpdate<T> set(Path<Y> attribute, X value);
+
+   /**
+    * Update the value of the specified attribute.
+    * @param attribute  attribute to be updated
+    * @param value  new value
+    * @return  the modified update query
+    */
+   <Y> CriteriaUpdate<T> set(Path<Y> attribute, Expression<? extends Y> value);
+
+   /**
+    * Update the value of the specified attribute.
+    * @param attributeName  name of the attribute to be updated
+    * @param value  new value
+    * @return  the modified update query
+    */
+   CriteriaUpdate<T> set(String attributeName, Object value);
+
+    /**
+     * Modify the update query to restrict the target of the update
+     * according to the specified boolean expression.
+     * Replaces the previously added restriction(s), if any.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified update query
+     */    
+   CriteriaUpdate<T> where(Expression<Boolean> restriction);
+
+    /**
+     * Modify the update query to restrict the target of the update
+     * according to the conjunction of the specified restriction 
+     * predicates.
+     * Replaces the previously added restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified update query
+     */
+   CriteriaUpdate<T> where(Predicate... restrictions);
+}
diff --git a/src/javax/persistence/criteria/Expression.java b/src/javax/persistence/criteria/Expression.java
new file mode 100644
index 0000000..3121372
--- /dev/null
+++ b/src/javax/persistence/criteria/Expression.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.Collection;
+
+/**
+ * Type for query expressions.
+ *
+ * @param <T> the type of the expression
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Expression<T> extends Selection<T> {
+
+    /**
+     *  Create a predicate to test whether the expression is null.
+     *  @return predicate testing whether the expression is null
+     */
+    Predicate isNull();
+
+    /**
+     *  Create a predicate to test whether the expression is 
+     *  not null.
+     *  @return predicate testing whether the expression is not null
+     */
+    Predicate isNotNull();
+
+    /**
+     * Create a predicate to test whether the expression is a member
+     * of the argument list.
+     * @param values  values to be tested against
+     * @return predicate testing for membership
+     */
+    Predicate in(Object... values);
+
+    /**
+     * Create a predicate to test whether the expression is a member
+     * of the argument list.
+     * @param values  expressions to be tested against
+     * @return predicate testing for membership
+     */
+    Predicate in(Expression<?>... values);
+
+    /**
+     * Create a predicate to test whether the expression is a member
+     * of the collection.
+     * @param values  collection of values to be tested against
+     * @return predicate testing for membership
+     */
+    Predicate in(Collection<?> values);
+
+    /**
+     * Create a predicate to test whether the expression is a member
+     * of the collection.
+     * @param values expression corresponding to collection to be
+     *        tested against
+     * @return predicate testing for membership
+     */
+    Predicate in(Expression<Collection<?>> values);
+
+    /**
+     * Perform a typecast upon the expression, returning a new
+     * expression object.
+     * This method does not cause type conversion:
+     * the runtime type is not changed.
+     * Warning: may result in a runtime failure.
+     * @param type  intended type of the expression
+     * @return new expression of the given type
+     */
+    <X> Expression<X> as(Class<X> type);
+}
diff --git a/src/javax/persistence/criteria/Fetch.java b/src/javax/persistence/criteria/Fetch.java
new file mode 100644
index 0000000..d11ef8e
--- /dev/null
+++ b/src/javax/persistence/criteria/Fetch.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.Attribute;
+
+/**
+ * Represents a join-fetched association or attribute.
+ *
+ * @param <Z>  the source type of the fetch
+ * @param <X>  the target type of the fetch
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Fetch<Z, X> extends FetchParent<Z, X> {
+
+    /**
+     * Return the metamodel attribute corresponding to the 
+     * fetch join.
+     * @return metamodel attribute for the join
+     */
+    Attribute<? super Z, ?> getAttribute();
+
+    /**
+     * Return the parent of the fetched item.
+     * @return fetch parent
+     */
+    FetchParent<?, Z> getParent();
+
+    /**
+     * Return the join type used in the fetch join.
+     * @return join type
+     */
+    JoinType getJoinType();
+}
diff --git a/src/javax/persistence/criteria/FetchParent.java b/src/javax/persistence/criteria/FetchParent.java
new file mode 100644
index 0000000..63b8389
--- /dev/null
+++ b/src/javax/persistence/criteria/FetchParent.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.PluralAttribute;
+import javax.persistence.metamodel.SingularAttribute;
+
+/**
+ * Represents an element of the from clause which may
+ * function as the parent of Fetches.
+ *
+ * @param <Z>  the source type
+ * @param <X>  the target type
+ *
+ * @since Java Persistence 2.0
+ */
+public interface FetchParent<Z, X> {
+
+    /**
+     *  Return the fetch joins that have been made from this type.
+     *  Returns empty set if no fetch joins have been made from
+     *  this type.
+     *  Modifications to the set do not affect the query.
+     *  @return fetch joins made from this type
+     */
+    java.util.Set<Fetch<X, ?>> getFetches();
+
+    /**
+     *  Create a fetch join to the specified single-valued attribute 
+     *  using an inner join.
+     *  @param attribute  target of the join
+     *  @return the resulting fetch join
+     */	
+    <Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute);
+
+    /**
+     *  Create a fetch join to the specified single-valued attribute 
+     *  using the given join type.
+     *  @param attribute  target of the join
+     *  @param jt  join type
+     *  @return the resulting fetch join
+     */	
+    <Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute, JoinType jt);
+
+    /**
+     *  Create a fetch join to the specified collection-valued 
+     *  attribute using an inner join. 
+     *  @param attribute  target of the join
+     *  @return the resulting join
+     */
+    <Y> Fetch<X, Y> fetch(PluralAttribute<? super X, ?, Y> attribute);
+	
+    /**
+     *  Create a fetch join to the specified collection-valued 
+     *  attribute using the given join type.
+     *  @param attribute  target of the join
+     *  @param jt  join type
+     *  @return the resulting join
+     */
+    <Y> Fetch<X, Y> fetch(PluralAttribute<? super X, ?, Y> attribute, JoinType jt);
+	
+
+    //String-based:
+	
+    /**
+     *  Create a fetch join to the specified attribute using an 
+     *  inner join.
+     *  @param attributeName  name of the attribute for the
+     *         target of the join
+     *  @return the resulting fetch join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */	
+    @SuppressWarnings("hiding")
+    <X, Y> Fetch<X, Y> fetch(String attributeName);
+
+    /**
+     *  Create a fetch join to the specified attribute using 
+     *  the given join type.
+     *  @param attributeName  name of the attribute for the
+     *               target of the join
+     *  @param jt  join type
+     *  @return the resulting fetch join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */	
+    @SuppressWarnings("hiding")
+    <X, Y> Fetch<X, Y> fetch(String attributeName, JoinType jt);
+}
diff --git a/src/javax/persistence/criteria/From.java b/src/javax/persistence/criteria/From.java
new file mode 100644
index 0000000..81b8355
--- /dev/null
+++ b/src/javax/persistence/criteria/From.java
@@ -0,0 +1,264 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.CollectionAttribute;
+import javax.persistence.metamodel.ListAttribute;
+import javax.persistence.metamodel.MapAttribute;
+import javax.persistence.metamodel.SetAttribute;
+import java.util.Set;
+
+/**
+ * Represents a bound type, usually an entity that appears in
+ * the from clause, but may also be an embeddable belonging to
+ * an entity in the from clause. 
+ * <p> Serves as a factory for Joins of associations, embeddables, and 
+ * collections belonging to the type, and for Paths of attributes 
+ * belonging to the type.
+ *
+ * @param <Z>  the source type
+ * @param <X>  the target type
+ *
+ * @since Java Persistence 2.0
+ */
+ at SuppressWarnings("hiding")
+public interface From<Z, X> extends Path<X>, FetchParent<Z, X> {
+
+    /**
+     *  Return the joins that have been made from this bound type.
+     *  Returns empty set if no joins have been made from this
+     *  bound type.
+     *  Modifications to the set do not affect the query.
+     *  @return joins made from this type
+     */
+    Set<Join<X, ?>> getJoins();
+	
+    /**
+     *  Whether the <code>From</code> object has been obtained as a result of
+     *  correlation (use of a <code>Subquery</code> <code>correlate</code> 
+     *  method).
+     *  @return boolean indicating whether the object has been
+     *          obtained through correlation
+     */
+    boolean isCorrelated();
+
+    /**
+     *  Returns the parent <code>From</code> object from which the correlated
+     *  <code>From</code> object has been obtained through correlation (use
+     *  of a <code>Subquery</code> <code>correlate</code> method).
+     *  @return  the parent of the correlated From object
+     *  @throws IllegalStateException if the From object has
+     *          not been obtained through correlation 
+     */
+    From<Z, X> getCorrelationParent();
+
+    /**
+     *  Create an inner join to the specified single-valued 
+     *  attribute.
+     *  @param attribute  target of the join
+     *  @return the resulting join
+     */
+    <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute);
+
+    /**
+     *  Create a join to the specified single-valued attribute 
+     *  using the given join type.
+     *  @param attribute  target of the join
+     *  @param jt  join type 
+     *  @return the resulting join
+     */
+    <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute, JoinType jt);
+
+    /**
+     *  Create an inner join to the specified Collection-valued 
+     *  attribute.
+     *  @param collection  target of the join
+     *  @return the resulting join
+     */
+    <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection);
+
+    /**
+     *  Create an inner join to the specified Set-valued attribute.
+     *  @param set  target of the join
+     *  @return the resulting join
+     */
+    <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set);
+
+    /**
+     *  Create an inner join to the specified List-valued attribute.
+     *  @param list  target of the join
+     *  @return the resulting join
+     */
+    <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list);
+
+    /**
+     *  Create an inner join to the specified Map-valued attribute.
+     *  @param map  target of the join
+     *  @return the resulting join
+     */
+    <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map);
+
+    /**
+     *  Create a join to the specified Collection-valued attribute 
+     *  using the given join type.
+     *  @param collection  target of the join
+     *  @param jt  join type 
+     *  @return the resulting join
+     */
+    <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection, JoinType jt);
+
+    /**
+     *  Create a join to the specified Set-valued attribute using 
+     *  the given join type.
+     *  @param set  target of the join
+     *  @param jt  join type 
+     *  @return the resulting join
+     */
+    <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set, JoinType jt);
+
+    /**
+     *  Create a join to the specified List-valued attribute using 
+     *  the given join type.
+     *  @param list  target of the join
+     *  @param jt  join type 
+     *  @return the resulting join
+     */
+    <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list, JoinType jt);
+
+    /**
+     *  Create a join to the specified Map-valued attribute using 
+     *  the given join type.
+     *  @param map  target of the join
+     *  @param jt  join type 
+     *  @return the resulting join
+     */
+    <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt);
+
+	
+    //String-based:
+
+    /**
+     *  Create an inner join to the specified attribute.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> Join<X, Y> join(String attributeName);	
+
+    /**
+     *  Create an inner join to the specified Collection-valued 
+     *  attribute.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName);	
+
+    /**
+     *  Create an inner join to the specified Set-valued attribute.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> SetJoin<X, Y> joinSet(String attributeName);	
+
+    /**
+     *  Create an inner join to the specified List-valued attribute.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> ListJoin<X, Y> joinList(String attributeName);		
+    
+    /**
+     *  Create an inner join to the specified Map-valued attribute.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, K, V> MapJoin<X, K, V> joinMap(String attributeName);	
+
+    /**
+     *  Create a join to the specified attribute using the given
+     *  join type.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @param jt  join type
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> Join<X, Y> join(String attributeName, JoinType jt);	
+    
+    /**
+     *  Create a join to the specified Collection-valued attribute 
+     *  using the given join type.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @param jt  join type
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName, JoinType jt);	
+
+    /**
+     *  Create a join to the specified Set-valued attribute using 
+     *  the given join type.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @param jt  join type
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> SetJoin<X, Y> joinSet(String attributeName, JoinType jt);	
+
+    /**
+     *  Create a join to the specified List-valued attribute using 
+     *  the given join type.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @param jt  join type
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, Y> ListJoin<X, Y> joinList(String attributeName, JoinType jt);	
+
+    /**
+     *  Create a join to the specified Map-valued attribute using 
+     *  the given join type.
+     *  @param attributeName  name of the attribute for the 
+     *               target of the join
+     *  @param jt  join type
+     *  @return the resulting join
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name does not exist
+     */
+    <X, K, V> MapJoin<X, K, V> joinMap(String attributeName, JoinType jt);	
+}
diff --git a/src/javax/persistence/criteria/Join.java b/src/javax/persistence/criteria/Join.java
new file mode 100644
index 0000000..188dfc4
--- /dev/null
+++ b/src/javax/persistence/criteria/Join.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.Attribute;
+
+/**
+ * A join to an entity, embeddable, or basic type.
+ *
+ * @param <Z> the source type of the join
+ * @param <X> the target type of the join
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Join<Z, X> extends From<Z, X> {
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restriction  a simple or compound boolean expression
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    Join<Z, X> on(Expression<Boolean> restriction);
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restrictions  zero or more restriction predicates
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    Join<Z, X> on(Predicate... restrictions);
+
+    /** 
+     *  Return the predicate that corresponds to the ON 
+     *  restriction(s) on the join, or null if no ON condition 
+     *  has been specified.
+     *  @return the ON restriction predicate
+     *  @since Java Persistence 2.1
+     */
+    Predicate getOn();
+
+    /**
+     * Return the metamodel attribute corresponding to the join.
+     * @return metamodel attribute corresponding to the join
+     */
+    Attribute<? super Z, ?> getAttribute();
+
+    /**
+     * Return the parent of the join.
+     * @return join parent
+     */
+    From<?, Z> getParent();
+
+    /**
+     * Return the join type.
+     * @return join type
+     */
+    JoinType getJoinType();
+}
diff --git a/src/javax/persistence/criteria/JoinType.java b/src/javax/persistence/criteria/JoinType.java
new file mode 100644
index 0000000..80384de
--- /dev/null
+++ b/src/javax/persistence/criteria/JoinType.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence.criteria;
+
+/**
+ * Defines the three types of joins.
+ *
+ * Right outer joins and right outer fetch joins are not required 
+ * to be supported in Java Persistence 2.1.  Applications that use
+ * <code>RIGHT</code> join types will not be portable.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum JoinType {
+
+    /** Inner join. */
+    INNER, 
+
+    /** Left outer join. */
+    LEFT, 
+
+    /** Right outer join. */
+    RIGHT
+}
diff --git a/src/javax/persistence/criteria/ListJoin.java b/src/javax/persistence/criteria/ListJoin.java
new file mode 100644
index 0000000..3890d95
--- /dev/null
+++ b/src/javax/persistence/criteria/ListJoin.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.List;
+import javax.persistence.metamodel.ListAttribute;
+
+/**
+ * The <code>ListJoin</code> interface is the type of the result of
+ * joining to a collection over an association or element 
+ * collection that has been specified as a <code>java.util.List</code>.
+ *
+ * @param <Z> the source type of the join
+ * @param <E> the element type of the target List
+ *
+ * @since Java Persistence 2.0
+ */
+public interface ListJoin<Z, E> 
+		extends PluralJoin<Z, List<E>, E> {
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restriction  a simple or compound boolean expression
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    ListJoin<Z, E> on(Expression<Boolean> restriction);
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restrictions  zero or more restriction predicates
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    ListJoin<Z, E> on(Predicate... restrictions);
+
+    /**
+     * Return the metamodel representation for the list attribute.
+     * @return metamodel type representing the <code>List</code> that is
+     *         the target of the join
+     */
+    ListAttribute<? super Z, E> getModel();
+
+    /**
+     * Create an expression that corresponds to the index of
+     * the object in the referenced association or element
+     * collection.
+     * This method must only be invoked upon an object that
+     * represents an association or element collection for
+     * which an order column has been defined.
+     * @return expression denoting the index
+     */
+    Expression<Integer> index();
+}
diff --git a/src/javax/persistence/criteria/MapJoin.java b/src/javax/persistence/criteria/MapJoin.java
new file mode 100644
index 0000000..9e87d57
--- /dev/null
+++ b/src/javax/persistence/criteria/MapJoin.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.Map;
+import javax.persistence.metamodel.MapAttribute;
+
+/**
+ * The <code>MapJoin</code> interface is the type of the result of
+ * joining to a collection over an association or element 
+ * collection that has been specified as a <code>java.util.Map</code>.
+ *
+ * @param <Z> the source type of the join
+ * @param <K> the type of the target Map key
+ * @param <V> the type of the target Map value
+ *
+ * @since Java Persistence 2.0
+ */
+public interface MapJoin<Z, K, V> 
+		extends PluralJoin<Z, Map<K, V>, V> {
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restriction  a simple or compound boolean expression
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    MapJoin<Z, K, V> on(Expression<Boolean> restriction);
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restrictions  zero or more restriction predicates
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    MapJoin<Z, K, V> on(Predicate... restrictions);
+
+    /**
+     * Return the metamodel representation for the map attribute.
+     * @return metamodel type representing the <code>Map</code> that is
+     *         the target of the join
+     */
+    MapAttribute<? super Z, K, V> getModel();
+    
+    /**
+     * Create a path expression that corresponds to the map key.
+     * @return path corresponding to map key
+     */
+    Path<K> key();
+    
+    /**
+     * Create a path expression that corresponds to the map value.
+     * This method is for stylistic use only: it just returns this.
+     * @return path corresponding to the map value
+     */
+    Path<V> value(); 
+    
+    /**
+     * Create an expression that corresponds to the map entry.
+     * @return expression corresponding to the map entry
+     */
+    Expression<Map.Entry<K, V>> entry();
+}
diff --git a/src/javax/persistence/criteria/Order.java b/src/javax/persistence/criteria/Order.java
new file mode 100644
index 0000000..2c7920f
--- /dev/null
+++ b/src/javax/persistence/criteria/Order.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence.criteria;
+
+/**
+ * An object that defines an ordering over the query results.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Order {
+
+   /**
+    * Switch the ordering.
+    * @return a new <code>Order</code> instance with the reversed ordering
+    */
+    Order reverse();
+
+   /**
+    * Whether ascending ordering is in effect.
+    * @return boolean indicating whether ordering is ascending
+    */
+    boolean isAscending();
+
+   /**
+    * Return the expression that is used for ordering.
+    * @return expression used for ordering
+    */
+   Expression<?> getExpression();
+}
diff --git a/src/javax/persistence/criteria/ParameterExpression.java b/src/javax/persistence/criteria/ParameterExpression.java
new file mode 100644
index 0000000..64e7a94
--- /dev/null
+++ b/src/javax/persistence/criteria/ParameterExpression.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.Parameter;
+
+/**
+ * Type of criteria query parameter expressions.
+ *
+ * @param <T> the type of the parameter expression
+ *
+ * @since Java Persistence 2.0
+ */
+public interface ParameterExpression<T> extends Parameter<T>, Expression<T> {}
diff --git a/src/javax/persistence/criteria/Path.java b/src/javax/persistence/criteria/Path.java
new file mode 100644
index 0000000..9f79516
--- /dev/null
+++ b/src/javax/persistence/criteria/Path.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.PluralAttribute;
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.Bindable;
+import javax.persistence.metamodel.MapAttribute;
+
+/**
+ * Represents a simple or compound attribute path from a 
+ * bound type or collection, and is a "primitive" expression.
+ *
+ * @param <X>  the type referenced by the path
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Path<X> extends Expression<X> {
+
+    /** 
+     * Return the bindable object that corresponds to the
+     * path expression.
+     * @return bindable object corresponding to the path
+     */
+    Bindable<X> getModel(); 
+    
+    /**
+     *  Return the parent "node" in the path or null if no parent.
+     *  @return parent
+     */
+    Path<?> getParentPath();
+	
+    /**
+     *  Create a path corresponding to the referenced 
+     *  single-valued attribute.
+     *  @param attribute single-valued attribute
+     *  @return path corresponding to the referenced attribute
+     */
+    <Y> Path<Y> get(SingularAttribute<? super X, Y> attribute);
+
+    /**
+     *  Create a path corresponding to the referenced 
+     *  collection-valued attribute.
+     *  @param collection collection-valued attribute
+     *  @return expression corresponding to the referenced attribute
+     */
+    <E, C extends java.util.Collection<E>> Expression<C> get(PluralAttribute<X, C, E> collection);
+
+    /**
+     *  Create a path corresponding to the referenced 
+     *  map-valued attribute.
+     *  @param map map-valued attribute
+     *  @return expression corresponding to the referenced attribute
+     */
+    <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map);
+
+    /**
+     *  Create an expression corresponding to the type of the path.
+     *  @return expression corresponding to the type of the path
+     */
+    Expression<Class<? extends X>> type();
+
+
+    //String-based:
+	
+    /**
+     *  Create a path corresponding to the referenced attribute.
+     * 
+     *  <p> Note: Applications using the string-based API may need to 
+     *  specify the type resulting from the <code>get</code> operation in order
+     *  to avoid the use of <code>Path</code> variables.
+     *
+     *  <pre>
+     *     For example:
+     *
+     *     CriteriaQuery<Person> q = cb.createQuery(Person.class);
+     *     Root<Person> p = q.from(Person.class);
+     *     q.select(p)
+     *      .where(cb.isMember("joe",
+     *                         p.<Set<String>>get("nicknames")));
+     *
+     *     rather than:
+     * 
+     *     CriteriaQuery<Person> q = cb.createQuery(Person.class);
+     *     Root<Person> p = q.from(Person.class);
+     *     Path<Set<String>> nicknames = p.get("nicknames");
+     *     q.select(p)
+     *      .where(cb.isMember("joe", nicknames));
+     *  </pre>
+     *
+     *  @param attributeName  name of the attribute
+     *  @return path corresponding to the referenced attribute
+     *  @throws IllegalStateException if invoked on a path that
+     *          corresponds to a basic type
+     *  @throws IllegalArgumentException if attribute of the given
+     *           name does not otherwise exist
+     */
+    <Y> Path<Y> get(String attributeName);
+}
diff --git a/src/javax/persistence/criteria/PluralJoin.java b/src/javax/persistence/criteria/PluralJoin.java
new file mode 100644
index 0000000..86f9ee2
--- /dev/null
+++ b/src/javax/persistence/criteria/PluralJoin.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.PluralAttribute;
+
+/**
+ * The <code>PluralJoin</code> interface defines functionality
+ * that is common to joins to all collection types.  It is
+ * not intended to be used directly in query construction.
+ *
+ * @param <Z> the source type
+ * @param <C> the collection type
+ * @param <E> the element type of the collection 
+ *
+ * @since Java Persistence 2.0
+ */
+public interface PluralJoin<Z, C, E> extends Join<Z, E> {
+
+    /**
+     * Return the metamodel representation for the collection-valued 
+     * attribute corresponding to the join.
+     * @return metamodel collection-valued attribute corresponding
+     *         to the target of the join
+     */
+    PluralAttribute<? super Z, C, E> getModel();
+}
diff --git a/src/javax/persistence/criteria/Predicate.java b/src/javax/persistence/criteria/Predicate.java
new file mode 100644
index 0000000..b1a09a5
--- /dev/null
+++ b/src/javax/persistence/criteria/Predicate.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.List;
+
+/**
+ * The type of a simple or compound predicate: a conjunction or
+ * disjunction of restrictions.
+ * A simple predicate is considered to be a conjunction with a
+ * single conjunct.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Predicate extends Expression<Boolean> {
+
+        public static enum BooleanOperator {
+              AND, OR
+        }
+	
+    /**
+     * Return the boolean operator for the predicate.
+     * If the predicate is simple, this is <code>AND</code>.
+     * @return boolean operator for the predicate
+     */
+    BooleanOperator getOperator();
+    
+    /**
+     * Whether the predicate has been created from another
+     * predicate by applying the <code>Predicate.not()</code> method
+     * or the <code>CriteriaBuilder.not()</code> method.
+     * @return boolean indicating if the predicate is 
+     *                 a negated predicate
+     */
+    boolean isNegated();
+
+    /**
+     * Return the top-level conjuncts or disjuncts of the predicate.
+     * Returns empty list if there are no top-level conjuncts or
+     * disjuncts of the predicate.
+     * Modifications to the list do not affect the query.
+     * @return list of boolean expressions forming the predicate
+     */
+    List<Expression<Boolean>> getExpressions();
+
+    /**
+     * Create a negation of the predicate.
+     * @return negated predicate 
+     */
+    Predicate not();
+
+}
diff --git a/src/javax/persistence/criteria/Root.java b/src/javax/persistence/criteria/Root.java
new file mode 100644
index 0000000..55c9cc8
--- /dev/null
+++ b/src/javax/persistence/criteria/Root.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.EntityType;
+
+/**
+ * A root type in the from clause.
+ * Query roots always reference entities.
+ *
+ * @param <X> the entity type referenced by the root
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Root<X> extends From<X, X> {
+
+    /**
+     * Return the metamodel entity corresponding to the root.
+     * @return metamodel entity corresponding to the root
+     */
+    EntityType<X> getModel();
+}
diff --git a/src/javax/persistence/criteria/Selection.java b/src/javax/persistence/criteria/Selection.java
new file mode 100644
index 0000000..743f928
--- /dev/null
+++ b/src/javax/persistence/criteria/Selection.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import javax.persistence.TupleElement;
+import java.util.List;
+
+/**
+ * The <code>Selection</code> interface defines an item that is to be
+ * returned in a query result.
+ *
+ * @param <X> the type of the selection item
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Selection<X> extends TupleElement<X> {
+
+    /**
+     * Assigns an alias to the selection item.
+     * Once assigned, an alias cannot be changed or reassigned.
+     * Returns the same selection item.
+     * @param name  alias
+     * @return selection item 
+     */
+    Selection<X> alias(String name);
+
+    /**
+     * Whether the selection item is a compound selection.
+     * @return boolean indicating whether the selection is a compound
+     *         selection
+     */
+    boolean isCompoundSelection();
+
+    /**
+     * Return the selection items composing a compound selection.
+     * Modifications to the list do not affect the query.
+     * @return list of selection items
+     * @throws IllegalStateException if selection is not a 
+     *         compound selection
+     */
+    List<Selection<?>> getCompoundSelectionItems();
+}
diff --git a/src/javax/persistence/criteria/SetJoin.java b/src/javax/persistence/criteria/SetJoin.java
new file mode 100644
index 0000000..be83924
--- /dev/null
+++ b/src/javax/persistence/criteria/SetJoin.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.Set;
+import javax.persistence.metamodel.SetAttribute;
+
+/**
+ * The <code>SetJoin</code> interface is the type of the result of
+ * joining to a collection over an association or element 
+ * collection that has been specified as a <code>java.util.Set</code>.
+ *
+ * @param <Z> the source type of the join
+ * @param <E> the element type of the target <code>Set</code> 
+ *
+ * @since Java Persistence 2.0
+ */
+public interface SetJoin<Z, E> extends PluralJoin<Z, Set<E>, E> {
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restriction  a simple or compound boolean expression
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    SetJoin<Z, E> on(Expression<Boolean> restriction);
+
+    /**
+     *  Modify the join to restrict the result according to the
+     *  specified ON condition and return the join object.  
+     *  Replaces the previous ON condition, if any.
+     *  @param restrictions  zero or more restriction predicates
+     *  @return the modified join object
+     *  @since Java Persistence 2.1
+     */
+    SetJoin<Z, E> on(Predicate... restrictions);
+
+    /**
+     * Return the metamodel representation for the set attribute.
+     * @return metamodel type representing the <code>Set</code> that is
+     *         the target of the join
+     */
+    SetAttribute<? super Z, E> getModel();
+}
diff --git a/src/javax/persistence/criteria/Subquery.java b/src/javax/persistence/criteria/Subquery.java
new file mode 100644
index 0000000..84a2b2e
--- /dev/null
+++ b/src/javax/persistence/criteria/Subquery.java
@@ -0,0 +1,212 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The <code>Subquery</code> interface defines functionality that is 
+ * specific to subqueries.
+ *
+ * A subquery has an expression as its selection item.
+ *
+ * @param <T> the type of the selection item.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Subquery<T> extends AbstractQuery<T>, Expression<T> {
+	
+    /**
+     * Specify the item that is to be returned as the subquery 
+     * result.
+     * Replaces the previously specified selection, if any.
+     * @param expression  expression specifying the item that
+     *        is to be returned as the subquery result
+     * @return the modified subquery
+     */
+    Subquery<T> select(Expression<T> expression);
+	
+    /**
+     * Modify the subquery to restrict the result according
+     * to the specified boolean expression.
+     * Replaces the previously added restriction(s), if any.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified subquery
+     */
+    Subquery<T> where(Expression<Boolean> restriction);
+
+    /**
+     * Modify the subquery to restrict the result according 
+     * to the conjunction of the specified restriction predicates.
+     * Replaces the previously added restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified subquery
+     */
+    Subquery<T> where(Predicate... restrictions);
+
+    /**
+     * Specify the expressions that are used to form groups over
+     * the subquery results.
+     * Replaces the previous specified grouping expressions, if any.
+     * If no grouping expressions are specified, any previously 
+     * added grouping expressions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param grouping  zero or more grouping expressions
+     * @return the modified subquery
+     */
+    Subquery<T> groupBy(Expression<?>... grouping);
+
+    /**
+     * Specify the expressions that are used to form groups over
+     * the subquery results.
+     * Replaces the previous specified grouping expressions, if any.
+     * If no grouping expressions are specified, any previously 
+     * added grouping expressions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param grouping  list of zero or more grouping expressions
+     * @return the modified subquery
+     */
+    Subquery<T> groupBy(List<Expression<?>> grouping);
+
+    /**
+     * Specify a restriction over the groups of the subquery.
+     * Replaces the previous having restriction(s), if any.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restriction  a simple or compound boolean expression
+     * @return the modified subquery
+     */
+    Subquery<T> having(Expression<Boolean> restriction);
+
+    /**
+     * Specify restrictions over the groups of the subquery
+     * according the conjunction of the specified restriction 
+     * predicates.
+     * Replaces the previously added having restriction(s), if any.
+     * If no restrictions are specified, any previously added
+     * restrictions are simply removed.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param restrictions  zero or more restriction predicates
+     * @return the modified subquery
+     */
+    Subquery<T> having(Predicate... restrictions);
+
+    /**
+     * Specify whether duplicate query results will be eliminated.
+     * A true value will cause duplicates to be eliminated.
+     * A false value will cause duplicates to be retained.
+     * If distinct has not been specified, duplicate results must
+     * be retained.
+     * This method only overrides the return type of the 
+     * corresponding <code>AbstractQuery</code> method.
+     * @param distinct  boolean value specifying whether duplicate
+     *        results must be eliminated from the subquery result or
+     *        whether they must be retained
+     * @return the modified subquery.
+     */
+    Subquery<T> distinct(boolean distinct);
+	
+    /**
+     * Create a subquery root correlated to a root of the 
+     * enclosing query.
+     * @param parentRoot  a root of the containing query
+     * @return subquery root
+     */
+    <Y> Root<Y> correlate(Root<Y> parentRoot);
+
+    /**
+     * Create a subquery join object correlated to a join object
+     * of the enclosing query.
+     * @param parentJoin  join object of the containing query
+     * @return subquery join
+     */
+    <X, Y> Join<X, Y> correlate(Join<X, Y> parentJoin);
+
+    /**
+     * Create a subquery collection join object correlated to a 
+     * collection join object of the enclosing query.
+     * @param parentCollection  join object of the containing query
+     * @return subquery join
+     */
+    <X, Y> CollectionJoin<X, Y> correlate(CollectionJoin<X, Y> parentCollection);
+
+    /**
+     * Create a subquery set join object correlated to a set join
+     * object of the enclosing query.
+     * @param parentSet  join object of the containing query
+     * @return subquery join
+     */
+    <X, Y> SetJoin<X, Y> correlate(SetJoin<X, Y> parentSet);
+
+    /**
+     * Create a subquery list join object correlated to a list join
+     * object of the enclosing query.
+     * @param parentList join object of the containing query
+     * @return subquery join
+     */
+    <X, Y> ListJoin<X, Y> correlate(ListJoin<X, Y> parentList);
+
+    /**
+     * Create a subquery map join object correlated to a map join
+     * object of the enclosing query.
+     * @param parentMap join object of the containing query
+     * @return subquery join
+     */
+    <X, K, V> MapJoin<X, K, V> correlate(MapJoin<X, K, V> parentMap);
+
+    /**
+     * Return the query of which this is a subquery.
+     * This must be a CriteriaQuery or a Subquery.
+     * @return the enclosing query or subquery
+     */
+    AbstractQuery<?> getParent();
+
+    /**
+     * Return the query of which this is a subquery.
+     * This may be a CriteriaQuery, CriteriaUpdate, CriteriaDelete,
+     * or a Subquery.
+     * @return the enclosing query or subquery
+     * @since Java Persistence 2.1
+     */
+    CommonAbstractCriteria getContainingQuery();
+	
+    /**
+     * Return the selection expression.
+     * @return the item to be returned in the subquery result
+     */
+    Expression<T> getSelection();
+
+    /**
+     *  Return the correlated joins of the subquery.
+     *  Returns empty set if the subquery has no correlated
+     *  joins.
+     *  Modifications to the set do not affect the query.
+     *  @return the correlated joins of the subquery
+     */
+    Set<Join<?, ?>> getCorrelatedJoins();
+
+}
+
diff --git a/src/javax/persistence/criteria/package-info.java b/src/javax/persistence/criteria/package-info.java
new file mode 100644
index 0000000..f283af1
--- /dev/null
+++ b/src/javax/persistence/criteria/package-info.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+
+/**
+ * Java Persistence Criteria API
+ */
+package javax.persistence.criteria;
diff --git a/src/javax/persistence/metamodel/Attribute.java b/src/javax/persistence/metamodel/Attribute.java
new file mode 100644
index 0000000..bbbd27f
--- /dev/null
+++ b/src/javax/persistence/metamodel/Attribute.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Represents an attribute of a Java type.
+ *
+ * @param <X> The represented type that contains the attribute
+ * @param <Y> The type of the represented attribute
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Attribute<X, Y> {
+
+	public static enum PersistentAttributeType {
+	    
+	     /** Many-to-one association */
+	     MANY_TO_ONE, 
+
+     	 /** One-to-one association */
+	     ONE_TO_ONE, 
+	     
+	     /** Basic attribute */
+	     BASIC, 
+
+	     /** Embeddable class attribute */
+	     EMBEDDED,
+
+	     /** Many-to-many association */
+	     MANY_TO_MANY, 
+
+	     /** One-to-many association */
+	     ONE_TO_MANY, 
+
+	     /** Element collection */
+	     ELEMENT_COLLECTION
+	}
+
+    /**
+     * Return the name of the attribute.
+     * @return name
+     */
+    String getName();
+
+    /**
+     *  Return the persistent attribute type for the attribute.
+     *  @return persistent attribute type
+     */
+    PersistentAttributeType getPersistentAttributeType();
+
+    /**
+     *  Return the managed type representing the type in which 
+     *  the attribute was declared.
+     *  @return declaring type
+     */
+    ManagedType<X> getDeclaringType();
+
+    /**
+     *  Return the Java type of the represented attribute.
+     *  @return Java type
+     */
+    Class<Y> getJavaType();
+
+    /**
+     *  Return the <code>java.lang.reflect.Member</code> for the represented 
+     *  attribute.
+     *  @return corresponding <code>java.lang.reflect.Member</code>
+     */
+    java.lang.reflect.Member getJavaMember();
+
+    /**
+     *  Is the attribute an association.
+     *  @return boolean indicating whether the attribute 
+     *          corresponds to an association
+     */
+    boolean isAssociation();
+
+    /**
+     *  Is the attribute collection-valued (represents a Collection,
+     *  Set, List, or Map).
+     *  @return boolean indicating whether the attribute is 
+     *          collection-valued
+     */
+    boolean isCollection();
+}
diff --git a/src/javax/persistence/metamodel/BasicType.java b/src/javax/persistence/metamodel/BasicType.java
new file mode 100644
index 0000000..d69040b
--- /dev/null
+++ b/src/javax/persistence/metamodel/BasicType.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>BasicType</code> represent basic types (including
+ * temporal and enumerated types).
+ *
+ * @param <X> The type of the represented basic type
+ *
+ * @since Java Persistence 2.0
+ */
+public interface BasicType<X> extends Type<X> {}
diff --git a/src/javax/persistence/metamodel/Bindable.java b/src/javax/persistence/metamodel/Bindable.java
new file mode 100644
index 0000000..4556116
--- /dev/null
+++ b/src/javax/persistence/metamodel/Bindable.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>Bindable</code> represent object or attribute types 
+ * that can be bound into a {@link javax.persistence.criteria.Path Path}.
+ *
+ * @param <T>  The type of the represented object or attribute
+ *
+ * @since Java Persistence 2.0
+ *
+ */
+public interface Bindable<T> {
+	
+	public static enum BindableType { 
+
+	    /** Single-valued attribute type */
+	    SINGULAR_ATTRIBUTE, 
+
+	    /** Multi-valued attribute type */
+	    PLURAL_ATTRIBUTE, 
+
+	    /** Entity type */
+	    ENTITY_TYPE
+	}
+
+    /**
+     *  Return the bindable type of the represented object.
+     *  @return bindable type
+     */	
+    BindableType getBindableType();
+	
+    /**
+     * Return the Java type of the represented object.
+     * If the bindable type of the object is <code>PLURAL_ATTRIBUTE</code>,
+     * the Java element type is returned. If the bindable type is
+     * <code>SINGULAR_ATTRIBUTE</code> or <code>ENTITY_TYPE</code>, 
+     * the Java type of the
+     * represented entity or attribute is returned.
+     * @return Java type
+     */
+    Class<T> getBindableJavaType();
+}
diff --git a/src/javax/persistence/metamodel/CollectionAttribute.java b/src/javax/persistence/metamodel/CollectionAttribute.java
new file mode 100644
index 0000000..66095b5
--- /dev/null
+++ b/src/javax/persistence/metamodel/CollectionAttribute.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>CollectionAttribute</code> represent persistent 
+ * <code>java.util.Collection</code>-valued attributes.
+ *
+ * @param <X> The type the represented Collection belongs to
+ * @param <E> The element type of the represented Collection
+ *
+ * @since Java Persistence 2.0
+ *
+ */
+public interface CollectionAttribute<X, E> 
+	extends PluralAttribute<X, java.util.Collection<E>, E> {}
diff --git a/src/javax/persistence/metamodel/EmbeddableType.java b/src/javax/persistence/metamodel/EmbeddableType.java
new file mode 100644
index 0000000..949c3d0
--- /dev/null
+++ b/src/javax/persistence/metamodel/EmbeddableType.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ *  Instances of the type <code>EmbeddableType</code> represent embeddable types.
+ *
+ *  @param <X> The represented type.
+ *
+ *  @since Java Persistence 2.0
+ *
+ */
+public interface EmbeddableType<X> extends ManagedType<X> {}
diff --git a/src/javax/persistence/metamodel/EntityType.java b/src/javax/persistence/metamodel/EntityType.java
new file mode 100644
index 0000000..c2d4b28
--- /dev/null
+++ b/src/javax/persistence/metamodel/EntityType.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ *  Instances of the type <code>EntityType</code> represent entity types.
+ *
+ *  @param <X> The represented entity type.
+ *
+ * @since Java Persistence 2.0
+ *
+ */
+public interface EntityType<X> 
+            extends IdentifiableType<X>, Bindable<X>{
+
+    /**
+     *  Return the entity name.
+     *  @return entity name
+     */
+    String getName();
+}
diff --git a/src/javax/persistence/metamodel/IdentifiableType.java b/src/javax/persistence/metamodel/IdentifiableType.java
new file mode 100644
index 0000000..14e534c
--- /dev/null
+++ b/src/javax/persistence/metamodel/IdentifiableType.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+import java.util.Set;
+
+/**
+ *  Instances of the type <code>IdentifiableType</code> represent entity or 
+ *  mapped superclass types.
+ *
+ *  @param <X> The represented entity or mapped superclass type.
+ *
+ *  @since Java Persistence 2.0
+ *
+ */
+public interface IdentifiableType<X> extends ManagedType<X> {
+	
+    /**
+     *  Return the attribute that corresponds to the id attribute of 
+     *  the entity or mapped superclass.
+     *  @param type  the type of the represented id attribute
+     *  @return id attribute
+     *  @throws IllegalArgumentException if id attribute of the given
+     *          type is not present in the identifiable type or if
+     *          the identifiable type has an id class
+     */
+    <Y> SingularAttribute<? super X, Y> getId(Class<Y> type);
+
+    /**
+     *  Return the attribute that corresponds to the id attribute 
+     *  declared by the entity or mapped superclass.
+     *  @param type  the type of the represented declared 
+     *               id attribute
+     *  @return declared id attribute
+     *  @throws IllegalArgumentException if id attribute of the given
+     *          type is not declared in the identifiable type or if
+     *          the identifiable type has an id class
+     */
+    <Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> type);
+
+    /**
+     *  Return the attribute that corresponds to the version 
+     *  attribute of the entity or mapped superclass.
+     *  @param type  the type of the represented version attribute
+     *  @return version attribute
+     *  @throws IllegalArgumentException if version attribute of the 
+     * 	        given type is not present in the identifiable type
+     */
+    <Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type);
+
+    /**
+     *  Return the attribute that corresponds to the version 
+     *  attribute declared by the entity or mapped superclass.
+     *  @param type  the type of the represented declared version 
+     *               attribute
+     *  @return declared version attribute
+     *  @throws IllegalArgumentException if version attribute of the 
+     *          type is not declared in the identifiable type
+     */
+    <Y> SingularAttribute<X, Y> getDeclaredVersion(Class<Y> type);
+	
+    /**
+     *  Return the identifiable type that corresponds to the most
+     *  specific mapped superclass or entity extended by the entity 
+     *  or mapped superclass. 
+     *  @return supertype of identifiable type or null if no 
+     *          such supertype
+     */
+    IdentifiableType<? super X> getSupertype();
+
+    /**
+     *  Whether the identifiable type has a single id attribute.
+     *  Returns true for a simple id or embedded id; returns false
+     *  for an idclass.
+     *  @return boolean indicating whether the identifiable
+     *          type has a single id attribute
+     */
+    boolean hasSingleIdAttribute();
+
+    /**
+     *  Whether the identifiable type has a version attribute.
+     *  @return boolean indicating whether the identifiable
+     *          type has a version attribute
+     */
+    boolean hasVersionAttribute();
+
+    /**
+     *   Return the attributes corresponding to the id class of the
+     *   identifiable type.
+     *   @return id attributes
+     *   @throws IllegalArgumentException if the identifiable type
+     *           does not have an id class
+     */
+     Set<SingularAttribute<? super X, ?>> getIdClassAttributes();
+
+    /**
+     *  Return the type that represents the type of the id.
+     *  @return type of id
+     */
+    Type<?> getIdType();
+}
diff --git a/src/javax/persistence/metamodel/ListAttribute.java b/src/javax/persistence/metamodel/ListAttribute.java
new file mode 100644
index 0000000..ee8c390
--- /dev/null
+++ b/src/javax/persistence/metamodel/ListAttribute.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>ListAttribute</code> represent persistent 
+ * <code>javax.util.List</code>-valued attributes.
+ *
+ * @param <X> The type the represented List belongs to
+ * @param <E> The element type of the represented List
+ *
+ * @since Java Persistence 2.0
+ *
+ */
+public interface ListAttribute<X, E> 
+		extends PluralAttribute<X, java.util.List<E>, E> {}
diff --git a/src/javax/persistence/metamodel/ManagedType.java b/src/javax/persistence/metamodel/ManagedType.java
new file mode 100644
index 0000000..f0b7537
--- /dev/null
+++ b/src/javax/persistence/metamodel/ManagedType.java
@@ -0,0 +1,339 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+import java.util.Set;
+
+/**
+ *  Instances of the type <code>ManagedType</code> represent entity, mapped 
+ *  superclass, and embeddable types.
+ *
+ *  @param <X> The represented type.
+ *
+ *  @since Java Persistence 2.0
+ *
+ */
+public interface ManagedType<X> extends Type<X> {
+
+    /**
+     *  Return the attributes of the managed type.
+     *  @return attributes of the managed type
+     */
+     Set<Attribute<? super X, ?>> getAttributes();
+
+    /**
+     *  Return the attributes declared by the managed type.
+     *  Returns empty set if the managed type has no declared
+     *  attributes.
+     *  @return declared attributes of the managed type
+     */
+     Set<Attribute<X, ?>> getDeclaredAttributes();
+
+    /**
+     *  Return the single-valued attribute of the managed 
+     *  type that corresponds to the specified name and Java type.
+     *  @param name  the name of the represented attribute
+     *  @param type  the type of the represented attribute
+     *  @return single-valued attribute with given name and type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not present in the managed type
+     */
+    <Y> SingularAttribute<? super X, Y> getSingularAttribute(String name, Class<Y> type);
+
+    /**
+     *  Return the single-valued attribute declared by the 
+     *  managed type that corresponds to the specified name and 
+     *  Java type.
+     *  @param name  the name of the represented attribute
+     *  @param type  the type of the represented attribute
+     *  @return declared single-valued attribute of the given 
+     *          name and type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not declared in the managed type
+     */
+    <Y> SingularAttribute<X, Y> getDeclaredSingularAttribute(String name, Class<Y> type);
+
+    /**
+     *  Return the single-valued attributes of the managed type.
+     *  Returns empty set if the managed type has no single-valued
+     *  attributes.
+     *  @return single-valued attributes
+     */
+    Set<SingularAttribute<? super X, ?>> getSingularAttributes();
+
+    /**
+     *  Return the single-valued attributes declared by the managed
+     *  type.
+     *  Returns empty set if the managed type has no declared
+     *  single-valued attributes.
+     *  @return declared single-valued attributes
+     */
+    Set<SingularAttribute<X, ?>> getDeclaredSingularAttributes();
+
+    /**
+     *  Return the Collection-valued attribute of the managed type 
+     *  that corresponds to the specified name and Java element type.
+     *  @param name  the name of the represented attribute
+     *  @param elementType  the element type of the represented 
+     *                      attribute
+     *  @return CollectionAttribute of the given name and element
+     *          type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not present in the managed type
+     */    
+    <E> CollectionAttribute<? super X, E> getCollection(String name, Class<E> elementType);
+
+    /**
+     *  Return the Collection-valued attribute declared by the 
+     *  managed type that corresponds to the specified name and Java 
+     *  element type.
+     *  @param name  the name of the represented attribute
+     *  @param elementType  the element type of the represented 
+     *                      attribute
+     *  @return declared <code>CollectionAttribute</code> of the given name and 
+     *          element type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not declared in the managed type
+     */
+    <E> CollectionAttribute<X, E> getDeclaredCollection(String name, Class<E> elementType);
+
+    /**
+     *  Return the Set-valued attribute of the managed type that
+     *  corresponds to the specified name and Java element type.
+     *  @param name  the name of the represented attribute
+     *  @param elementType  the element type of the represented 
+     *                      attribute
+     *  @return SetAttribute of the given name and element type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not present in the managed type
+     */
+    <E> SetAttribute<? super X, E> getSet(String name, Class<E> elementType);
+
+    /**
+     *  Return the Set-valued attribute declared by the managed type 
+     *  that corresponds to the specified name and Java element type.
+     *  @param name  the name of the represented attribute
+     *  @param elementType  the element type of the represented 
+     *                      attribute
+     *  @return declared SetAttribute of the given name and 
+     *          element type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not declared in the managed type
+     */
+    <E> SetAttribute<X, E> getDeclaredSet(String name, Class<E> elementType);
+
+    /**
+     *  Return the List-valued attribute of the managed type that
+     *  corresponds to the specified name and Java element type.
+     *  @param name  the name of the represented attribute
+     *  @param elementType  the element type of the represented 
+     *                      attribute
+     *  @return ListAttribute of the given name and element type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not present in the managed type
+     */
+    <E> ListAttribute<? super X, E> getList(String name, Class<E> elementType);
+
+    /**
+     *  Return the List-valued attribute declared by the managed 
+     *  type that corresponds to the specified name and Java 
+     *  element type.
+     *  @param name  the name of the represented attribute
+     *  @param elementType  the element type of the represented 
+     *                      attribute
+     *  @return declared ListAttribute of the given name and 
+     *          element type
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not declared in the managed type
+     */
+    <E> ListAttribute<X, E> getDeclaredList(String name, Class<E> elementType);
+
+    /**
+     *  Return the Map-valued attribute of the managed type that
+     *  corresponds to the specified name and Java key and value
+     *  types.
+     *  @param name  the name of the represented attribute
+     *  @param keyType  the key type of the represented attribute
+     *  @param valueType  the value type of the represented attribute
+     *  @return MapAttribute of the given name and key and value
+     *  types
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not present in the managed type
+     */
+    <K, V> MapAttribute<? super X, K, V> getMap(String name, 
+                                                Class<K> keyType, 
+                                                Class<V> valueType);
+
+    /**
+     *  Return the Map-valued attribute declared by the managed 
+     *  type that corresponds to the specified name and Java key 
+     *  and value types.
+     *  @param name  the name of the represented attribute
+     *  @param keyType  the key type of the represented attribute
+     *  @param valueType  the value type of the represented attribute
+     *  @return declared MapAttribute of the given name and key 
+     *          and value types
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name and type is not declared in the managed type
+     */
+    <K, V> MapAttribute<X, K, V> getDeclaredMap(String name, 
+                                                Class<K> keyType, 
+                                                Class<V> valueType);
+    
+    /**
+     *  Return all multi-valued attributes (Collection-, Set-,
+     *  List-, and Map-valued attributes) of the managed type.
+     *  Returns empty set if the managed type has no multi-valued
+     *  attributes.
+     *  @return Collection-, Set-, List-, and Map-valued attributes
+     */
+    Set<PluralAttribute<? super X, ?, ?>> getPluralAttributes();
+
+    /**
+     *  Return all multi-valued attributes (Collection-, Set-,
+     *  List-, and Map-valued attributes) declared by the 
+     *  managed type.
+     *  Returns empty set if the managed type has no declared
+     *  multi-valued attributes.
+     *  @return declared Collection-, Set-, List-, and Map-valued
+     *          attributes
+     */
+    Set<PluralAttribute<X, ?, ?>> getDeclaredPluralAttributes();
+
+
+//String-based:
+
+    /**
+     *  Return the attribute of the managed
+     *  type that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return attribute with given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not present in the managed type
+     */
+    Attribute<? super X, ?> getAttribute(String name); 
+
+    /**
+     *  Return the attribute declared by the managed
+     *  type that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return attribute with given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not declared in the managed type
+     */
+    Attribute<X, ?> getDeclaredAttribute(String name); 
+
+    /**
+     *  Return the single-valued attribute of the managed type that
+     *  corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return single-valued attribute with the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not present in the managed type
+     */
+    SingularAttribute<? super X, ?> getSingularAttribute(String name);
+
+    /**
+     *  Return the single-valued attribute declared by the managed
+     *  type that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return declared single-valued attribute of the given 
+     *          name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not declared in the managed type
+     */
+    SingularAttribute<X, ?> getDeclaredSingularAttribute(String name);
+
+    /**
+     *  Return the Collection-valued attribute of the managed type 
+     *  that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return CollectionAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not present in the managed type
+     */    
+    CollectionAttribute<? super X, ?> getCollection(String name); 
+
+    /**
+     *  Return the Collection-valued attribute declared by the 
+     *  managed type that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return declared CollectionAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not declared in the managed type
+     */
+    CollectionAttribute<X, ?> getDeclaredCollection(String name); 
+
+    /**
+     *  Return the Set-valued attribute of the managed type that
+     *  corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return SetAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not present in the managed type
+     */
+    SetAttribute<? super X, ?> getSet(String name);
+
+    /**
+     *  Return the Set-valued attribute declared by the managed type 
+     *  that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return declared SetAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not declared in the managed type
+     */
+    SetAttribute<X, ?> getDeclaredSet(String name);
+
+    /**
+     *  Return the List-valued attribute of the managed type that
+     *  corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return ListAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not present in the managed type
+     */
+    ListAttribute<? super X, ?> getList(String name);
+
+    /**
+     *  Return the List-valued attribute declared by the managed 
+     *  type that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return declared ListAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not declared in the managed type
+     */
+    ListAttribute<X, ?> getDeclaredList(String name);
+
+    /**
+     *  Return the Map-valued attribute of the managed type that
+     *  corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return MapAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not present in the managed type
+     */
+    MapAttribute<? super X, ?, ?> getMap(String name); 
+
+    /**
+     *  Return the Map-valued attribute declared by the managed 
+     *  type that corresponds to the specified name.
+     *  @param name  the name of the represented attribute
+     *  @return declared MapAttribute of the given name
+     *  @throws IllegalArgumentException if attribute of the given
+     *          name is not declared in the managed type
+     */
+    MapAttribute<X, ?, ?> getDeclaredMap(String name);
+}
diff --git a/src/javax/persistence/metamodel/MapAttribute.java b/src/javax/persistence/metamodel/MapAttribute.java
new file mode 100644
index 0000000..1c0d769
--- /dev/null
+++ b/src/javax/persistence/metamodel/MapAttribute.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>MapAttribute</code> represent
+ * persistent <code>java.util.Map</code>-valued attributes.
+ *
+ * @param <X> The type the represented Map belongs to
+ * @param <K> The type of the key of the represented Map
+ * @param <V> The type of the value of the represented Map
+ *
+ * @since Java Persistence 2.0
+ *
+ */
+public interface MapAttribute<X, K, V> 
+	extends PluralAttribute<X, java.util.Map<K, V>, V> {
+
+    /**
+     * Return the Java type of the map key.
+     * @return Java key type
+     */
+    Class<K> getKeyJavaType();
+
+    /**
+     * Return the type representing the key type of the map.
+     * @return type representing key type
+     */
+    Type<K> getKeyType();
+}
diff --git a/src/javax/persistence/metamodel/MappedSuperclassType.java b/src/javax/persistence/metamodel/MappedSuperclassType.java
new file mode 100644
index 0000000..8f69a79
--- /dev/null
+++ b/src/javax/persistence/metamodel/MappedSuperclassType.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ *  Instances of the type <code>MappedSuperclassType</code> represent mapped
+ *  superclass types.
+ *
+ *  @param <X> The represented entity type
+ *  @since Java Persistence 2.0
+ */
+public interface MappedSuperclassType<X> extends IdentifiableType<X> {}
diff --git a/src/javax/persistence/metamodel/Metamodel.java b/src/javax/persistence/metamodel/Metamodel.java
new file mode 100644
index 0000000..fb9eddd
--- /dev/null
+++ b/src/javax/persistence/metamodel/Metamodel.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+import java.util.Set;
+
+/**
+ * Provides access to the metamodel of persistent
+ * entities in the persistence unit. 
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Metamodel {
+
+    /**
+     *  Return the metamodel entity type representing the entity.
+     *  @param cls  the type of the represented entity
+     *  @return the metamodel entity type
+     *  @throws IllegalArgumentException if not an entity
+     */
+    <X> EntityType<X> entity(Class<X> cls);
+
+    /**
+     *  Return the metamodel managed type representing the 
+     *  entity, mapped superclass, or embeddable class.
+     *  @param cls  the type of the represented managed class
+     *  @return the metamodel managed type
+     *  @throws IllegalArgumentException if not a managed class
+     */
+    <X> ManagedType<X> managedType(Class<X> cls);
+    
+    /**
+     *  Return the metamodel embeddable type representing the
+     *  embeddable class.
+     *  @param cls  the type of the represented embeddable class
+     *  @return the metamodel embeddable type
+     *  @throws IllegalArgumentException if not an embeddable class
+     */
+    <X> EmbeddableType<X> embeddable(Class<X> cls);
+
+    /**
+     *  Return the metamodel managed types.
+     *  @return the metamodel managed types
+     */
+    Set<ManagedType<?>> getManagedTypes();
+
+    /**
+     * Return the metamodel entity types.
+     * @return the metamodel entity types
+     */
+    Set<EntityType<?>> getEntities();
+
+    /**
+     * Return the metamodel embeddable types.  Returns empty set
+     * if there are no embeddable types.
+     * @return the metamodel embeddable types
+     */
+    Set<EmbeddableType<?>> getEmbeddables();
+}
diff --git a/src/javax/persistence/metamodel/PluralAttribute.java b/src/javax/persistence/metamodel/PluralAttribute.java
new file mode 100644
index 0000000..b13587b
--- /dev/null
+++ b/src/javax/persistence/metamodel/PluralAttribute.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>PluralAttribute</code> represent 
+ * persistent collection-valued attributes.
+ *
+ * @param <X> The type the represented collection belongs to
+ * @param <C> The type of the represented collection
+ * @param <E> The element type of the represented collection
+ *
+ * @since Java Persistence 2.0
+ */
+public interface PluralAttribute<X, C, E> 
+		extends Attribute<X, C>, Bindable<E> {
+	
+	public static enum CollectionType {
+
+	    /** Collection-valued attribute */
+	    COLLECTION, 
+
+	    /** Set-valued attribute */
+	    SET, 
+
+	    /** List-valued attribute */
+	    LIST, 
+
+	    /** Map-valued attribute */
+	    MAP
+	}
+		
+    /**
+     * Return the collection type.
+     * @return collection type
+     */
+    CollectionType getCollectionType();
+
+    /**
+     * Return the type representing the element type of the 
+     * collection.
+     * @return element type
+     */
+    Type<E> getElementType();
+}
diff --git a/src/javax/persistence/metamodel/SetAttribute.java b/src/javax/persistence/metamodel/SetAttribute.java
new file mode 100644
index 0000000..0747cf3
--- /dev/null
+++ b/src/javax/persistence/metamodel/SetAttribute.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>SetAttribute</code> represent
+ * persistent <code>java.util.Set</code>-valued attributes.
+ *
+ * @param <X> The type the represented Set belongs to
+ * @param <E> The element type of the represented Set
+ *
+ * @since Java Persistence 2.0
+ */
+public interface SetAttribute<X, E> 
+	extends PluralAttribute<X, java.util.Set<E>, E> {} 
diff --git a/src/javax/persistence/metamodel/SingularAttribute.java b/src/javax/persistence/metamodel/SingularAttribute.java
new file mode 100644
index 0000000..fa2a333
--- /dev/null
+++ b/src/javax/persistence/metamodel/SingularAttribute.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>SingularAttribute</code> represents persistent 
+ * single-valued properties or fields.
+ *
+ * @param <X> The type containing the represented attribute
+ * @param <T> The type of the represented attribute
+ *
+ * @since Java Persistence 2.0
+ */
+public interface SingularAttribute<X, T> 
+		extends Attribute<X, T>, Bindable<T> {
+	
+    /**
+     *  Is the attribute an id attribute.  This method will return
+     *  true if the attribute is an attribute that corresponds to
+     *  a simple id, an embedded id, or an attribute of an id class.
+     *  @return boolean indicating whether the attribute is an id
+     */
+    boolean isId();
+
+    /**
+     *  Is the attribute a version attribute.
+     *  @return boolean indicating whether the attribute is 
+     *          a version attribute
+     */
+    boolean isVersion();
+
+    /** 
+     *  Can the attribute be null.
+     *  @return boolean indicating whether the attribute can
+     *          be null
+     */
+    boolean isOptional();
+
+    /**
+     * Return the type that represents the type of the attribute.
+     * @return type of attribute
+     */
+    Type<T> getType();
+}
diff --git a/src/javax/persistence/metamodel/StaticMetamodel.java b/src/javax/persistence/metamodel/StaticMetamodel.java
new file mode 100644
index 0000000..263c430
--- /dev/null
+++ b/src/javax/persistence/metamodel/StaticMetamodel.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * The <code>StaticMetamodel</code> annotation specifies that the class
+ * is a metamodel class that represents the entity, mapped 
+ * superclass, or embeddable class designated by the value
+ * element.
+ *
+ * @since Java Persistence 2.0
+ */
+ at Target(ElementType.TYPE)
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface StaticMetamodel {
+
+    /** 
+     * Class being modelled by the annotated class.
+     */
+    Class<?> value();
+}
diff --git a/src/javax/persistence/metamodel/Type.java b/src/javax/persistence/metamodel/Type.java
new file mode 100644
index 0000000..0f1607b
--- /dev/null
+++ b/src/javax/persistence/metamodel/Type.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.metamodel;
+
+/**
+ * Instances of the type <code>Type</code> represent persistent object 
+ * or attribute types.
+ *
+ * @param <X>  The type of the represented object or attribute
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Type<X> {
+
+       public static enum PersistenceType {
+
+	   /** Entity */
+           ENTITY, 
+
+	   /** Embeddable class */
+	   EMBEDDABLE, 
+
+	   /** Mapped superclass */
+	   MAPPED_SUPERCLASS, 
+
+	   /** Basic type */
+	   BASIC
+       }
+
+    /**
+     *  Return the persistence type.
+     *  @return persistence type
+     */	
+    PersistenceType getPersistenceType();
+
+    /**
+     *  Return the represented Java type.
+     *  @return Java type
+     */
+    Class<X> getJavaType();
+}
diff --git a/src/javax/persistence/metamodel/package-info.java b/src/javax/persistence/metamodel/package-info.java
new file mode 100644
index 0000000..7d1e9fe
--- /dev/null
+++ b/src/javax/persistence/metamodel/package-info.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+
+/**
+ * Java Persistence Metamodel API
+ */
+package javax.persistence.metamodel;
diff --git a/src/javax/persistence/orm_1_0.xsd b/src/javax/persistence/orm_1_0.xsd
new file mode 100644
index 0000000..90ac1ef
--- /dev/null
+++ b/src/javax/persistence/orm_1_0.xsd
@@ -0,0 +1,1541 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!-- 
+    Copyright (c) 2008, 2010 Oracle. All rights reserved. 
+    -->
+	<!--
+		This program and the accompanying materials are made available under the terms
+		of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+		which accompanies this distribution. The Eclipse Public License is available
+		at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution
+		License is available at http://www.eclipse.org/org/documents/edl-v10.php.
+	-->
+	<!--
+		Contributors: dclarke - Java Persistence 2.0 - Proposed Final Draft (March 13,
+		2009) Specification available from http://jcp.org/en/jsr/detail?id=317
+	-->
+	<!--
+		Java(TM) Persistence API, Version 2.0 - EARLY ACCESS This is an implementation
+		of an early-draft specification developed under the Java Community Process
+		(JCP). The code is untested and presumed not to be a compatible implementation
+		of JSR 317: Java(TM) Persistence API, Version 2.0. We encourage you to migrate
+		to an implementation of the Java(TM) Persistence API, Version 2.0
+		Specification that has been tested and verified to be compatible as soon as
+		such an implementation is available, and we encourage you to retain this
+		notice in any implementation of Java(TM) Persistence API, Version 2.0
+		Specification that you distribute.
+	-->
+	<!-- Java Persistence API object-relational mapping file schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm" 
+  xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="1.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)orm_1_0.xsd 1.0  Feb 14 2006
+    </xsd:documentation>
+  </xsd:annotation>
+  <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+       This is the XML Schema for the persistence object-relational 
+       mapping file.
+       The file may be named "META-INF/orm.xml" in the persistence 
+       archive or it may be named some other name which would be 
+       used to locate the file as resource on the classpath.
+
+     ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:complexType name="emptyType"/>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="entity-mappings">
+    <xsd:complexType>
+      <xsd:annotation>
+        <xsd:documentation>
+
+        The entity-mappings element is the root element of an mapping
+        file. It contains the following four types of elements:
+
+        1. The persistence-unit-metadata element contains metadata
+        for the entire persistence unit. It is undefined if this element
+        occurs in multiple mapping files within the same persistence unit.
+        
+        2. The package, schema, catalog and access elements apply to all of
+        the entity, mapped-superclass and embeddable elements defined in
+        the same file in which they occur.
+
+        3. The sequence-generator, table-generator, named-query,
+        named-native-query and sql-result-set-mapping elements are global
+        to the persistence unit. It is undefined to have more than one
+        sequence-generator or table-generator of the same name in the same
+        or different mapping files in a persistence unit. It is also 
+        undefined to have more than one named-query or named-native-query
+        of the same name in the same or different mapping files in a 
+        persistence unit.
+
+        4. The entity, mapped-superclass and embeddable elements each define
+        the mapping information for a managed persistent class. The mapping
+        information contained in these elements may be complete or it may
+        be partial.
+
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+        <xsd:element name="description" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="persistence-unit-metadata" 
+                     type="orm:persistence-unit-metadata"
+                     minOccurs="0"/>
+        <xsd:element name="package" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="table-generator" type="orm:table-generator" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-query" type="orm:named-query" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-native-query" type="orm:named-native-query"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="sql-result-set-mapping" 
+                     type="orm:sql-result-set-mapping" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="mapped-superclass" type="orm:mapped-superclass" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="entity" type="orm:entity" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embeddable" type="orm:embeddable" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="orm:versionType" 
+                     fixed="1.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-metadata">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Metadata that applies to the persistence unit and not just to 
+        the mapping file in which it is contained. 
+
+        If the xml-mapping-metadata-complete element is specified then 
+        the complete set of mapping metadata for the persistence unit 
+        is contained in the XML mapping files for the persistence unit.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="persistence-unit-defaults" 
+                   type="orm:persistence-unit-defaults"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-defaults">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        These defaults are applied to the persistence unit as a whole 
+        unless they are overridden by local annotation or XML 
+        element settings. 
+        
+        schema - Used as the schema for all tables or secondary tables
+            that apply to the persistence unit
+        catalog - Used as the catalog for all tables or secondary tables
+            that apply to the persistence unit
+        access - Used as the access type for all managed classes in
+            the persistence unit
+        cascade-persist - Adds cascade-persist to the set of cascade options
+            in entity relationships of the persistence unit
+        entity-listeners - List of default entity listeners to be invoked 
+            on each entity in the persistence unit. 
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="cascade-persist" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="entity-listeners" type="orm:entity-listeners"
+                     minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for an entity. Is allowed to be
+        sparsely populated and used in conjunction with the annotations.
+        Alternatively, the metadata-complete attribute can be used to 
+        indicate that no annotations on the entity class (and its fields
+        or properties) are to be processed. If this is the case then 
+        the defaulting rules for the entity and its subelements will 
+        be recursively applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+          public @interface Entity {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="table" type="orm:table" 
+                   minOccurs="0"/>
+      <xsd:element name="secondary-table" type="orm:secondary-table" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="primary-key-join-column" 
+                   type="orm:primary-key-join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
+      <xsd:element name="discriminator-value" type="orm:discriminator-value" 
+                   minOccurs="0"/>
+      <xsd:element name="discriminator-column" 
+                   type="orm:discriminator-column" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="named-query" type="orm:named-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="named-native-query" type="orm:named-native-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="sql-result-set-mapping" 
+                   type="orm:sql-result-set-mapping" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="attributes">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element contains the entity field or property mappings.
+        It may be sparsely populated to include only a subset of the
+        fields or properties. If metadata-complete for the entity is true
+        then the remainder of the attributes will be defaulted according
+        to the default rules.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="id" type="orm:id" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embedded-id" type="orm:embedded-id" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="basic" type="orm:basic"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="version" type="orm:version"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="access-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element determines how the persistence provider accesses the
+        state of an entity or embedded object.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="PROPERTY"/>
+      <xsd:enumeration value="FIELD"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listeners">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface EntityListeners {
+          Class[] value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="entity-listener" type="orm:entity-listener" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listener">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines an entity listener to be invoked at lifecycle events
+        for the entities that list this listener.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="pre-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PrePersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="post-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostPersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="pre-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="post-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="pre-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="post-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="post-load">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostLoad {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="query-hint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME) 
+        public @interface QueryHint {
+          String name();
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="named-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedQuery {
+          String name();
+          String query();
+          QueryHint[] hints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="named-native-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedNativeQuery {
+          String name();
+          String query();
+          QueryHint[] hints() default {};
+          Class resultClass() default void.class;
+          String resultSetMapping() default ""; //named SqlResultSetMapping
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="result-class" type="xsd:string"/>
+    <xsd:attribute name="result-set-mapping" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="sql-result-set-mapping">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SqlResultSetMapping {
+          String name();
+          EntityResult[] entities() default {};
+          ColumnResult[] columns() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="entity-result" type="orm:entity-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="column-result" type="orm:column-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface EntityResult {
+          Class entityClass();
+          FieldResult[] fields() default {};
+          String discriminatorColumn() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="field-result" type="orm:field-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
+    <xsd:attribute name="discriminator-column" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="field-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface FieldResult {
+          String name();
+          String column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="column" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="column-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface ColumnResult {
+          String name();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Table {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="secondary-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SecondaryTable {
+          String name();
+          String catalog() default "";
+          String schema() default "";
+          PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+         }
+
+       </xsd:documentation>
+     </xsd:annotation>
+     <xsd:sequence>
+       <xsd:element name="primary-key-join-column" 
+                    type="orm:primary-key-join-column" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+       <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="unique-constraint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface UniqueConstraint {
+          String[] columnNames();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column-name" type="xsd:string" 
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Column {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="generation-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="TABLE"/>
+      <xsd:enumeration value="SEQUENCE"/>
+      <xsd:enumeration value="IDENTITY"/>
+      <xsd:enumeration value="AUTO"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="attribute-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AttributeOverride {
+          String name();
+          Column column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="association-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AssociationOverride {
+          String name();
+          JoinColumn[] joinColumns();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="join-column" type="orm:join-column"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="id-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface IdClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Id {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" 
+                   minOccurs="0"/>
+      <xsd:element name="generated-value" type="orm:generated-value"
+                   minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embedded-id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface EmbeddedId {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="transient">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Transient {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="version">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Version {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="basic">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Basic {
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
+        <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+        <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="fetch-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum FetchType { LAZY, EAGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="LAZY"/>
+      <xsd:enumeration value="EAGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="lob">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Lob {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Temporal {
+          TemporalType value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:temporal-type"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum TemporalType {
+          DATE, // java.sql.Date
+          TIME, // java.sql.Time
+          TIMESTAMP // java.sql.Timestamp
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+      <xsd:restriction base="xsd:token">
+        <xsd:enumeration value="DATE"/>
+        <xsd:enumeration value="TIME"/>
+        <xsd:enumeration value="TIMESTAMP"/>
+     </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="enumerated">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Enumerated {
+          EnumType value() default ORDINAL;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:enum-type"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="enum-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum EnumType {
+          ORDINAL,
+          STRING
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ORDINAL"/>
+      <xsd:enumeration value="STRING"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="many-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>       
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>       
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="cascade-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="cascade-all" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-persist" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-merge" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-remove" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-refresh" type="orm:emptyType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="one-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="primary-key-join-column" 
+                     type="orm:primary-key-join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="one-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="order-by" type="orm:order-by" 
+                   minOccurs="0"/>
+      <xsd:element name="map-key" type="orm:map-key" 
+                   minOccurs="0"/>
+      <xsd:choice>       
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>       
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="join-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD})
+        public @interface JoinTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          JoinColumn[] inverseJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="inverse-join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="many-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="order-by" type="orm:order-by" 
+                   minOccurs="0"/>
+      <xsd:element name="map-key" type="orm:map-key" 
+                   minOccurs="0"/>
+      <xsd:element name="join-table" type="orm:join-table" 
+                   minOccurs="0"/>
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="generated-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface GeneratedValue {
+          GenerationType strategy() default AUTO;
+          String generator() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:generation-type"/>
+    <xsd:attribute name="generator" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="map-key">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKey {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="order-by">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderBy {
+          String value() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="inheritance">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Inheritance {
+          InheritanceType strategy() default SINGLE_TABLE;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:inheritance-type"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="inheritance-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum InheritanceType
+          { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="SINGLE_TABLE"/>
+      <xsd:enumeration value="JOINED"/>
+      <xsd:enumeration value="TABLE_PER_CLASS"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorValue {
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum DiscriminatorType { STRING, CHAR, INTEGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="STRING"/>
+      <xsd:enumeration value="CHAR"/>
+      <xsd:enumeration value="INTEGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="primary-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface PrimaryKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          String columnDefinition() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="discriminator-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorColumn {
+          String name() default "DTYPE";
+          DiscriminatorType discriminatorType() default STRING;
+          String columnDefinition() default "";
+          int length() default 31;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for embeddable objects. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        in the class. If this is the case then the defaulting rules will 
+        be recursively applied.
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Embeddable {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:embeddable-attributes" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable-attributes">
+    <xsd:sequence>
+      <xsd:element name="basic" type="orm:basic" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embedded">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Embedded {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="mapped-superclass">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for a mapped superclass. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        If this is the case then the defaulting rules will be recursively 
+        applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+        public @interface MappedSuperclass{}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="sequence-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface SequenceGenerator {
+          String name();
+          String sequenceName() default "";
+          int initialValue() default 1;
+          int allocationSize() default 50;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="sequence-name" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="table-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface TableGenerator {
+          String name();
+          String table() default "";
+          String catalog() default "";
+          String schema() default "";
+          String pkColumnName() default "";
+          String valueColumnName() default "";
+          String pkColumnValue() default "";
+          int initialValue() default 0;
+          int allocationSize() default 50;
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="pk-column-name" type="xsd:string"/>
+    <xsd:attribute name="value-column-name" type="xsd:string"/>
+    <xsd:attribute name="pk-column-value" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+</xsd:schema>
+
+
diff --git a/src/javax/persistence/orm_2_0.xsd b/src/javax/persistence/orm_2_0.xsd
new file mode 100644
index 0000000..f6dc8f8
--- /dev/null
+++ b/src/javax/persistence/orm_2_0.xsd
@@ -0,0 +1,1938 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Java Persistence API object/relational mapping file schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm" 
+  xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)orm_2_0.xsd 2.0  October 1 2009
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved. 
+  
+  This program and the accompanying materials are made available under the 
+  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+  which accompanies this distribution. 
+  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at 
+  http://www.eclipse.org/org/documents/edl-v10.php.
+  
+  Contributors:
+      Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009)
+      Specification available from http://jcp.org/en/jsr/detail?id=317
+  
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+       This is the XML Schema for the persistence object/relational 
+       mapping file.
+       The file may be named "META-INF/orm.xml" in the persistence 
+       archive or it may be named some other name which would be 
+       used to locate the file as resource on the classpath.
+
+       Object/relational mapping files must indicate the object/relational
+       mapping file schema by using the persistence namespace:
+
+       http://java.sun.com/xml/ns/persistence
+
+       and indicate the version of the schema by
+       using the version element as shown below:
+
+      <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
+          http://java.sun.com/xml/ns/persistence/orm/orm_2_0.xsd"
+        version="2.0">
+          ...
+      </entity-mappings>
+
+
+     ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:complexType name="emptyType"/>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="entity-mappings">
+    <xsd:complexType>
+      <xsd:annotation>
+        <xsd:documentation>
+
+        The entity-mappings element is the root element of a mapping
+        file. It contains the following four types of elements:
+
+        1. The persistence-unit-metadata element contains metadata
+        for the entire persistence unit. It is undefined if this element
+        occurs in multiple mapping files within the same persistence unit.
+        
+        2. The package, schema, catalog and access elements apply to all of
+        the entity, mapped-superclass and embeddable elements defined in
+        the same file in which they occur.
+
+        3. The sequence-generator, table-generator, named-query,
+        named-native-query and sql-result-set-mapping elements are global
+        to the persistence unit. It is undefined to have more than one
+        sequence-generator or table-generator of the same name in the same
+        or different mapping files in a persistence unit. It is also 
+        undefined to have more than one named-query, named-native-query, or
+        result-set-mapping of the same name in the same or different mapping 
+        files in a persistence unit.
+
+        4. The entity, mapped-superclass and embeddable elements each define
+        the mapping information for a managed persistent class. The mapping
+        information contained in these elements may be complete or it may
+        be partial.
+
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+        <xsd:element name="description" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="persistence-unit-metadata" 
+                     type="orm:persistence-unit-metadata"
+                     minOccurs="0"/>
+        <xsd:element name="package" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="table-generator" type="orm:table-generator" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-query" type="orm:named-query" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-native-query" type="orm:named-native-query"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="sql-result-set-mapping" 
+                     type="orm:sql-result-set-mapping" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="mapped-superclass" type="orm:mapped-superclass" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="entity" type="orm:entity" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embeddable" type="orm:embeddable" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="orm:versionType" 
+                     fixed="2.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-metadata">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Metadata that applies to the persistence unit and not just to 
+        the mapping file in which it is contained. 
+
+        If the xml-mapping-metadata-complete element is specified,
+        the complete set of mapping metadata for the persistence unit 
+        is contained in the XML mapping files for the persistence unit.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="persistence-unit-defaults" 
+                   type="orm:persistence-unit-defaults"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-defaults">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        These defaults are applied to the persistence unit as a whole 
+        unless they are overridden by local annotation or XML 
+        element settings. 
+        
+        schema - Used as the schema for all tables, secondary tables, join
+            tables, collection tables, sequence generators, and table 
+            generators that apply to the persistence unit
+        catalog - Used as the catalog for all tables, secondary tables, join
+            tables, collection tables, sequence generators, and table 
+            generators that apply to the persistence unit
+        delimited-identifiers - Used to treat database identifiers as
+            delimited identifiers.
+        access - Used as the access type for all managed classes in
+            the persistence unit
+        cascade-persist - Adds cascade-persist to the set of cascade options
+            in all entity relationships of the persistence unit
+        entity-listeners - List of default entity listeners to be invoked 
+            on each entity in the persistence unit. 
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+        <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="delimited-identifiers" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="cascade-persist" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="entity-listeners" type="orm:entity-listeners"
+                     minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for an entity. Is allowed to be
+        sparsely populated and used in conjunction with the annotations.
+        Alternatively, the metadata-complete attribute can be used to 
+        indicate that no annotations on the entity class (and its fields
+        or properties) are to be processed. If this is the case then 
+        the defaulting rules for the entity and its subelements will 
+        be recursively applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+          public @interface Entity {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="table" type="orm:table" 
+                   minOccurs="0"/>
+      <xsd:element name="secondary-table" type="orm:secondary-table" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="primary-key-join-column" 
+                   type="orm:primary-key-join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
+      <xsd:element name="discriminator-value" type="orm:discriminator-value" 
+                   minOccurs="0"/>
+      <xsd:element name="discriminator-column" 
+                   type="orm:discriminator-column" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="named-query" type="orm:named-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="named-native-query" type="orm:named-native-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="sql-result-set-mapping" 
+                   type="orm:sql-result-set-mapping" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="cacheable" type="xsd:boolean"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="access-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element determines how the persistence provider accesses the
+        state of an entity or embedded object.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="PROPERTY"/>
+      <xsd:enumeration value="FIELD"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="association-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AssociationOverride {
+          String name();
+          JoinColumn[] joinColumns() default{};
+          JoinTable joinTable() default @JoinTable;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="join-column" type="orm:join-column"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table"
+                     minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="attribute-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AttributeOverride {
+          String name();
+          Column column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="column" type="orm:column"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="attributes">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element contains the entity field or property mappings.
+        It may be sparsely populated to include only a subset of the
+        fields or properties. If metadata-complete for the entity is true
+        then the remainder of the attributes will be defaulted according
+        to the default rules.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="id" type="orm:id" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embedded-id" type="orm:embedded-id" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="basic" type="orm:basic"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="version" type="orm:version"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="element-collection" type="orm:element-collection" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="basic">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Basic {
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
+        <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+        <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cascade-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="cascade-all" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-persist" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-merge" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-remove" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-refresh" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-detach" type="orm:emptyType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="collection-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface CollectionTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Column {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="column-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface ColumnResult {
+          String name();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="discriminator-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorColumn {
+          String name() default "DTYPE";
+          DiscriminatorType discriminatorType() default STRING;
+          String columnDefinition() default "";
+          int length() default 31;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum DiscriminatorType { STRING, CHAR, INTEGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="STRING"/>
+      <xsd:enumeration value="CHAR"/>
+      <xsd:enumeration value="INTEGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorValue {
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="element-collection">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ElementCollection {
+          Class targetClass() default void.class;
+          FetchType fetch() default LAZY;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                     minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                     minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                       minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-attribute-override"
+                         type="orm:attribute-override"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column"
+                         type="orm:map-key-column"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-join-column"
+                         type="orm:map-key-join-column"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:sequence>
+          <xsd:element name="column" type="orm:column" minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="lob"
+                         type="orm:lob"
+                         minOccurs="0"/>
+          </xsd:choice>
+        </xsd:sequence>
+        <xsd:sequence>
+          <xsd:element name="attribute-override"
+                       type="orm:attribute-override"
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="association-override"
+                       type="orm:association-override"
+                       minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="collection-table" type="orm:collection-table"
+                     minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-class" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for embeddable objects. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        in the class. If this is the case then the defaulting rules will 
+        be recursively applied.
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Embeddable {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:embeddable-attributes" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable-attributes">
+    <xsd:sequence>
+      <xsd:element name="basic" type="orm:basic" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="element-collection" type="orm:element-collection" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embedded">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Embedded {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embedded-id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface EmbeddedId {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listener">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines an entity listener to be invoked at lifecycle events
+        for the entities that list this listener.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listeners">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface EntityListeners {
+          Class[] value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="entity-listener" type="orm:entity-listener" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface EntityResult {
+          Class entityClass();
+          FieldResult[] fields() default {};
+          String discriminatorColumn() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="field-result" type="orm:field-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
+    <xsd:attribute name="discriminator-column" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="enum-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum EnumType {
+          ORDINAL,
+          STRING
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ORDINAL"/>
+      <xsd:enumeration value="STRING"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="enumerated">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Enumerated {
+          EnumType value() default ORDINAL;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:enum-type"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="fetch-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum FetchType { LAZY, EAGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="LAZY"/>
+      <xsd:enumeration value="EAGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="field-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface FieldResult {
+          String name();
+          String column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="column" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="generated-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface GeneratedValue {
+          GenerationType strategy() default AUTO;
+          String generator() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:generation-type"/>
+    <xsd:attribute name="generator" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="generation-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="TABLE"/>
+      <xsd:enumeration value="SEQUENCE"/>
+      <xsd:enumeration value="IDENTITY"/>
+      <xsd:enumeration value="AUTO"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Id {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" 
+                   minOccurs="0"/>
+      <xsd:element name="generated-value" type="orm:generated-value"
+                   minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="id-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface IdClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="inheritance">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Inheritance {
+          InheritanceType strategy() default SINGLE_TABLE;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:inheritance-type"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="inheritance-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum InheritanceType
+          { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="SINGLE_TABLE"/>
+      <xsd:enumeration value="JOINED"/>
+      <xsd:enumeration value="TABLE_PER_CLASS"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="join-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          JoinColumn[] inverseJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="inverse-join-column" type="orm:join-column" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="lob">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Lob {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="lock-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="READ"/>
+      <xsd:enumeration value="WRITE"/>
+      <xsd:enumeration value="OPTIMISTIC"/>
+      <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
+      <xsd:enumeration value="PESSIMISTIC_READ"/>
+      <xsd:enumeration value="PESSIMISTIC_WRITE"/>
+      <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
+      <xsd:enumeration value="NONE"/>
+
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="many-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                   minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                   minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                   minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                   minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-attribute-override"
+                         type="orm:attribute-override"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column" type="orm:map-key-column"
+                   minOccurs="0"/>
+            <xsd:element name="map-key-join-column"
+                   type="orm:map-key-join-column"
+                   minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="join-table" type="orm:join-table"
+                   minOccurs="0"/>
+      <xsd:element name="cascade" type="orm:cascade-type"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="many-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>       
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>       
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="maps-id" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKey {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyColumn {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default false;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default false;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mapped-superclass">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for a mapped superclass. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        If this is the case then the defaulting rules will be recursively 
+        applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+        public @interface MappedSuperclass{}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-native-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedNativeQuery {
+          String name();
+          String query();
+          QueryHint[] hints() default {};
+          Class resultClass() default void.class;
+          String resultSetMapping() default ""; //named SqlResultSetMapping
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="result-class" type="xsd:string"/>
+    <xsd:attribute name="result-set-mapping" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedQuery {
+          String name();
+          String query();
+          LockModeType lockMode() default NONE;
+          QueryHint[] hints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="one-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                   minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                   minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                   minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                   minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-attribute-override"
+                         type="orm:attribute-override"
+                         minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column" type="orm:map-key-column"
+                   minOccurs="0"/>
+            <xsd:element name="map-key-join-column"
+                   type="orm:map-key-join-column"
+                   minOccurs="0" maxOccurs="unbounded"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="join-table" type="orm:join-table"
+                     minOccurs="0"/>
+        <xsd:element name="join-column" type="orm:join-column"
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+    <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="one-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+          String mappedBy() default "";
+          boolean orphanRemoval() default false;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="primary-key-join-column" 
+                     type="orm:primary-key-join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+    <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
+    <xsd:attribute name="maps-id" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:boolean"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="order-by">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderBy {
+          String value() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="order-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderColumn {
+          String name() default "";
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+         }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-load">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostLoad {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostPersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PrePersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="primary-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface PrimaryKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          String columnDefinition() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="query-hint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME) 
+        public @interface QueryHint {
+          String name();
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="secondary-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SecondaryTable {
+          String name();
+          String catalog() default "";
+          String schema() default "";
+          PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+         }
+
+       </xsd:documentation>
+     </xsd:annotation>
+     <xsd:sequence>
+       <xsd:element name="primary-key-join-column" 
+                    type="orm:primary-key-join-column" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+       <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="sequence-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface SequenceGenerator {
+          String name();
+          String sequenceName() default "";
+          String catalog() default "";
+          String schema() default "";
+          int initialValue() default 1;
+          int allocationSize() default 50;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="sequence-name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="sql-result-set-mapping">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SqlResultSetMapping {
+          String name();
+          EntityResult[] entities() default {};
+          ColumnResult[] columns() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="entity-result" type="orm:entity-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="column-result" type="orm:column-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Table {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="table-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface TableGenerator {
+          String name();
+          String table() default "";
+          String catalog() default "";
+          String schema() default "";
+          String pkColumnName() default "";
+          String valueColumnName() default "";
+          String pkColumnValue() default "";
+          int initialValue() default 0;
+          int allocationSize() default 50;
+          UniqueConstraint[] uniqueConstraints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="pk-column-name" type="xsd:string"/>
+    <xsd:attribute name="value-column-name" type="xsd:string"/>
+    <xsd:attribute name="pk-column-value" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Temporal {
+          TemporalType value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:temporal-type"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum TemporalType {
+          DATE, // java.sql.Date
+          TIME, // java.sql.Time
+          TIMESTAMP // java.sql.Timestamp
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+      <xsd:restriction base="xsd:token">
+        <xsd:enumeration value="DATE"/>
+        <xsd:enumeration value="TIME"/>
+        <xsd:enumeration value="TIMESTAMP"/>
+     </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transient">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Transient {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="unique-constraint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface UniqueConstraint {
+          String name() default "";
+          String[] columnNames();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column-name" type="xsd:string" 
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="version">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Version {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/src/javax/persistence/orm_2_1.xsd b/src/javax/persistence/orm_2_1.xsd
new file mode 100644
index 0000000..6aa6248
--- /dev/null
+++ b/src/javax/persistence/orm_2_1.xsd
@@ -0,0 +1,2336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Java Persistence API object/relational mapping file schema -->
+<xsd:schema targetNamespace="http://xmlns.jcp.org/xml/ns/persistence/orm" 
+  xmlns:orm="http://xmlns.jcp.org/xml/ns/persistence/orm" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="2.1">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)orm_2_1.xsd 2.1  February 15 2013
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008 - 2013 Oracle Corporation.  All rights reserved. 
+  
+  This program and the accompanying materials are made available under the 
+  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+  which accompanies this distribution. 
+  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at 
+  http://www.eclipse.org/org/documents/edl-v10.php.
+  
+  Contributors:
+      Linda DeMichiel - Java Persistence 2.1, Version 2.1 (February 15, 2013)
+      Specification available from http://jcp.org/en/jsr/detail?id=338
+  
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+       This is the XML Schema for the persistence object/relational 
+       mapping file.
+       The file may be named "META-INF/orm.xml" in the persistence 
+       archive or it may be named some other name which would be 
+       used to locate the file as resource on the classpath.
+
+       Object/relational mapping files must indicate the object/relational
+       mapping file schema by using the persistence namespace:
+
+       http://xmlns.jcp.org/xml/ns/persistence/orm
+
+       and indicate the version of the schema by
+       using the version element as shown below:
+
+      <entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm
+          http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd"
+        version="2.1">
+          ...
+      </entity-mappings>
+
+
+     ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:complexType name="emptyType"/>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="entity-mappings">
+    <xsd:complexType>
+      <xsd:annotation>
+        <xsd:documentation>
+
+        The entity-mappings element is the root element of a mapping
+        file. It contains the following four types of elements:
+
+        1. The persistence-unit-metadata element contains metadata
+        for the entire persistence unit. It is undefined if this element
+        occurs in multiple mapping files within the same persistence unit.
+        
+        2. The package, schema, catalog and access elements apply to all of
+        the entity, mapped-superclass and embeddable elements defined in
+        the same file in which they occur.
+
+        3. The sequence-generator, table-generator, converter, named-query,
+        named-native-query, named-stored-procedure-query, and 
+        sql-result-set-mapping elements are global to the persistence
+        unit. It is undefined to have more than one sequence-generator
+        or table-generator of the same name in the same or different
+        mapping files in a persistence unit. It is undefined to have
+        more than one named-query, named-native-query, sql-result-set-mapping,
+        or named-stored-procedure-query of the same name in the same 
+        or different mapping files in a persistence unit.  It is also
+        undefined to have more than one converter for the same target
+        type in the same or different mapping files in a persistence unit.
+
+        4. The entity, mapped-superclass and embeddable elements each define
+        the mapping information for a managed persistent class. The mapping
+        information contained in these elements may be complete or it may
+        be partial.
+
+        </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+        <xsd:element name="description" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="persistence-unit-metadata" 
+                     type="orm:persistence-unit-metadata"
+                     minOccurs="0"/>
+        <xsd:element name="package" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="table-generator" type="orm:table-generator" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-query" type="orm:named-query" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-native-query" type="orm:named-native-query"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="named-stored-procedure-query" 
+                     type="orm:named-stored-procedure-query"
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="sql-result-set-mapping" 
+                     type="orm:sql-result-set-mapping" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="mapped-superclass" type="orm:mapped-superclass" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="entity" type="orm:entity" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embeddable" type="orm:embeddable" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="converter" type="orm:converter" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="orm:versionType" 
+                     fixed="2.1" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-metadata">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Metadata that applies to the persistence unit and not just to 
+        the mapping file in which it is contained. 
+
+        If the xml-mapping-metadata-complete element is specified,
+        the complete set of mapping metadata for the persistence unit 
+        is contained in the XML mapping files for the persistence unit.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="xml-mapping-metadata-complete" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="persistence-unit-defaults" 
+                   type="orm:persistence-unit-defaults"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="persistence-unit-defaults">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        These defaults are applied to the persistence unit as a whole 
+        unless they are overridden by local annotation or XML 
+        element settings. 
+        
+        schema - Used as the schema for all tables, secondary tables, join
+            tables, collection tables, sequence generators, and table 
+            generators that apply to the persistence unit
+        catalog - Used as the catalog for all tables, secondary tables, join
+            tables, collection tables, sequence generators, and table 
+            generators that apply to the persistence unit
+        delimited-identifiers - Used to treat database identifiers as
+            delimited identifiers.
+        access - Used as the access type for all managed classes in
+            the persistence unit
+        cascade-persist - Adds cascade-persist to the set of cascade options
+            in all entity relationships of the persistence unit
+        entity-listeners - List of default entity listeners to be invoked 
+            on each entity in the persistence unit. 
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+        <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+        <xsd:element name="schema" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="catalog" type="xsd:string"
+                     minOccurs="0"/>
+        <xsd:element name="delimited-identifiers" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="access" type="orm:access-type"
+                     minOccurs="0"/>
+        <xsd:element name="cascade-persist" type="orm:emptyType" 
+                     minOccurs="0"/>
+        <xsd:element name="entity-listeners" type="orm:entity-listeners"
+                     minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="entity">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for an entity. Is allowed to be
+        sparsely populated and used in conjunction with the annotations.
+        Alternatively, the metadata-complete attribute can be used to 
+        indicate that no annotations on the entity class (and its fields
+        or properties) are to be processed. If this is the case then 
+        the defaulting rules for the entity and its subelements will 
+        be recursively applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+          public @interface Entity {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="table" type="orm:table" 
+                   minOccurs="0"/>
+      <xsd:element name="secondary-table" type="orm:secondary-table" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:sequence>
+        <xsd:element name="primary-key-join-column" 
+                     type="orm:primary-key-join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="primary-key-foreign-key" 
+                     type="orm:foreign-key" 
+                     minOccurs="0"/>
+      </xsd:sequence>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="inheritance" type="orm:inheritance" minOccurs="0"/>
+      <xsd:element name="discriminator-value" type="orm:discriminator-value" 
+                   minOccurs="0"/>
+      <xsd:element name="discriminator-column" 
+                   type="orm:discriminator-column" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="named-query" type="orm:named-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="named-native-query" type="orm:named-native-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="named-stored-procedure-query"
+                   type="orm:named-stored-procedure-query" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="sql-result-set-mapping" 
+                   type="orm:sql-result-set-mapping" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="convert" type="orm:convert"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="named-entity-graph" type="orm:named-entity-graph"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="cacheable" type="xsd:boolean"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="access-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element determines how the persistence provider accesses the
+        state of an entity or embedded object.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="PROPERTY"/>
+      <xsd:enumeration value="FIELD"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="association-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AssociationOverride {
+          String name();
+          JoinColumn[] joinColumns() default{};
+          JoinTable joinTable() default @JoinTable;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:sequence>
+          <xsd:element name="join-column" type="orm:join-column"
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="foreign-key" type="orm:foreign-key" 
+                       minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:element name="join-table" type="orm:join-table"
+                     minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="attribute-override">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface AttributeOverride {
+          String name();
+          Column column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="column" type="orm:column"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="attributes">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        This element contains the entity field or property mappings.
+        It may be sparsely populated to include only a subset of the
+        fields or properties. If metadata-complete for the entity is true
+        then the remainder of the attributes will be defaulted according
+        to the default rules.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="id" type="orm:id" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="embedded-id" type="orm:embedded-id" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="basic" type="orm:basic"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="version" type="orm:version"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="element-collection" type="orm:element-collection" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="basic">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Basic {
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:choice>
+        <xsd:element name="lob" type="orm:lob" minOccurs="0"/>
+        <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+        <xsd:element name="enumerated" type="orm:enumerated" minOccurs="0"/>
+        <xsd:element name="convert" type="orm:convert" minOccurs="0"/>
+      </xsd:choice>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="cascade-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum CascadeType { ALL, PERSIST, MERGE, REMOVE, REFRESH, DETACH};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="cascade-all" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-persist" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-merge" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-remove" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-refresh" type="orm:emptyType"
+                   minOccurs="0"/>
+      <xsd:element name="cascade-detach" type="orm:emptyType"
+                   minOccurs="0"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="collection-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface CollectionTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+          Index[] indexes() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:sequence>
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="foreign-key" type="orm:foreign-key" 
+                     minOccurs="0"/>
+      </xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="index" type="orm:index" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Column {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="column-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface ColumnResult {
+          String name();
+          Class type() default void.class;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="class" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="constraint-mode">
+    <xsd:annotation>
+      <xsd:documentation>
+
+       public enum ConstraintMode {CONSTRAINT, NO_CONSTRAINT, PROVIDER_DEFAULT};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="CONSTRAINT"/>
+      <xsd:enumeration value="NO_CONSTRAINT"/>
+      <xsd:enumeration value="PROVIDER_DEFAULT"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+
+  <xsd:complexType name="constructor-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface ConstructorResult {
+          Class targetClass();
+          ColumnResult[] columns();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column-result" 
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="target-class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="convert">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Convert {
+          Class converter() default void.class;
+          String attributeName() default "";
+          boolean disableConversion() default false;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="converter" type="xsd:string"/>
+    <xsd:attribute name="attribute-name" type="xsd:string"/>
+    <xsd:attribute name="disable-conversion" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="converter">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Converter {
+          boolean autoApply() default false;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="auto-apply" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="discriminator-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorColumn {
+          String name() default "DTYPE";
+          DiscriminatorType discriminatorType() default STRING;
+          String columnDefinition() default "";
+          int length() default 31;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="discriminator-type" type="orm:discriminator-type"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum DiscriminatorType { STRING, CHAR, INTEGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="STRING"/>
+      <xsd:enumeration value="CHAR"/>
+      <xsd:enumeration value="INTEGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="discriminator-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface DiscriminatorValue {
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+ <xsd:complexType name="element-collection">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ElementCollection {
+          Class targetClass() default void.class;
+          FetchType fetch() default LAZY;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                     minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                     minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                       minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:sequence>
+               <xsd:element name="map-key-attribute-override"
+                            type="orm:attribute-override"
+                            minOccurs="0" maxOccurs="unbounded"/>
+               <xsd:element name="map-key-convert" type="orm:convert"
+                            minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column"
+                         type="orm:map-key-column"
+                         minOccurs="0"/>
+            <xsd:sequence>
+              <xsd:element name="map-key-join-column"
+                           type="orm:map-key-join-column"
+                           minOccurs="0" maxOccurs="unbounded"/>
+              <xsd:element name="map-key-foreign-key" 
+                           type="orm:foreign-key" 
+                           minOccurs="0"/>
+            </xsd:sequence>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:sequence>
+          <xsd:element name="column" type="orm:column" minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:element name="lob"
+                         type="orm:lob"
+                         minOccurs="0"/>
+          </xsd:choice>
+        </xsd:sequence>
+        <xsd:sequence>
+          <xsd:element name="attribute-override"
+                       type="orm:attribute-override"
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="association-override"
+                       type="orm:association-override"
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="convert" type="orm:convert"
+                       minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="collection-table" type="orm:collection-table"
+                     minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-class" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for embeddable objects. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        in the class. If this is the case then the defaulting rules will 
+        be recursively applied.
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Embeddable {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:embeddable-attributes" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embeddable-attributes">
+    <xsd:sequence>
+      <xsd:element name="basic" type="orm:basic" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-one" type="orm:many-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-many" type="orm:one-to-many"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="one-to-one" type="orm:one-to-one"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="many-to-many" type="orm:many-to-many" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="element-collection" type="orm:element-collection" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="embedded" type="orm:embedded"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="transient" type="orm:transient" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:complexType name="embedded">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Embedded {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="association-override" 
+                   type="orm:association-override"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="convert" type="orm:convert"
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="embedded-id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface EmbeddedId {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="attribute-override" type="orm:attribute-override" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listener">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines an entity listener to be invoked at lifecycle events
+        for the entities that list this listener.
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-listeners">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface EntityListeners {
+          Class[] value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="entity-listener" type="orm:entity-listener" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="entity-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface EntityResult {
+          Class entityClass();
+          FieldResult[] fields() default {};
+          String discriminatorColumn() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="field-result" type="orm:field-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="entity-class" type="xsd:string" use="required"/>
+    <xsd:attribute name="discriminator-column" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="enum-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum EnumType {
+          ORDINAL,
+          STRING
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ORDINAL"/>
+      <xsd:enumeration value="STRING"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="enumerated">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Enumerated {
+          EnumType value() default ORDINAL;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:enum-type"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="fetch-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum FetchType { LAZY, EAGER };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="LAZY"/>
+      <xsd:enumeration value="EAGER"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="field-result">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface FieldResult {
+          String name();
+          String column();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="column" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="foreign-key">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface ForeignKey {
+          String name() default "";
+	  ConstraintMode value() default CONSTRAINT;
+          String foreign-key-definition() default "";
+
+        Note that the elements that embed the use of the annotation
+        default this use as @ForeignKey(PROVIDER_DEFAULT).
+
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="constraint-mode" type="orm:constraint-mode"/>
+    <xsd:attribute name="foreign-key-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="generated-value">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface GeneratedValue {
+          GenerationType strategy() default AUTO;
+          String generator() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:generation-type"/>
+    <xsd:attribute name="generator" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="generation-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="TABLE"/>
+      <xsd:enumeration value="SEQUENCE"/>
+      <xsd:enumeration value="IDENTITY"/>
+      <xsd:enumeration value="AUTO"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="id">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Id {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" 
+                   minOccurs="0"/>
+      <xsd:element name="generated-value" type="orm:generated-value"
+                   minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" 
+                   minOccurs="0"/>
+      <xsd:element name="table-generator" type="orm:table-generator" 
+                   minOccurs="0"/>
+      <xsd:element name="sequence-generator" type="orm:sequence-generator"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="id-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface IdClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="index">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface Index {
+          String name() default "";
+          String columnList();
+          boolean unique() default false;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="column-list" type="xsd:string" use="required"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="inheritance">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Inheritance {
+          InheritanceType strategy() default SINGLE_TABLE;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="strategy" type="orm:inheritance-type"/>
+  </xsd:complexType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="inheritance-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum InheritanceType
+          { SINGLE_TABLE, JOINED, TABLE_PER_CLASS};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="SINGLE_TABLE"/>
+      <xsd:enumeration value="JOINED"/>
+      <xsd:enumeration value="TABLE_PER_CLASS"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          ForeignKey foreignKey() default @ForeignKey();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="join-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface JoinTable {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          JoinColumn[] joinColumns() default {};
+          JoinColumn[] inverseJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+          Index[] indexes() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:sequence>
+        <xsd:element name="join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="foreign-key" type="orm:foreign-key" 
+                     minOccurs="0"/>
+      </xsd:sequence>
+      <xsd:sequence>
+        <xsd:element name="inverse-join-column" type="orm:join-column" 
+                     minOccurs="0" maxOccurs="unbounded"/>
+        <xsd:element name="inverse-foreign-key" type="orm:foreign-key" 
+                     minOccurs="0"/>
+      </xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="index" type="orm:index" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="lob">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Lob {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="lock-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum LockModeType { READ, WRITE, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, PESSIMISTIC_FORCE_INCREMENT, NONE};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="READ"/>
+      <xsd:enumeration value="WRITE"/>
+      <xsd:enumeration value="OPTIMISTIC"/>
+      <xsd:enumeration value="OPTIMISTIC_FORCE_INCREMENT"/>
+      <xsd:enumeration value="PESSIMISTIC_READ"/>
+      <xsd:enumeration value="PESSIMISTIC_WRITE"/>
+      <xsd:enumeration value="PESSIMISTIC_FORCE_INCREMENT"/>
+      <xsd:enumeration value="NONE"/>
+
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="many-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                   minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                   minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                   minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                   minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:sequence>
+               <xsd:element name="map-key-attribute-override"
+                            type="orm:attribute-override"
+                            minOccurs="0" maxOccurs="unbounded"/>
+               <xsd:element name="map-key-convert" type="orm:convert"
+                            minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column" type="orm:map-key-column"
+                   minOccurs="0"/>
+            <xsd:sequence>
+              <xsd:element name="map-key-join-column"
+                     type="orm:map-key-join-column"
+                     minOccurs="0" maxOccurs="unbounded"/>
+              <xsd:element name="map-key-foreign-key" 
+                           type="orm:foreign-key" 
+                           minOccurs="0"/>
+            </xsd:sequence>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="join-table" type="orm:join-table"
+                   minOccurs="0"/>
+      <xsd:element name="cascade" type="orm:cascade-type"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="many-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface ManyToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>       
+        <xsd:sequence>
+          <xsd:element name="join-column" type="orm:join-column" 
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="foreign-key" type="orm:foreign-key" 
+                       minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>       
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="maps-id" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKey {
+          String name() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-class">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyClass {
+          Class value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyColumn {
+          String name() default "";
+          boolean unique() default false;
+          boolean nullable() default false;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+          int length() default 255;
+          int precision() default 0; // decimal precision
+          int scale() default 0; // decimal scale
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="length" type="xsd:int"/>
+    <xsd:attribute name="precision" type="xsd:int"/>
+    <xsd:attribute name="scale" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="map-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface MapKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          boolean unique() default false;
+          boolean nullable() default false;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+          String table() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="unique" type="xsd:boolean"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="mapped-superclass">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        Defines the settings and mappings for a mapped superclass. Is 
+        allowed to be sparsely populated and used in conjunction with 
+        the annotations. Alternatively, the metadata-complete attribute 
+        can be used to indicate that no annotations are to be processed 
+        If this is the case then the defaulting rules will be recursively 
+        applied.
+
+        @Target(TYPE) @Retention(RUNTIME)
+        public @interface MappedSuperclass{}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="id-class" type="orm:id-class" minOccurs="0"/>
+      <xsd:element name="exclude-default-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="exclude-superclass-listeners" type="orm:emptyType" 
+                   minOccurs="0"/>
+      <xsd:element name="entity-listeners" type="orm:entity-listeners" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-persist" type="orm:pre-persist" minOccurs="0"/>
+      <xsd:element name="post-persist" type="orm:post-persist" 
+                   minOccurs="0"/>
+      <xsd:element name="pre-remove" type="orm:pre-remove" minOccurs="0"/>
+      <xsd:element name="post-remove" type="orm:post-remove" minOccurs="0"/>
+      <xsd:element name="pre-update" type="orm:pre-update" minOccurs="0"/>
+      <xsd:element name="post-update" type="orm:post-update" minOccurs="0"/>
+      <xsd:element name="post-load" type="orm:post-load" minOccurs="0"/>
+      <xsd:element name="attributes" type="orm:attributes" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="metadata-complete" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-attribute-node">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface NamedAttributeNode {
+          String value();
+          String subgraph() default "";
+          String keySubgraph() default "";
+        }
+ 
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="subgraph" type="xsd:string"/>
+    <xsd:attribute name="key-subgraph" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-entity-graph">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedEntityGraph {
+          String name() default "";
+          NamedAttributeNode[] attributeNodes() default {};
+          boolean includeAllAttributes() default false;
+          NamedSubgraph[] subgraphs() default {};
+          NamedSubGraph[] subclassSubgraphs() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="named-attribute-node" 
+                   type="orm:named-attribute-node" 
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="subgraph" 
+                   type="orm:named-subgraph" 
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+      <xsd:element name="subclass-subgraph" 
+                   type="orm:named-subgraph" 
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="include-all-attributes" type="xsd:boolean"/>
+  </xsd:complexType>
+
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-native-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedNativeQuery {
+          String name();
+          String query();
+          QueryHint[] hints() default {};
+          Class resultClass() default void.class;
+          String resultSetMapping() default ""; //named SqlResultSetMapping
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="result-class" type="xsd:string"/>
+    <xsd:attribute name="result-set-mapping" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedQuery {
+          String name();
+          String query();
+          LockModeType lockMode() default NONE;
+          QueryHint[] hints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="query" type="xsd:string"/>
+      <xsd:element name="lock-mode" type="orm:lock-mode-type" minOccurs="0"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-stored-procedure-query">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface NamedStoredProcedureQuery {
+          String name();
+          String procedureName();
+          StoredProcedureParameter[] parameters() default {};
+          Class[] resultClasses() default {};
+          String[] resultSetMappings() default{};
+          QueryHint[] hints() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="parameter" 
+                   type="orm:stored-procedure-parameter" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="result-class" type="xsd:string"  
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="result-set-mapping" type="xsd:string"
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="hint" type="orm:query-hint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="procedure-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="named-subgraph">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface NamedSubgraph {
+          String name();
+          Class type() default void.class;
+          NamedAttributeNode[] attributeNodes();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="named-attribute-node" 
+                   type="orm:named-attribute-node" 
+                   minOccurs="0"
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="class" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+<xsd:complexType name="one-to-many">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToMany {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default LAZY;
+          String mappedBy() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:element name="order-by" type="orm:order-by"
+                   minOccurs="0"/>
+        <xsd:element name="order-column" type="orm:order-column"
+                   minOccurs="0"/>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="map-key" type="orm:map-key"
+                   minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="map-key-class" type="orm:map-key-class"
+                   minOccurs="0"/>
+          <xsd:choice>
+            <xsd:element name="map-key-temporal"
+                         type="orm:temporal"
+                         minOccurs="0"/>
+            <xsd:element name="map-key-enumerated"
+                         type="orm:enumerated"
+                         minOccurs="0"/>
+            <xsd:sequence>
+               <xsd:element name="map-key-attribute-override"
+                            type="orm:attribute-override"
+                            minOccurs="0" maxOccurs="unbounded"/>
+               <xsd:element name="map-key-convert" type="orm:convert"
+                            minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:sequence>
+          </xsd:choice>
+          <xsd:choice>
+            <xsd:element name="map-key-column" type="orm:map-key-column"
+                   minOccurs="0"/>
+            <xsd:sequence>
+              <xsd:element name="map-key-join-column"
+                           type="orm:map-key-join-column"
+                           minOccurs="0" maxOccurs="unbounded"/>
+              <xsd:element name="map-key-foreign-key" 
+                           type="orm:foreign-key" 
+                           minOccurs="0"/>
+            </xsd:sequence>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:choice>
+        <xsd:element name="join-table" type="orm:join-table"
+                     minOccurs="0"/>
+        <xsd:sequence>
+          <xsd:element name="join-column" type="orm:join-column"
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="foreign-key" type="orm:foreign-key" 
+                       minOccurs="0"/>
+        </xsd:sequence>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type"
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+    <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="one-to-one">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OneToOne {
+          Class targetEntity() default void.class;
+          CascadeType[] cascade() default {};
+          FetchType fetch() default EAGER;
+          boolean optional() default true;
+          String mappedBy() default "";
+          boolean orphanRemoval() default false;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:choice>
+        <xsd:sequence>
+          <xsd:element name="primary-key-join-column" 
+                       type="orm:primary-key-join-column" 
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="primary-key-foreign-key" 
+                       type="orm:foreign-key" 
+                       minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:sequence>
+          <xsd:element name="join-column" type="orm:join-column" 
+                       minOccurs="0" maxOccurs="unbounded"/>
+          <xsd:element name="foreign-key" type="orm:foreign-key" 
+                       minOccurs="0"/>
+        </xsd:sequence>
+        <xsd:element name="join-table" type="orm:join-table" 
+                     minOccurs="0"/>
+      </xsd:choice>
+      <xsd:element name="cascade" type="orm:cascade-type" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="target-entity" type="xsd:string"/>
+    <xsd:attribute name="fetch" type="orm:fetch-type"/>
+    <xsd:attribute name="optional" type="xsd:boolean"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+    <xsd:attribute name="mapped-by" type="xsd:string"/>
+    <xsd:attribute name="orphan-removal" type="xsd:boolean"/>
+    <xsd:attribute name="maps-id" type="xsd:string"/>
+    <xsd:attribute name="id" type="xsd:boolean"/>
+</xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="order-by">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderBy {
+          String value() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:string"/>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="order-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface OrderColumn {
+          String name() default "";
+          boolean nullable() default true;
+          boolean insertable() default true;
+          boolean updatable() default true;
+          String columnDefinition() default "";
+         }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="nullable" type="xsd:boolean"/>
+    <xsd:attribute name="insertable" type="xsd:boolean"/>
+    <xsd:attribute name="updatable" type="xsd:boolean"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="parameter-mode">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum ParameterMode { IN, INOUT, OUT, REF_CURSOR};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="IN"/>
+      <xsd:enumeration value="INOUT"/>
+      <xsd:enumeration value="OUT"/>
+      <xsd:enumeration value="REF_CURSOR"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-load">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostLoad {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostPersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="post-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PostUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-persist">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PrePersist {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-remove">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreRemove {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="pre-update">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD}) @Retention(RUNTIME)
+        public @interface PreUpdate {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="method-name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="primary-key-join-column">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface PrimaryKeyJoinColumn {
+          String name() default "";
+          String referencedColumnName() default "";
+          String columnDefinition() default "";
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="referenced-column-name" type="xsd:string"/>
+    <xsd:attribute name="column-definition" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="query-hint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME) 
+        public @interface QueryHint {
+          String name();
+          String value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="value" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="secondary-table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SecondaryTable {
+          String name();
+          String catalog() default "";
+          String schema() default "";
+          PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+          UniqueConstraint[] uniqueConstraints() default {};
+          Index[] indexes() default {};
+         }
+
+       </xsd:documentation>
+     </xsd:annotation>
+     <xsd:sequence>
+       <xsd:sequence>
+         <xsd:element name="primary-key-join-column" 
+                      type="orm:primary-key-join-column" 
+                      minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="primary-key-foreign-key" 
+                      type="orm:foreign-key" 
+                      minOccurs="0"/>
+       </xsd:sequence>
+       <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+       <xsd:element name="index" type="orm:index" 
+                    minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="sequence-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface SequenceGenerator {
+          String name();
+          String sequenceName() default "";
+          String catalog() default "";
+          String schema() default "";
+          int initialValue() default 1;
+          int allocationSize() default 50;
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="sequence-name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="sql-result-set-mapping">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface SqlResultSetMapping {
+          String name();
+          EntityResult[] entities() default {};
+          ConstructorResult[] classes() default{};
+          ColumnResult[] columns() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="entity-result" type="orm:entity-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="constructor-result" type="orm:constructor-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="column-result" type="orm:column-result" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="stored-procedure-parameter">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface StoredProcedureParameter {
+          String name() default "";
+          ParameterMode mode() default ParameterMode.IN;
+          Class type();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" 
+                   minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="class" type="xsd:string" use="required"/>
+    <xsd:attribute name="mode" type="orm:parameter-mode"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="table">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE}) @Retention(RUNTIME)
+        public @interface Table {
+          String name() default "";
+          String catalog() default "";
+          String schema() default "";
+          UniqueConstraint[] uniqueConstraints() default {};
+          Index[] indexes() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="index" type="orm:index" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="table-generator">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface TableGenerator {
+          String name();
+          String table() default "";
+          String catalog() default "";
+          String schema() default "";
+          String pkColumnName() default "";
+          String valueColumnName() default "";
+          String pkColumnValue() default "";
+          int initialValue() default 0;
+          int allocationSize() default 50;
+          UniqueConstraint[] uniqueConstraints() default {};
+          Indexes[] indexes() default {};
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="description" type="xsd:string" minOccurs="0"/>
+      <xsd:element name="unique-constraint" type="orm:unique-constraint" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+      <xsd:element name="index" type="orm:index" 
+                   minOccurs="0" maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="table" type="xsd:string"/>
+    <xsd:attribute name="catalog" type="xsd:string"/>
+    <xsd:attribute name="schema" type="xsd:string"/>
+    <xsd:attribute name="pk-column-name" type="xsd:string"/>
+    <xsd:attribute name="value-column-name" type="xsd:string"/>
+    <xsd:attribute name="pk-column-value" type="xsd:string"/>
+    <xsd:attribute name="initial-value" type="xsd:int"/>
+    <xsd:attribute name="allocation-size" type="xsd:int"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Temporal {
+          TemporalType value();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="orm:temporal-type"/>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="temporal-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum TemporalType {
+          DATE, // java.sql.Date
+          TIME, // java.sql.Time
+          TIMESTAMP // java.sql.Timestamp
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+      <xsd:restriction base="xsd:token">
+        <xsd:enumeration value="DATE"/>
+        <xsd:enumeration value="TIME"/>
+        <xsd:enumeration value="TIMESTAMP"/>
+     </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="transient">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Transient {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="unique-constraint">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({}) @Retention(RUNTIME)
+        public @interface UniqueConstraint {
+          String name() default "";
+          String[] columnNames();
+        }
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column-name" type="xsd:string" 
+                   maxOccurs="unbounded"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string"/>
+  </xsd:complexType>
+
+<!-- **************************************************** -->
+
+  <xsd:complexType name="version">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        @Target({METHOD, FIELD}) @Retention(RUNTIME)
+        public @interface Version {}
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:sequence>
+      <xsd:element name="column" type="orm:column" minOccurs="0"/>
+      <xsd:element name="temporal" type="orm:temporal" minOccurs="0"/>
+    </xsd:sequence>
+    <xsd:attribute name="name" type="xsd:string" use="required"/>
+    <xsd:attribute name="access" type="orm:access-type"/>
+  </xsd:complexType>
+
+</xsd:schema>
diff --git a/src/javax/persistence/package-info.java b/src/javax/persistence/package-info.java
new file mode 100644
index 0000000..606f575
--- /dev/null
+++ b/src/javax/persistence/package-info.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+
+/**
+ * Java Persistence is the API for the management for persistence and object/relational mapping.
+ */
+package javax.persistence;
diff --git a/src/javax/persistence/persistence_1_0.xsd b/src/javax/persistence/persistence_1_0.xsd
new file mode 100644
index 0000000..74f7524
--- /dev/null
+++ b/src/javax/persistence/persistence_1_0.xsd
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!-- 
+    	Copyright (c) 2008, 2010 Oracle. All rights reserved. 
+    -->
+	<!--
+		This program and the accompanying materials are made available under the terms
+		of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+		which accompanies this distribution. The Eclipse Public License is available
+		at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution
+		License is available at http://www.eclipse.org/org/documents/edl-v10.php.
+	-->
+	<!--
+		Contributors: dclarke - Java Persistence 2.0 - Proposed Final Draft (March 13,
+		2009) Specification available from http://jcp.org/en/jsr/detail?id=317
+	-->
+	<!--
+		Java(TM) Persistence API, Version 2.0 - EARLY ACCESS This is an implementation
+		of an early-draft specification developed under the Java Community Process
+		(JCP). The code is untested and presumed not to be a compatible implementation
+		of JSR 317: Java(TM) Persistence API, Version 2.0. We encourage you to migrate
+		to an implementation of the Java(TM) Persistence API, Version 2.0
+		Specification that has been tested and verified to be compatible as soon as
+		such an implementation is available, and we encourage you to retain this
+		notice in any implementation of Java(TM) Persistence API, Version 2.0
+		Specification that you distribute.
+	-->
+	<!-- persistence.xml schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:persistence="http://java.sun.com/xml/ns/persistence"
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="1.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)persistence_1_0.xsd  1.0  Feb 9 2006
+    </xsd:documentation>
+  </xsd:annotation>
+   <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+     This is the XML Schema for the persistence configuration file.
+     The file must be named "META-INF/persistence.xml" in the 
+     persistence archive.
+     Persistence configuration files must indicate
+     the persistence schema by using the persistence namespace:
+
+     http://java.sun.com/xml/ns/persistence
+
+     and indicate the version of the schema by
+     using the version element as shown below:
+
+      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+          http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+        version="1.0">
+          ...
+      </persistence>
+
+    ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="persistence">
+    <xsd:complexType>
+      <xsd:sequence>
+
+        <!-- **************************************************** -->
+
+        <xsd:element name="persistence-unit" 
+                     minOccurs="0" maxOccurs="unbounded">
+          <xsd:complexType>
+            <xsd:annotation>
+              <xsd:documentation>
+
+                Configuration of a persistence unit.
+
+              </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+
+            <!-- **************************************************** -->
+
+              <xsd:element name="description" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Textual description of this persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="provider" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Provider class that supplies EntityManagers for this 
+                    persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of the JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="non-jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of a non-JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="mapping-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    File containing mapping information. Loaded as a resource 
+                    by the persistence provider.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jar-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Jar file that should be scanned for entities. 
+                    Not applicable to Java SE persistence units.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="class" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Class to scan for annotations.  It should be annotated 
+                    with either @Entity, @Embeddable or @MappedSuperclass.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="exclude-unlisted-classes" type="xsd:boolean" 
+                           default="false" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    When set to true then only listed classes and jars will 
+                    be scanned for persistent classes, otherwise the enclosing 
+                    jar or directory will also be scanned. Not applicable to 
+                    Java SE persistence units.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="properties" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    A list of vendor-specific properties.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="property" 
+                                 minOccurs="0" maxOccurs="unbounded">
+                      <xsd:annotation>
+                        <xsd:documentation>
+                          A name-value pair.
+                        </xsd:documentation>
+                      </xsd:annotation>
+                      <xsd:complexType>
+                        <xsd:attribute name="name" type="xsd:string" 
+                                       use="required"/>
+                        <xsd:attribute name="value" type="xsd:string" 
+                                       use="required"/>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                </xsd:complexType>
+              </xsd:element>
+
+            </xsd:sequence>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="name" type="xsd:string" use="required">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Name used in code to reference this persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="transaction-type" 
+                           type="persistence:persistence-unit-transaction-type">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Type of transactions used by EntityManagers from this 
+                  persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="persistence:versionType" 
+                     fixed="1.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-transaction-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum TransactionType { JTA, RESOURCE_LOCAL };
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="JTA"/>
+      <xsd:enumeration value="RESOURCE_LOCAL"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+</xsd:schema>
diff --git a/src/javax/persistence/persistence_2_0.xsd b/src/javax/persistence/persistence_2_0.xsd
new file mode 100644
index 0000000..d946203
--- /dev/null
+++ b/src/javax/persistence/persistence_2_0.xsd
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- persistence.xml schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:persistence="http://java.sun.com/xml/ns/persistence"
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="2.0">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)persistence_2_0.xsd  1.0  October 1 2009
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008, 2009 Sun Microsystems. All rights reserved. 
+  
+  This program and the accompanying materials are made available under the 
+  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+  which accompanies this distribution. 
+  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at 
+  http://www.eclipse.org/org/documents/edl-v10.php.
+  
+  Contributors:
+      Linda DeMichiel - Java Persistence 2.0, Version 2.0 (October 1, 2009)
+      Specification available from http://jcp.org/en/jsr/detail?id=317
+ 
+    </xsd:documentation>
+  </xsd:annotation>
+
+   <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+     This is the XML Schema for the persistence configuration file.
+     The file must be named "META-INF/persistence.xml" in the 
+     persistence archive.
+
+     Persistence configuration files must indicate
+     the persistence schema by using the persistence namespace:
+
+     http://java.sun.com/xml/ns/persistence
+
+     and indicate the version of the schema by
+     using the version element as shown below:
+
+      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+          http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+        version="2.0">
+          ...
+      </persistence>
+
+    ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="persistence">
+    <xsd:complexType>
+      <xsd:sequence>
+
+        <!-- **************************************************** -->
+
+        <xsd:element name="persistence-unit" 
+                     minOccurs="1" maxOccurs="unbounded">
+          <xsd:complexType>
+            <xsd:annotation>
+              <xsd:documentation>
+
+                Configuration of a persistence unit.
+
+              </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+
+            <!-- **************************************************** -->
+
+              <xsd:element name="description" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Description of this persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="provider" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Provider class that supplies EntityManagers for this 
+                    persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of the JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="non-jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of a non-JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="mapping-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    File containing mapping information. Loaded as a resource 
+                    by the persistence provider.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jar-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Jar file that is to be scanned for managed classes. 
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="class" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Managed class to be included in the persistence unit and
+                    to scan for annotations.  It should be annotated 
+                    with either @Entity, @Embeddable or @MappedSuperclass.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="exclude-unlisted-classes" type="xsd:boolean" 
+                           default="true" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    When set to true then only listed classes and jars will 
+                    be scanned for persistent classes, otherwise the 
+                    enclosing jar or directory will also be scanned. 
+                    Not applicable to Java SE persistence units.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="shared-cache-mode" 
+                           type="persistence:persistence-unit-caching-type" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Defines whether caching is enabled for the 
+                    persistence unit if caching is supported by the
+                    persistence provider. When set to ALL, all entities 
+                    will be cached. When set to NONE, no entities will
+                    be cached. When set to ENABLE_SELECTIVE, only entities
+                    specified as cacheable will be cached. When set to
+                    DISABLE_SELECTIVE, entities specified as not cacheable
+                    will not be cached. When not specified or when set to
+                    UNSPECIFIED, provider defaults may apply.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="validation-mode" 
+                           type="persistence:persistence-unit-validation-mode-type" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The validation mode to be used for the persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="properties" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    A list of standard and vendor-specific properties 
+                    and hints.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="property" 
+                                 minOccurs="0" maxOccurs="unbounded">
+                      <xsd:annotation>
+                        <xsd:documentation>
+                          A name-value pair.
+                        </xsd:documentation>
+                      </xsd:annotation>
+                      <xsd:complexType>
+                        <xsd:attribute name="name" type="xsd:string" 
+                                       use="required"/>
+                        <xsd:attribute name="value" type="xsd:string" 
+                                       use="required"/>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                </xsd:complexType>
+              </xsd:element>
+
+            </xsd:sequence>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="name" type="xsd:string" use="required">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Name used in code to reference this persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="transaction-type" 
+                           type="persistence:persistence-unit-transaction-type">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Type of transactions used by EntityManagers from this 
+                  persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="persistence:versionType" 
+                     fixed="2.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-transaction-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="JTA"/>
+      <xsd:enumeration value="RESOURCE_LOCAL"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-caching-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ALL"/>
+      <xsd:enumeration value="NONE"/>
+      <xsd:enumeration value="ENABLE_SELECTIVE"/>
+      <xsd:enumeration value="DISABLE_SELECTIVE"/>
+      <xsd:enumeration value="UNSPECIFIED"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-validation-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum ValidationMode { AUTO, CALLBACK, NONE};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="AUTO"/>
+      <xsd:enumeration value="CALLBACK"/>
+      <xsd:enumeration value="NONE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+</xsd:schema>
diff --git a/src/javax/persistence/persistence_2_1.xsd b/src/javax/persistence/persistence_2_1.xsd
new file mode 100644
index 0000000..01d5149
--- /dev/null
+++ b/src/javax/persistence/persistence_2_1.xsd
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- persistence.xml schema -->
+<xsd:schema targetNamespace="http://xmlns.jcp.org/xml/ns/persistence" 
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:persistence="http://xmlns.jcp.org/xml/ns/persistence"
+  elementFormDefault="qualified" 
+  attributeFormDefault="unqualified" 
+  version="2.1">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)persistence_2_1.xsd  2.1  February 4, 2013
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008  - 2013 Oracle Corporation. All rights reserved. 
+  
+  This program and the accompanying materials are made available under the 
+  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+  which accompanies this distribution. 
+  The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at 
+  http://www.eclipse.org/org/documents/edl-v10.php.
+  
+  Contributors:
+      Linda DeMichiel - Java Persistence 2.1, Version 2.1 (February 4, 2013)
+      Specification available from http://jcp.org/en/jsr/detail?id=338
+ 
+    </xsd:documentation>
+  </xsd:annotation>
+
+   <xsd:annotation>
+     <xsd:documentation><![CDATA[
+
+     This is the XML Schema for the persistence configuration file.
+     The file must be named "META-INF/persistence.xml" in the 
+     persistence archive.
+
+     Persistence configuration files must indicate
+     the persistence schema by using the persistence namespace:
+
+     http://xmlns.jcp.org/xml/ns/persistence
+
+     and indicate the version of the schema by
+     using the version element as shown below:
+
+      <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
+          http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
+        version="2.1">
+          ...
+      </persistence>
+
+    ]]></xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+  <!-- **************************************************** -->
+
+  <xsd:element name="persistence">
+    <xsd:complexType>
+      <xsd:sequence>
+
+        <!-- **************************************************** -->
+
+        <xsd:element name="persistence-unit" 
+                     minOccurs="1" maxOccurs="unbounded">
+          <xsd:complexType>
+            <xsd:annotation>
+              <xsd:documentation>
+
+                Configuration of a persistence unit.
+
+              </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+
+            <!-- **************************************************** -->
+
+              <xsd:element name="description" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Description of this persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="provider" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Provider class that supplies EntityManagers for this 
+                    persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of the JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="non-jta-data-source" type="xsd:string" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The container-specific name of a non-JTA datasource to use.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="mapping-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    File containing mapping information. Loaded as a resource 
+                    by the persistence provider.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="jar-file" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Jar file that is to be scanned for managed classes. 
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="class" type="xsd:string" 
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Managed class to be included in the persistence unit and
+                    to scan for annotations.  It should be annotated 
+                    with either @Entity, @Embeddable or @MappedSuperclass.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="exclude-unlisted-classes" type="xsd:boolean" 
+                           default="true" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    When set to true then only listed classes and jars will 
+                    be scanned for persistent classes, otherwise the 
+                    enclosing jar or directory will also be scanned. 
+                    Not applicable to Java SE persistence units.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="shared-cache-mode" 
+                           type="persistence:persistence-unit-caching-type" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    Defines whether caching is enabled for the 
+                    persistence unit if caching is supported by the
+                    persistence provider. When set to ALL, all entities 
+                    will be cached. When set to NONE, no entities will
+                    be cached. When set to ENABLE_SELECTIVE, only entities
+                    specified as cacheable will be cached. When set to
+                    DISABLE_SELECTIVE, entities specified as not cacheable
+                    will not be cached. When not specified or when set to
+                    UNSPECIFIED, provider defaults may apply.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="validation-mode" 
+                           type="persistence:persistence-unit-validation-mode-type" 
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    The validation mode to be used for the persistence unit.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+
+
+              <!-- **************************************************** -->
+
+              <xsd:element name="properties" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+
+                    A list of standard and vendor-specific properties 
+                    and hints.
+
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="property" 
+                                 minOccurs="0" maxOccurs="unbounded">
+                      <xsd:annotation>
+                        <xsd:documentation>
+                          A name-value pair.
+                        </xsd:documentation>
+                      </xsd:annotation>
+                      <xsd:complexType>
+                        <xsd:attribute name="name" type="xsd:string" 
+                                       use="required"/>
+                        <xsd:attribute name="value" type="xsd:string" 
+                                       use="required"/>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                </xsd:complexType>
+              </xsd:element>
+
+            </xsd:sequence>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="name" type="xsd:string" use="required">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Name used in code to reference this persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+            <!-- **************************************************** -->
+
+            <xsd:attribute name="transaction-type" 
+                           type="persistence:persistence-unit-transaction-type">
+              <xsd:annotation>
+                <xsd:documentation>
+
+                  Type of transactions used by EntityManagers from this 
+                  persistence unit.
+
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="persistence:versionType" 
+                     fixed="2.1" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+
+  <!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-transaction-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="JTA"/>
+      <xsd:enumeration value="RESOURCE_LOCAL"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-caching-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ALL"/>
+      <xsd:enumeration value="NONE"/>
+      <xsd:enumeration value="ENABLE_SELECTIVE"/>
+      <xsd:enumeration value="DISABLE_SELECTIVE"/>
+      <xsd:enumeration value="UNSPECIFIED"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+<!-- **************************************************** -->
+
+  <xsd:simpleType name="persistence-unit-validation-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+
+        public enum ValidationMode { AUTO, CALLBACK, NONE};
+
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="AUTO"/>
+      <xsd:enumeration value="CALLBACK"/>
+      <xsd:enumeration value="NONE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+
+</xsd:schema>
diff --git a/src/javax/persistence/spi/ClassTransformer.java b/src/javax/persistence/spi/ClassTransformer.java
new file mode 100644
index 0000000..4faf81e
--- /dev/null
+++ b/src/javax/persistence/spi/ClassTransformer.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+import java.security.ProtectionDomain;
+import java.lang.instrument.IllegalClassFormatException;
+
+/**
+ * A persistence provider supplies an instance of this 
+ * interface to the {@link PersistenceUnitInfo#addTransformer 
+ * PersistenceUnitInfo.addTransformer}
+ * method. The supplied transformer instance will get 
+ * called to transform entity class files when they are 
+ * loaded or redefined. The transformation occurs before  
+ * the class is defined by the JVM.
+ *
+ * @since Java Persistence 1.0
+ */
+public interface ClassTransformer {
+
+    /**
+     * Invoked when a class is being loaded or redefined.
+     * The implementation of this method may transform the 
+     * supplied class file and return a new replacement class 
+     * file.
+     *
+     * @param loader  the defining loader of the class to be 
+     *        transformed, may be null if the bootstrap loader
+     * @param className  the name of the class in the internal form 
+     *        of fully qualified class and interface names 
+     * @param classBeingRedefined  if this is a redefine, the 
+     *        class being redefined, otherwise null
+     * @param protectionDomain  the protection domain of the 
+     *        class being defined or redefined
+     * @param classfileBuffer  the input byte buffer in class 
+     *        file format - must not be modified 
+     * @return a well-formed class file buffer (the result of 
+     *         the transform), or null if no transform is performed
+     * @throws IllegalClassFormatException  if the input does 
+     *         not represent a well-formed class file
+     */
+    byte[] transform(ClassLoader loader,
+                     String className,
+                     Class<?> classBeingRedefined,
+                     ProtectionDomain protectionDomain, 
+                     byte[] classfileBuffer) 
+        throws IllegalClassFormatException;
+}
diff --git a/src/javax/persistence/spi/LoadState.java b/src/javax/persistence/spi/LoadState.java
new file mode 100644
index 0000000..6fa7b07
--- /dev/null
+++ b/src/javax/persistence/spi/LoadState.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+/**
+ * Load states returned by the {@link ProviderUtil} SPI methods.
+ * @since Java Persistence 2.0
+ *
+ */
+public enum LoadState {
+    /** The state of the element is known to have been loaded. */
+    LOADED,
+    /** The state of the element is known not to have been loaded. */
+    NOT_LOADED,
+    /** The load state of the element cannot be determined. */
+    UNKNOWN
+}
diff --git a/src/javax/persistence/spi/PersistenceProvider.java b/src/javax/persistence/spi/PersistenceProvider.java
new file mode 100644
index 0000000..fe761b4
--- /dev/null
+++ b/src/javax/persistence/spi/PersistenceProvider.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+import javax.persistence.EntityManagerFactory;
+import java.util.Map;
+
+/**
+ * Interface implemented by the persistence provider.
+ *
+ * <p> It is invoked by the container in Java EE environments and
+ * by the {@link javax.persistence.Persistence} class in Java SE environments to
+ * create an {@link javax.persistence.EntityManagerFactory} and/or to cause
+ * schema generation to occur.
+ *
+ * @since Java Persistence 1.0
+ */
+public interface PersistenceProvider {
+
+    /**
+     * Called by <code>Persistence</code> class when an
+     * <code>EntityManagerFactory</code> 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 <code>persistence.xml</code> file or specify values for 
+     * properties not specified in the <code>persistence.xml</code>
+     * (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 <code>EntityManagerFactory</code>
+     * 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).  These properties may include properties to
+     * control schema generation.
+     * If a Bean Validation provider is present in the classpath,
+     * the container must pass the <code>ValidatorFactory</code> instance in
+     * the map with the key <code>"javax.persistence.validation.factory"</code>.
+     * If the containing archive is a bean archive, the container
+     * must pass the BeanManager instance in the map with the key
+     * <code>"javax.persistence.bean.manager"</code>.
+     * @return EntityManagerFactory for the persistence unit 
+     * specified by the metadata
+     */
+    public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map);
+
+
+    /**
+     * Create database schemas and/or tables and/or create DDL
+     * scripts as determined by the supplied properties.
+     * <p>
+     * Called by the container when schema generation is to
+     * occur as a separate phase from creation of the entity
+     * manager factory.
+     * <p>
+     * @param info metadata for use by the persistence provider
+     * @param map properties for schema generation;  these may
+     *             also include provider-specific properties
+     * @throws PersistenceException if insufficient or inconsistent
+     *         configuration information is provided of if schema
+     *         generation otherwise fails
+     *
+     * @since Java Persistence 2.1
+     */
+    public void generateSchema(PersistenceUnitInfo info, Map map);
+
+    /**
+     * Create database schemas and/or tables and/or create DDL
+     * scripts as determined by the supplied properties.
+     * <p>
+     * Called by the Persistence class when schema generation is to
+     * occur as a separate phase from creation of the entity
+     * manager factory.
+     * <p>
+     * @param persistenceUnitName the name of the persistence unit
+     * @param map properties for schema generation;  these may
+     *             also contain provider-specific properties.  The
+     *             value of these properties override any values that
+     *             may have been configured elsewhere.
+     * @return true  if schema was generated, otherwise false
+     * @throws PersistenceException if insufficient or inconsistent
+     *         configuration information is provided or if schema
+     *         generation otherwise fails
+     *
+     * @since Java Persistence 2.1
+     */
+    public boolean generateSchema(String persistenceUnitName, Map map); 
+
+    /**
+     * Return the utility interface implemented by the persistence
+     * provider.
+     * @return ProviderUtil interface
+     *
+     * @since Java Persistence 2.0
+     */
+    public ProviderUtil getProviderUtil();
+}
+
diff --git a/src/javax/persistence/spi/PersistenceProviderResolver.java b/src/javax/persistence/spi/PersistenceProviderResolver.java
new file mode 100644
index 0000000..9df7270
--- /dev/null
+++ b/src/javax/persistence/spi/PersistenceProviderResolver.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+import java.util.List;
+
+/**
+ * Determine the list of persistence providers available in the 
+ * runtime environment.
+ * 
+ * <p> Implementations must be thread-safe.
+ *
+ * <p> Note that the <code>getPersistenceProviders</code> method can potentially
+ * be called many times: it is recommended that the implementation
+ * of this method make use of caching.
+ *
+ * @see PersistenceProvider
+ * @since Java Persistence 2.0
+ */
+public interface PersistenceProviderResolver {
+
+    /**
+     * Returns a list of the <code>PersistenceProvider</code> implementations 
+     * available in the runtime environment.
+     *
+     * @return list of the persistence providers available 
+     *         in the environment
+     */
+    List<PersistenceProvider> getPersistenceProviders();
+
+    /**
+     * Clear cache of providers.
+     *
+     */
+    void clearCachedProviders();
+} 
diff --git a/src/javax/persistence/spi/PersistenceProviderResolverHolder.java b/src/javax/persistence/spi/PersistenceProviderResolverHolder.java
new file mode 100644
index 0000000..0c9da9e
--- /dev/null
+++ b/src/javax/persistence/spi/PersistenceProviderResolverHolder.java
@@ -0,0 +1,409 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.persistence.PersistenceException;
+
+/**
+ * Holds the global {@link javax.persistence.spi.PersistenceProviderResolver}
+ * instance. If no <code>PersistenceProviderResolver</code> is set by the
+ * environment, the default </code>PersistenceProviderResolver is used.
+ * 
+ * Implementations must be thread-safe.
+ * 
+ * @since Java Persistence 2.0
+ */
+public class PersistenceProviderResolverHolder {
+
+    private static PersistenceProviderResolver singleton = new DefaultPersistenceProviderResolver();
+
+    /**
+     * Returns the current persistence provider resolver.
+     * 
+     * @return the current persistence provider resolver
+     */
+    public static PersistenceProviderResolver getPersistenceProviderResolver() {
+        return singleton;
+    }
+
+    /**
+     * Defines the persistence provider resolver used.
+     * 
+     * @param resolver persistence provider resolver to be used.
+     */
+    public static void setPersistenceProviderResolver(PersistenceProviderResolver resolver) {
+        if (resolver == null) {
+            singleton = new DefaultPersistenceProviderResolver();
+        } else {
+            singleton = resolver;
+        }
+    }
+
+    /**
+     * Default provider resolver class to use when none is explicitly set.
+     * 
+     * Uses the META-INF/services approach as described in the Java Persistence
+     * specification. A getResources() call is made on the current context
+     * classloader to find the service provider files on the classpath. Any
+     * service files found are then read to obtain the classes that implement
+     * the persistence provider interface.
+     */
+    private static class DefaultPersistenceProviderResolver implements PersistenceProviderResolver {
+
+        /**
+         * Cached list of available providers cached by CacheKey to ensure
+         * there is not potential for provider visibility issues. 
+         */
+        private volatile HashMap<CacheKey, PersistenceProviderReference> providers = new HashMap<CacheKey, PersistenceProviderReference>();
+        
+        /**
+         * Queue for reference objects referring to class loaders or persistence providers.
+         */
+        private static final ReferenceQueue referenceQueue = new ReferenceQueue();
+
+        public List<PersistenceProvider> getPersistenceProviders() {
+            // Before we do the real loading work, see whether we need to
+            // do some cleanup: If references to class loaders or
+            // persistence providers have been nulled out, remove all related
+            // information from the cache.
+            processQueue();
+            
+            ClassLoader loader = getContextClassLoader();
+            CacheKey cacheKey = new CacheKey(loader);
+            PersistenceProviderReference providersReferent = this.providers.get(cacheKey);
+            List<PersistenceProvider> loadedProviders = null;
+            
+            if (providersReferent != null) {
+                loadedProviders = providersReferent.get();
+            }
+
+            if (loadedProviders == null) {
+                Collection<ProviderName> providerNames = getProviderNames(loader);
+                loadedProviders = new ArrayList<PersistenceProvider>();
+
+                for (ProviderName providerName : providerNames) {
+                    try {
+                        PersistenceProvider provider = (PersistenceProvider) loader.loadClass(providerName.getName()).newInstance();
+                        loadedProviders.add(provider);
+                    } catch (ClassNotFoundException cnfe) {
+                        log(Level.FINEST, cnfe + ": " + providerName);
+                    } catch (InstantiationException ie) {
+                        log(Level.FINEST, ie + ": " + providerName);
+                    } catch (IllegalAccessException iae) {
+                        log(Level.FINEST, iae + ": " + providerName);
+                    } catch (ClassCastException cce) {
+                        log(Level.FINEST, cce + ": " + providerName);
+                    }
+                }
+
+                // If none are found we'll log the provider names for diagnostic
+                // purposes.
+                if (loadedProviders.isEmpty() && !providerNames.isEmpty()) {
+                    log(Level.WARNING, "No valid providers found using:");
+                    for (ProviderName name : providerNames) {
+                        log(Level.WARNING, name.toString());
+                    }
+                }
+                
+                providersReferent = new PersistenceProviderReference(loadedProviders, referenceQueue, cacheKey);
+
+                this.providers.put(cacheKey, providersReferent);
+            }
+
+            return loadedProviders;
+        }
+        
+        /**
+         * Remove garbage collected cache keys & providers.
+         */
+        private void processQueue() {
+            CacheKeyReference ref;
+            while ((ref = (CacheKeyReference) referenceQueue.poll()) != null) {
+                providers.remove(ref.getCacheKey());
+            }            
+        }
+
+        /**
+         * Wraps <code>Thread.currentThread().getContextClassLoader()</code> into a doPrivileged block if security manager is present
+         */
+        private static ClassLoader getContextClassLoader() {
+            if (System.getSecurityManager() == null) {
+                return Thread.currentThread().getContextClassLoader();
+            }
+            else {
+                return  (ClassLoader) java.security.AccessController.doPrivileged(
+                        new java.security.PrivilegedAction() {
+                            public java.lang.Object run() {
+                                return Thread.currentThread().getContextClassLoader();
+                            }
+                        }
+                );
+            }
+        }
+
+
+        private static final String LOGGER_SUBSYSTEM = "javax.persistence.spi";
+
+        private Logger logger;
+
+        private void log(Level level, String message) {
+            if (this.logger == null) {
+                this.logger = Logger.getLogger(LOGGER_SUBSYSTEM);
+            }
+            this.logger.log(level, LOGGER_SUBSYSTEM + "::" + message);
+        }
+
+        private static final String SERVICE_PROVIDER_FILE = "META-INF/services/javax.persistence.spi.PersistenceProvider";
+
+        /**
+         * Locate all JPA provider services files and collect all of the
+         * provider names available.
+         */
+        private Collection<ProviderName> getProviderNames(ClassLoader loader) {
+            Enumeration<URL> resources = null;
+
+            try {
+                resources = loader.getResources(SERVICE_PROVIDER_FILE);
+            } catch (IOException ioe) {
+                throw new PersistenceException("IOException caught: " + loader + ".getResources(" + SERVICE_PROVIDER_FILE + ")", ioe);
+            }
+
+            Collection<ProviderName> providerNames = new ArrayList<ProviderName>();
+
+            while (resources.hasMoreElements()) {
+                URL url = resources.nextElement();
+                addProviderNames(url, providerNames);
+            }
+
+            return providerNames;
+        }
+
+        private static final Pattern nonCommentPattern = Pattern.compile("^([^#]+)");
+
+        /**
+         * For each services file look for uncommented provider names on each
+         * line.
+         */
+        private void addProviderNames(URL url, Collection<ProviderName> providerNames) {
+            InputStream in = null;
+            try {
+                in = url.openStream();
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+
+                String line;
+                while ((line = reader.readLine()) != null) {
+                    line = line.trim();
+                    Matcher m = nonCommentPattern.matcher(line);
+                    if (m.find()) {
+                        providerNames.add(new ProviderName(m.group().trim(), url));
+                    }
+                }
+            } catch (IOException ioe) {
+                throw new PersistenceException("IOException caught reading: " + url, ioe);
+            } finally {
+                if (in != null) {
+                    try {
+                        in.close();
+                    } catch (IOException e) {
+                    }
+                }
+            }
+        }
+
+        /**
+         * Clear all cached providers
+         */
+        public void clearCachedProviders() {
+            this.providers.clear();
+        }
+
+        /**
+         * A ProviderName captures each provider name found in a service file as
+         * well as the URL for the service file it was found in. This
+         * information is only used for diagnostic purposes.
+         */
+        private class ProviderName {
+
+            /** Provider name **/
+            private String name;
+
+            /** URL for the service file where the provider name was found **/
+            private URL source;
+
+            public ProviderName(String name, URL sourceURL) {
+                this.name = name;
+                this.source = sourceURL;
+            }
+
+            public String getName() {
+                return name;
+            }
+
+            public URL getSource() {
+                return source;
+            }
+
+            public String toString() {
+                return getName() + " - " + getSource();
+            }
+        }
+        
+        /**
+         * The common interface to get a CacheKey implemented by
+         * LoaderReference and PersistenceProviderReference.
+         */
+        private interface CacheKeyReference {
+            public CacheKey getCacheKey();
+        }        
+        
+        /**
+          * Key used for cached persistence providers. The key checks
+          * the class loader to determine if the persistence providers
+          * is a match to the requested one. The loader may be null.
+          */
+        private class CacheKey implements Cloneable {
+            
+            /* Weak Reference to ClassLoader */
+            private LoaderReference loaderRef;
+            
+            /* Cached Hashcode */
+            private int hashCodeCache;
+
+            CacheKey(ClassLoader loader) {
+                if (loader == null) {
+                    this.loaderRef = null;
+                } else {
+                    loaderRef = new LoaderReference(loader, referenceQueue, this);
+                }
+                calculateHashCode();
+            }
+
+            ClassLoader getLoader() {
+                return (loaderRef != null) ? loaderRef.get() : null;
+            }
+
+            public boolean equals(Object other) {
+                if (this == other) {
+                    return true;
+                }
+                try {
+                    final CacheKey otherEntry = (CacheKey) other;
+                    // quick check to see if they are not equal
+                    if (hashCodeCache != otherEntry.hashCodeCache) {
+                        return false;
+                    }
+                    // are refs (both non-null) or (both null)?
+                    if (loaderRef == null) {
+                        return otherEntry.loaderRef == null;
+                    }
+                    ClassLoader loader = loaderRef.get();
+                    return (otherEntry.loaderRef != null)
+                    // with a null reference we can no longer find
+                    // out which class loader was referenced; so
+                    // treat it as unequal
+                    && (loader != null) && (loader == otherEntry.loaderRef.get());
+                } catch (NullPointerException e) {
+                } catch (ClassCastException e) {
+                }
+
+                return false;
+            }
+
+            public int hashCode() {
+                return hashCodeCache;
+            }
+
+            private void calculateHashCode() {
+                ClassLoader loader = getLoader();
+                if (loader != null) {
+                    hashCodeCache = loader.hashCode();
+                }
+            }
+
+            public Object clone() {
+                try {
+                    CacheKey clone = (CacheKey) super.clone();
+                    if (loaderRef != null) {
+                        clone.loaderRef = new LoaderReference(loaderRef.get(), referenceQueue, clone);
+                    }
+                    return clone;
+                } catch (CloneNotSupportedException e) {
+                    // this should never happen
+                    throw new InternalError();
+                }
+            }
+
+            public String toString() {
+                return "CacheKey[" + getLoader() + ")]";
+            }
+        }
+       
+       /**
+         * References to class loaders are weak references, so that they can be
+         * garbage collected when nobody else is using them. The DefaultPersistenceProviderResolver 
+         * class has no reason to keep class loaders alive.
+         */
+        private class LoaderReference extends WeakReference<ClassLoader> 
+                implements CacheKeyReference {
+            private CacheKey cacheKey;
+
+            LoaderReference(ClassLoader referent, ReferenceQueue q, CacheKey key) {
+                super(referent, q);
+                cacheKey = key;
+            }
+
+            public CacheKey getCacheKey() {
+                return cacheKey;
+            }
+        }
+
+        /**
+         * References to persistence provider are soft references so that they can be garbage
+         * collected when they have no hard references.
+         */
+        private class PersistenceProviderReference extends SoftReference<List<PersistenceProvider>>
+                implements CacheKeyReference {
+            private CacheKey cacheKey;
+
+            PersistenceProviderReference(List<PersistenceProvider> referent, ReferenceQueue q, CacheKey key) {
+                super(referent, q);
+                cacheKey = key;
+            }
+
+            public CacheKey getCacheKey() {
+                return cacheKey;
+            }
+        }
+    }
+}
diff --git a/src/javax/persistence/spi/PersistenceUnitInfo.java b/src/javax/persistence/spi/PersistenceUnitInfo.java
new file mode 100644
index 0000000..c8e107f
--- /dev/null
+++ b/src/javax/persistence/spi/PersistenceUnitInfo.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+import javax.sql.DataSource;
+import java.util.List;
+import java.util.Properties;
+import java.net.URL;
+import javax.persistence.SharedCacheMode;
+import javax.persistence.ValidationMode;
+
+/**
+ * Interface implemented by the container and used by the
+ * persistence provider when creating an {@link javax.persistence.EntityManagerFactory}.
+ *
+ * @since Java Persistence 1.0
+ */
+public interface PersistenceUnitInfo {
+	
+    /**
+     * Returns the name of the persistence unit. Corresponds to the
+     * <code>name</code> attribute in the <code>persistence.xml<code> file.
+     * @return  the name of the persistence unit 
+     */
+    public String getPersistenceUnitName();
+
+    /**
+     * Returns the fully qualified name of the persistence provider
+     * implementation class. Corresponds to the <code>provider</code> element in
+     * the <code>persistence.xml</code> file.
+     * @return  the fully qualified name of the persistence provider 
+     * implementation class
+     */
+    public String getPersistenceProviderClassName();
+
+    /**
+     * Returns the transaction type of the entity managers created by
+     * the <code>EntityManagerFactory</code>. The transaction type corresponds to
+     * the <code>transaction-type</code> attribute in the <code>persistence.xml</code> file.
+     * @return  transaction type of the entity managers created
+     * by the EntityManagerFactory
+     */
+    public PersistenceUnitTransactionType getTransactionType();
+
+    /**
+     * Returns the JTA-enabled data source to be used by the
+     * persistence provider. The data source corresponds to the
+     * <code>jta-data-source</code> element in the <code>persistence.xml</code> file or is
+     * provided at deployment or by the container.
+     * @return the JTA-enabled data source to be used by the 
+     * persistence provider
+     */
+    public DataSource getJtaDataSource();
+
+    /**
+     * Returns 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
+     * <code>non-jta-data-source</code> element in the <code>persistence.xml</code> file or
+     * provided at deployment or by the container.
+     * @return the non-JTA-enabled data source to be used by the 
+     * persistence provider for accessing data outside a JTA 
+     * transaction
+     */
+    public DataSource getNonJtaDataSource();
+
+    /**
+     * Returns the list of the names of the mapping files 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 <code>mapping-file</code> element in the
+     * <code>persistence.xml</code> file.
+     * @return the list of mapping file names that the persistence
+     * provider must load to determine the mappings for the entity
+     * classes 
+     */
+    public List<String> getMappingFileNames();
+
+    /**
+     * Returns a list of URLs for the jar files or exploded jar
+     * file directories that the persistence provider must examine
+     * for managed classes of the persistence unit. Each URL
+     * corresponds to a <code>jar-file</code> element in the
+     * <code>persistence.xml</code> file. A URL will either be a 
+     * file: URL referring to a jar file or referring to a directory
+     * that contains an exploded jar file, or some other URL from
+     * which an InputStream in jar format can be obtained.
+     * @return a list of URL objects referring to jar files or
+     * directories 
+     */
+    public List<URL> getJarFileUrls();
+
+    /**
+     * Returns 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.)
+     * The URL will either be a file: URL referring to a jar file 
+     * or referring to a directory that contains an exploded jar
+     * file, or some other URL from which an InputStream in jar
+     * format can be obtained.
+     * @return a URL referring to a jar file or directory
+     */
+    public URL getPersistenceUnitRootUrl();
+
+    /**
+     * Returns the list of the names of the classes that the
+     * persistence provider must add to its set of managed
+     * classes. Each name corresponds to a named <code>class</code> element in the
+     * <code>persistence.xml</code> file.
+     * @return the list of the names of the classes that the 
+     * persistence provider must add to its set of managed 
+     * classes 
+     */
+    public List<String> getManagedClassNames();
+
+    /**
+     * Returns 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
+     * <code>exclude-unlisted-classes</code> element in the <code>persistence.xml</code> file.
+     * @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
+     */
+    public boolean excludeUnlistedClasses();
+
+    /**
+     * Returns the specification of how the provider must use
+     * a second-level cache for the persistence unit.
+     * The result of this method corresponds to the <code>shared-cache-mode</code>
+     * element in the <code>persistence.xml</code> file.
+     * @return the second-level cache mode that must be used by the
+     * provider for the persistence unit
+     *
+     * @since Java Persistence 2.0
+     */
+    public SharedCacheMode getSharedCacheMode();
+
+    /**
+     * Returns the validation mode to be used by the persistence
+     * provider for the persistence unit.  The validation mode
+     * corresponds to the <code>validation-mode</code> element in the
+     * <code>persistence.xml</code> file.
+     * @return the validation mode to be used by the 
+     * persistence provider for the persistence unit
+     * 
+     * @since Java Persistence 2.0
+     */
+    public ValidationMode getValidationMode();
+
+    /**
+     * Returns a properties object. Each property corresponds to a
+     * <code>property</code> element in the <code>persistence.xml</code> file
+     * or to a property set by the container.
+     * @return Properties object 
+     */
+    public Properties getProperties();
+    
+    /**
+     * Returns the schema version of the <code>persistence.xml</code> file.
+     * @return persistence.xml schema version
+     *
+     * @since Java Persistence 2.0
+     */
+    public String getPersistenceXMLSchemaVersion();
+
+    /**
+     * Returns ClassLoader that the provider may use to load any
+     * classes, resources, or open URLs.
+     * @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
+     * {@link PersistenceUnitInfo#getClassLoader} method. The transformer 
+     * has no effect on the result returned by the
+     * {@link PersistenceUnitInfo#getNewTempClassLoader} 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   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 {@link
+     * PersistenceUnitInfo#getClassLoader}. None of the classes loaded
+     * by this class loader will be visible to application
+     * components. The provider may only use this ClassLoader within
+     * the scope of the {@link
+     * PersistenceProvider#createContainerEntityManagerFactory} call.
+     * @return temporary ClassLoader with same visibility as current
+     * loader
+     */
+    public ClassLoader getNewTempClassLoader();
+}
diff --git a/src/javax/persistence/spi/PersistenceUnitTransactionType.java b/src/javax/persistence/spi/PersistenceUnitTransactionType.java
new file mode 100644
index 0000000..acb1481
--- /dev/null
+++ b/src/javax/persistence/spi/PersistenceUnitTransactionType.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+package javax.persistence.spi;
+
+/**
+ * Specifies whether entity managers created by the {@link
+ * javax.persistence.EntityManagerFactory} will be JTA or
+ * resource-local entity managers.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum PersistenceUnitTransactionType {
+
+    /** JTA entity managers will be created. */
+    JTA,
+	
+    /** Resource-local entity managers will be created. */
+    RESOURCE_LOCAL
+}
diff --git a/src/javax/persistence/spi/ProviderUtil.java b/src/javax/persistence/spi/ProviderUtil.java
new file mode 100644
index 0000000..a7390fd
--- /dev/null
+++ b/src/javax/persistence/spi/ProviderUtil.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence.spi;
+
+/**
+ * Utility interface implemented by the persistence provider.  This
+ * interface is invoked by the {@link
+ * javax.persistence.PersistenceUtil} implementation to determine
+ * the load status of an entity or entity attribute.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface ProviderUtil { 
+
+    /**
+     * If the provider determines that the entity has been provided
+     * by itself and that the state of the specified attribute has
+     * been loaded, this method returns <code>LoadState.LOADED</code>.
+     * <p> If the provider determines that the entity has been provided
+     * by itself and that either entity attributes with <code>FetchType.EAGER</code> 
+     * have not been loaded or that the state of the specified
+     * attribute has not been loaded, this methods returns
+     * <code>LoadState.NOT_LOADED</code>.
+     * <p> If a provider cannot determine the load state, this method
+     * returns <code>LoadState.UNKNOWN</code>.
+     * <p> The provider's implementation of this method must not obtain
+     * a reference to an attribute value, as this could trigger the
+     * loading of entity state if the entity has been provided by a
+     * different provider.
+     * @param entity  entity instance
+     * @param attributeName  name of attribute whose load status is
+     *        to be determined
+     * @return load status of the attribute
+     */
+    public LoadState isLoadedWithoutReference(Object entity, String attributeName);
+
+    /**
+     * If the provider determines that the entity has been provided
+     * by itself and that the state of the specified attribute has
+     * been loaded, this method returns <code>LoadState.LOADED</code>.
+     * <p> If a provider determines that the entity has been provided
+     * by itself and that either the entity attributes with <code>FetchType.EAGER</code>
+     * have not been loaded or that the state of the specified
+     * attribute has not been loaded, this method returns
+     * return <code>LoadState.NOT_LOADED</code>.
+     * <p> If the provider cannot determine the load state, this method
+     * returns <code>LoadState.UNKNOWN</code>.
+     * <p> The provider's implementation of this method is permitted to
+     * obtain a reference to the attribute value.  (This access is
+     * safe because providers which might trigger the loading of the
+     * attribute state will have already been determined by
+     * <code>isLoadedWithoutReference</code>. )
+     *
+     * @param entity  entity instance
+     * @param attributeName  name of attribute whose load status is
+     *        to be determined
+     * @return load status of the attribute
+     */
+    public LoadState isLoadedWithReference(Object entity, String attributeName);
+
+    /**
+     * If the provider determines that the entity has been provided
+     * by itself and that the state of all attributes for which
+     * <code>FetchType.EAGER</code> has been specified have been loaded, this 
+     * method returns <code>LoadState.LOADED</code>.
+     * <p> If the provider determines that the entity has been provided
+     * by itself and that not all attributes with <code>FetchType.EAGER</code> 
+     * have been loaded, this method returns <code>LoadState.NOT_LOADED</code>.
+     * <p> If the provider cannot determine if the entity has been
+     * provided by itself, this method returns <code>LoadState.UNKNOWN</code>.
+     * <p> The provider's implementation of this method must not obtain
+     * a reference to any attribute value, as this could trigger the
+     * loading of entity state if the entity has been provided by a
+     * different provider.
+     * @param entity whose loaded status is to be determined
+     * @return load status of the entity
+     */
+    public LoadState isLoaded(Object entity);
+}
diff --git a/src/javax/persistence/spi/package-info.java b/src/javax/persistence/spi/package-info.java
new file mode 100644
index 0000000..852ec5f
--- /dev/null
+++ b/src/javax/persistence/spi/package-info.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     Linda DeMichiel - Java Persistence 2.1
+ *     Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/ 
+
+/**
+ * SPI for Java Persistence providers
+ */
+package javax.persistence.spi;
diff --git a/src/org/eclipse/persistence/javax/persistence/osgi/Activator.java b/src/org/eclipse/persistence/javax/persistence/osgi/Activator.java
new file mode 100644
index 0000000..d3d937e
--- /dev/null
+++ b/src/org/eclipse/persistence/javax/persistence/osgi/Activator.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 1998, 2011 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the 
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+ * which accompanies this distribution. 
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     mkeith
+ ******************************************************************************/  
+package org.eclipse.persistence.javax.persistence.osgi;
+
+import javax.persistence.spi.PersistenceProviderResolverHolder;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Activator class for OSGi integration
+ * 
+ * @author mkeith, tware, ssmith
+ */
+public class Activator implements BundleActivator {
+
+    public void start(BundleContext context) throws Exception {
+        PersistenceProviderResolverHolder.setPersistenceProviderResolver(new OSGiProviderResolver(context));
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        PersistenceProviderResolverHolder.setPersistenceProviderResolver(null);
+    }
+}
diff --git a/src/org/eclipse/persistence/javax/persistence/osgi/OSGiProviderResolver.java b/src/org/eclipse/persistence/javax/persistence/osgi/OSGiProviderResolver.java
new file mode 100644
index 0000000..bb95108
--- /dev/null
+++ b/src/org/eclipse/persistence/javax/persistence/osgi/OSGiProviderResolver.java
@@ -0,0 +1,222 @@
+/*******************************************************************************
+ * Copyright (c) 1998, 2011 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the 
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
+ * which accompanies this distribution. 
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *     mkeith
+ ******************************************************************************/  
+package org.eclipse.persistence.javax.persistence.osgi;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceException;
+import javax.persistence.spi.LoadState;
+import javax.persistence.spi.PersistenceProvider;
+import javax.persistence.spi.PersistenceProviderResolver;
+import javax.persistence.spi.PersistenceUnitInfo;
+import javax.persistence.spi.ProviderUtil;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.jpa.EntityManagerFactoryBuilder;
+
+/**
+ * This class acts as the ProviderResolver as well as the 
+ * PersistenceProvider to the Persistence class.
+ * 
+ * @author mkeith
+ */
+ at SuppressWarnings("unchecked")
+public class OSGiProviderResolver implements PersistenceProviderResolver, 
+                                             PersistenceProvider {
+    BundleContext ctx;
+    
+    public OSGiProviderResolver(BundleContext ctx) {
+        this.ctx = ctx;
+    }
+    
+    /*=====================================*/
+    /* PersistenceProviderResolver methods */
+    /*=====================================*/
+
+    /**
+     * ProviderResolver API method to get all of the providers. We will use 
+     * this to hook ourselves in through the Persistence class so we can intercept 
+     * all of the provider calls and redirect them to use OSGi services.
+     */
+    public List<PersistenceProvider> getPersistenceProviders() {
+
+        List<PersistenceProvider> listOfOurself = new ArrayList<PersistenceProvider>();
+        listOfOurself.add(this);
+        return listOfOurself;
+    }
+
+    // Do nothing since we aren't caching anything
+    public void clearCachedProviders () {}
+    
+    /*=============================*/
+    /* PersistenceProvider methods */
+    /*=============================*/
+    
+    public EntityManagerFactory createEntityManagerFactory(String unitName, Map props) {
+        return (((props == null) || (props.isEmpty())))
+            ? lookupEMF(unitName)
+            : lookupEMFBuilder(unitName, props);
+    }
+
+    public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map props) {
+        // Not supported through the Persistence class
+        return null;
+    }
+    
+    public ProviderUtil getProviderUtil() {
+        // Now it gets interesting, because we need to return something that looks and smells like 
+        // a ProviderUtil, but that does the job of the Persistence class cycling through the providers
+        return new ForwardingProviderUtil();
+    }
+
+    /*==========================*/
+    /* ProviderUtil inner class */
+    /*==========================*/
+    
+    public class ForwardingProviderUtil implements ProviderUtil {
+
+        public LoadState isLoadedWithReference(Object entity, String attributeName) {
+            Collection<PersistenceProvider> providers = lookupProviders();
+            for (PersistenceProvider provider : providers) {
+                LoadState loadstate = provider.getProviderUtil().isLoadedWithReference(entity, attributeName);
+                if (loadstate != LoadState.UNKNOWN) {
+                    return loadstate;
+                } // else keep looking
+            }
+            // None of the providers knew, so the load state is unknown
+            return LoadState.UNKNOWN;
+        }
+
+        public LoadState isLoadedWithoutReference(Object entity, String attributeName) {
+            Collection<PersistenceProvider> providers = lookupProviders();
+            for (PersistenceProvider provider : providers) {
+                LoadState loadstate = provider.getProviderUtil().isLoadedWithoutReference(entity, attributeName);
+                if (loadstate != LoadState.UNKNOWN) {
+                    return loadstate;
+                } // else keep looking
+            }
+            // None of the providers knew, so the load state is unknown
+            return LoadState.UNKNOWN;
+        }
+
+        public LoadState isLoaded(Object entity) {
+            Collection<PersistenceProvider> providers = lookupProviders();
+            for (PersistenceProvider provider : providers) {
+                LoadState loadstate = provider.getProviderUtil().isLoaded(entity);
+                if (loadstate != LoadState.UNKNOWN) {
+                    return loadstate;
+                } // else keep looking
+            }
+            // None of the providers knew, so the load state is unknown
+            return LoadState.UNKNOWN;
+        }
+    }
+
+    /*================*/
+    /* Helper Methods */
+    /*================*/
+    
+    /**
+     * Look up the Entity Manager Factory service based on the unit name.
+     */
+    public EntityManagerFactory lookupEMF(String unitName) {
+
+        debug("Persistence class - lookupEMF, punit=", unitName);
+        String filter = null;
+        ServiceReference[] refs = null;        
+        try {
+            filter = "(osgi.unit.name="+ unitName +")";
+            refs = ctx.getServiceReferences(EntityManagerFactory.class.getName(), filter);
+        } catch (InvalidSyntaxException isEx) {
+            new PersistenceException("Implementation error - incorrect filter specified while looking up EMF", isEx);
+        }
+        if ((refs != null) && (refs.length != 0)) {
+            debug("Persistence class - lookupEMF, found service ", unitName, " in registry");
+            // Take the first one
+            return (EntityManagerFactory)ctx.getService(refs[0]);
+        }
+        // Didn't find any EMF service under the given name
+        debug("Persistence class - lookupEMF, *** EMF service ", unitName, " not found in registry ***");
+        return null; 
+    }
+
+    /**
+     * Look up the Entity Manager Factory Builder service based on the unit name. 
+     *
+     * @return The EntityManagerFactory object that was looked up (or created from the 
+     *         EntityManagerFactoryBuilder)
+     */
+    public EntityManagerFactory lookupEMFBuilder(String unitName, Map<?,?> props) {
+
+        debug("Persistence class - lookupEMFBuilder, punit=", unitName);
+        String filter = null;
+        ServiceReference[] refs = null;        
+        try {
+            filter = "(osgi.unit.name="+ unitName +")";
+            refs = ctx.getServiceReferences(EntityManagerFactoryBuilder.class.getName(), filter);
+        } catch (InvalidSyntaxException isEx) {
+            new PersistenceException("Implementation error - incorrect filter specified while looking up EMF", isEx);
+        }
+        if ((refs != null) && (refs.length != 0)) {
+            debug("Persistence class - lookupEMFBuilder, found service ", unitName, " in registry");
+            // Take the first one and create an EMF from it
+            EntityManagerFactoryBuilder builder = (EntityManagerFactoryBuilder)ctx.getService(refs[0]);
+            return builder.createEntityManagerFactory(props);
+        }
+        // Didn't find anything under the given name
+        debug("Persistence class - lookupEMFBuilder, *** EMFBuilder service ", unitName, 
+              " not found in registry ***");
+        return null; 
+    }
+    
+    public Collection<PersistenceProvider> lookupProviders() {
+
+        debug("Persistence class - lookupProviders");
+        Collection<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
+        
+        ServiceReference[] refs = null;
+        try { refs = ctx.getServiceReferences(PersistenceProvider.class.getName(), null); }
+        catch (InvalidSyntaxException invEx) {} // Can't happen since filter is null
+        
+        if (refs != null) {
+            for (ServiceReference ref : refs) {
+                providers.add((PersistenceProvider)ctx.getService(ref));
+            }
+        }
+        return providers;
+    }
+
+    protected void debug(String... msgs) {
+        if (System.getProperty("JPA_DEBUG") != null) {
+            StringBuilder sb = new StringBuilder();
+            for (String msg : msgs) sb.append(msg);
+            System.out.println(sb.toString()); 
+        }
+    }
+
+    public void generateSchema(PersistenceUnitInfo info, Map map) {
+        // TODO: JPA 2.1 Functionality
+    }
+
+    public boolean generateSchema(String persistenceUnitName, Map map) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}
diff --git a/src/org/osgi/service/jpa/EntityManagerFactoryBuilder.java b/src/org/osgi/service/jpa/EntityManagerFactoryBuilder.java
new file mode 100644
index 0000000..028f2a8
--- /dev/null
+++ b/src/org/osgi/service/jpa/EntityManagerFactoryBuilder.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) OSGi Alliance (2009). All Rights Reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osgi.service.jpa;
+
+import java.util.Map;
+
+import javax.persistence.EntityManagerFactory;
+
+/**
+ * This service interface offers JPA clients the ability to create instances of
+ * EntityManagerFactory for a given named persistence unit. A service instance  
+ * will be created for each named persistence unit and can be filtered on by 
+ * comparing the value of the osgi.unit.name property containing the persistence 
+ * unit name. 
+ * 
+ * This service is used specifically when the caller wants to pass in factory-scoped
+ * properties as arguments. If no properties are being used in the creation of the 
+ * EntityManagerFactory then the basic EntityManagerFactory service should be used.
+ */
+public interface EntityManagerFactoryBuilder {
+
+    /**
+     * The name of the persistence unit.
+     */
+    public static final String JPA_UNIT_NAME = "osgi.unit.name";
+
+    /**
+     * The version of the persistence unit bundle.
+     */
+    public static final String JPA_UNIT_VERSION = "osgi.unit.version";
+
+    /**
+     * The class name of the provider that registered the service and implements 
+     * the JPA javax.persistence.PersistenceProvider interface.
+     */
+    public static final String JPA_UNIT_PROVIDER = "osgi.unit.provider";
+
+	/**
+	 * Return an EntityManagerFactory instance configured according to the properties
+     * defined in the corresponding persistence descriptor, as well as the properties 
+     * passed into the method.
+	 * 
+	 * @param props Properties to be used, in addition to those in the persistence descriptor,
+     *              for configuring the EntityManagerFactory for the persistence unit.
+     *
+	 * @return An EntityManagerFactory for the persistence unit associated with this service.
+	 */
+    @SuppressWarnings("unchecked")
+    EntityManagerFactory createEntityManagerFactory(Map props);
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/javax.persistence.git



More information about the pkg-java-commits mailing list