diff options
author | bvosburgh | 2009-08-21 05:37:39 +0000 |
---|---|---|
committer | bvosburgh | 2009-08-21 05:37:39 +0000 |
commit | 667b355cc374bfd39ccf2c2df8299cf3d9269374 (patch) | |
tree | 1833363eb5f4698b14e1c57b1e030adee41d0066 /jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2 | |
parent | 928dd42df949bf089f02025ab691e5717713ff07 (diff) | |
download | webtools.dali-667b355cc374bfd39ccf2c2df8299cf3d9269374.tar.gz webtools.dali-667b355cc374bfd39ccf2c2df8299cf3d9269374.tar.xz webtools.dali-667b355cc374bfd39ccf2c2df8299cf3d9269374.zip |
[283897] Static Metamodel generation
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2')
14 files changed, 596 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java new file mode 100644 index 0000000000..e529e2b133 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java @@ -0,0 +1,149 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2; + +import org.eclipse.jpt.core.JpaFactory; +import org.eclipse.jpt.core.context.MappingFile; +import org.eclipse.jpt.core.context.XmlContextNode; +import org.eclipse.jpt.core.context.java.JavaAttributeMapping; +import org.eclipse.jpt.core.context.java.JavaBasicMapping; +import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping; +import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping; +import org.eclipse.jpt.core.context.java.JavaIdMapping; +import org.eclipse.jpt.core.context.java.JavaManyToManyMapping; +import org.eclipse.jpt.core.context.java.JavaManyToOneMapping; +import org.eclipse.jpt.core.context.java.JavaOneToManyMapping; +import org.eclipse.jpt.core.context.java.JavaOneToOneMapping; +import org.eclipse.jpt.core.context.java.JavaTransientMapping; +import org.eclipse.jpt.core.context.java.JavaVersionMapping; +import org.eclipse.jpt.core.context.orm.EntityMappings; +import org.eclipse.jpt.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.core.context.orm.OrmBasicMapping; +import org.eclipse.jpt.core.context.orm.OrmEmbeddable; +import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping; +import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping; +import org.eclipse.jpt.core.context.orm.OrmEntity; +import org.eclipse.jpt.core.context.orm.OrmGeneratorContainer; +import org.eclipse.jpt.core.context.orm.OrmIdMapping; +import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping; +import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping; +import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass; +import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping; +import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping; +import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.core.context.orm.OrmPersistentType; +import org.eclipse.jpt.core.context.orm.OrmTransientMapping; +import org.eclipse.jpt.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.core.context.orm.OrmVersionMapping; +import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata; +import org.eclipse.jpt.core.context.persistence.MappingFileRef; +import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericEntityMappings2_0; +import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmXml2_0; +import org.eclipse.jpt.core.jpa2.context.orm.OrmSequenceGenerator2_0; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlAttributeMapping; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlBasic; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlEmbeddable; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlEmbedded; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlEmbeddedId; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlEntity; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlEntityMappings; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlId; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlManyToMany; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlManyToOne; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlMappedSuperclass; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlOneToMany; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlOneToOne; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlSequenceGenerator; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlTransient; +import org.eclipse.jpt.core.jpa2.resource.orm.XmlVersion; +import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer; +import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping; +import org.eclipse.jpt.core.resource.orm.XmlTypeMapping; +import org.eclipse.jpt.core.resource.xml.JpaXmlResource; + +/** + * JPA 2.0 factory + *<p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + * + * @see org.eclipse.jpt.core.internal.platform.GenericJpaFactory2_0 + */ +public interface JpaFactory2_0 + extends JpaFactory +{ + MappingFile buildMappingFile2_0(MappingFileRef parent, JpaXmlResource resource); + + EntityMappings buildEntityMappings2_0(GenericOrmXml2_0 parent, XmlEntityMappings xmlEntityMappings); + + PersistenceUnitMetadata buildPersistenceUnitMetadata2_0(GenericEntityMappings2_0 parent, XmlEntityMappings xmlEntityMappings); + + OrmPersistentType buildOrmPersistentType2_0(EntityMappings parent, XmlTypeMapping resourceMapping); + + OrmEmbeddable buildOrmEmbeddable2_0(OrmPersistentType parent, XmlEmbeddable resourceMapping); + + OrmEntity buildOrmEntity2_0(OrmPersistentType parent, XmlEntity resourceMapping); + + OrmMappedSuperclass buildOrmMappedSuperclass2_0(OrmPersistentType parent, XmlMappedSuperclass resourceMapping); + + OrmPersistentAttribute buildOrmPersistentAttribute2_0(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, XmlAttributeMapping resourceMapping); + + OrmBasicMapping buildOrmBasicMapping2_0(OrmPersistentAttribute parent, XmlBasic resourceMapping); + + OrmEmbeddedMapping buildOrmEmbeddedMapping2_0(OrmPersistentAttribute parent, XmlEmbedded resourceMapping); + + OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping2_0(OrmPersistentAttribute parent, XmlEmbeddedId resourceMapping); + + OrmIdMapping buildOrmIdMapping2_0(OrmPersistentAttribute parent, XmlId resourceMapping); + + OrmManyToManyMapping buildOrmManyToManyMapping2_0(OrmPersistentAttribute parent, XmlManyToMany resourceMapping); + + OrmManyToOneMapping buildOrmManyToOneMapping2_0(OrmPersistentAttribute parent, XmlManyToOne resourceMapping); + + OrmOneToManyMapping buildOrmOneToManyMapping2_0(OrmPersistentAttribute parent, XmlOneToMany resourceMapping); + + OrmOneToOneMapping buildOrmOneToOneMapping2_0(OrmPersistentAttribute parent, XmlOneToOne resourceMapping); + + OrmTransientMapping buildOrmTransientMapping2_0(OrmPersistentAttribute parent, XmlTransient resourceMapping); + + OrmVersionMapping buildOrmVersionMapping2_0(OrmPersistentAttribute parent, XmlVersion resourceMapping); + + OrmAttributeMapping buildOrmNullAttributeMapping2_0(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping); + + OrmGeneratorContainer buildOrmGeneratorContainer2_0(XmlContextNode parent, XmlGeneratorContainer resourceGeneratorContainer); + + OrmSequenceGenerator2_0 buildOrmSequenceGenerator2_0(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator); + + XmlBasic buildVirtualXmlBasic2_0(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping); + + XmlId buildVirtualXmlId2_0(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping); + + XmlEmbeddedId buildVirtualXmlEmbeddedId2_0(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping); + + XmlEmbedded buildVirtualXmlEmbedded2_0(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping); + + XmlManyToMany buildVirtualXmlManyToMany2_0(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping); + + XmlManyToOne buildVirtualXmlManyToOne2_0(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping); + + XmlOneToMany buildVirtualXmlOneToMany2_0(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping); + + XmlOneToOne buildVirtualXmlOneToOne2_0(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping); + + XmlTransient buildVirtualXmlTransient2_0(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping); + + XmlVersion buildVirtualXmlVersion2_0(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping); + + XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping2_0(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping); + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java new file mode 100644 index 0000000000..79442d9e03 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2; + +import org.eclipse.jpt.core.JpaProject; +import org.eclipse.jpt.core.jpa2.context.JpaRootContextNode2_0; + +/** + * JPA 2.0 project. + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface JpaProject2_0 + extends JpaProject, StaticMetaModelGenerator +{ + + /** + * Covariant override. + */ + public JpaRootContextNode2_0 getRootContextNode(); + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/StaticMetaModelGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/StaticMetaModelGenerator.java new file mode 100644 index 0000000000..facec37dbf --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/StaticMetaModelGenerator.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2; + +/** + * JPA 2.0 Static Metamodel Generator. + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface StaticMetaModelGenerator { + + /** + * Synchronize the JPA "Static Metamodel Classes" with the context model. + */ + void synchronizeStaticMetaModel(); + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.java new file mode 100644 index 0000000000..024caef493 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context; + +import org.eclipse.jpt.core.context.JpaRootContextNode; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; +import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceXml2_0; + +/** + * JPA 2.0 context model root. + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface JpaRootContextNode2_0 + extends JpaRootContextNode, StaticMetaModelGenerator +{ + /** + * Covariant override. + */ + public PersistenceXml2_0 getPersistenceXml(); + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JarFile2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JarFile2_0.java new file mode 100644 index 0000000000..d2b434ed44 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JarFile2_0.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.java; + +import org.eclipse.jpt.core.context.java.JarFile; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; + +public interface JarFile2_0 + extends JarFile, StaticMetaModelGenerator +{ + // nothing yet... +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.java new file mode 100644 index 0000000000..fffd0ab2fd --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.java; + +import org.eclipse.jpt.core.context.java.JavaPersistentType; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; + +/** + * JPA 2.0 context Java persistent type. + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface JavaPersistentType2_0 + extends JavaPersistentType, StaticMetaModelGenerator +{ + // nothing yet... +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/ClassRef2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/ClassRef2_0.java new file mode 100644 index 0000000000..375da5fc0d --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/ClassRef2_0.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence; + +import org.eclipse.jpt.core.context.persistence.ClassRef; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; + +/** + * JPA 2.0 <code>class<code> + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface ClassRef2_0 + extends ClassRef, StaticMetaModelGenerator +{ + // nothing yet... +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/JarFileRef2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/JarFileRef2_0.java new file mode 100644 index 0000000000..aa55752238 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/JarFileRef2_0.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence; + +import org.eclipse.jpt.core.context.persistence.JarFileRef; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; +import org.eclipse.jpt.core.jpa2.context.java.JarFile2_0; + +/** + * JPA 2.0 <code>jar-file</code> + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface JarFileRef2_0 + extends JarFileRef, StaticMetaModelGenerator +{ + JarFile2_0 getJarFile(); +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/MappingFileRef2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/MappingFileRef2_0.java new file mode 100644 index 0000000000..2b2be5ca48 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/MappingFileRef2_0.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence; + +import org.eclipse.jpt.core.context.persistence.MappingFileRef; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; + +/** + * JPA 2.0 <code>mapping-file</code> + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface MappingFileRef2_0 + extends MappingFileRef, StaticMetaModelGenerator +{ + // nothing yet... +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.java new file mode 100644 index 0000000000..92f09815ea --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence; + +import org.eclipse.jpt.core.context.persistence.Persistence; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; + +/** + * The <code>persistence</code> element in the JPA 2.0 <code>persistence.xml</code> file. + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface Persistence2_0 + extends Persistence, StaticMetaModelGenerator +{ + /** + * Covariant override. + */ + PersistenceXml2_0 getParent(); + + /** + * Covariant override. + */ + PersistenceUnit2_0 addPersistenceUnit(); + + /** + * Covariant override. + */ + PersistenceUnit2_0 addPersistenceUnit(int index); + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java new file mode 100644 index 0000000000..70d121ea68 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence; + +import org.eclipse.jpt.core.context.persistence.PersistenceUnit; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; +import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0; +import org.eclipse.jpt.core.jpa2.context.persistence.options.JpaOptions2_0; + +/** + * JPA 2.0 <code>persistence-unit</code> + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface PersistenceUnit2_0 + extends PersistenceUnit, StaticMetaModelGenerator +{ + JpaConnection2_0 getConnection(); + + JpaOptions2_0 getOptions(); +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.java new file mode 100644 index 0000000000..b629072fad --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2009 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence; + +import org.eclipse.jpt.core.context.persistence.PersistenceXml; +import org.eclipse.jpt.core.jpa2.StaticMetaModelGenerator; + +/** + * JPA 2.0 <code>persistence.xml</code> file. + * <p> + * Provisional API: This interface is part of an interim API that is still + * under development and expected to change significantly before reaching + * stability. It is available at this early stage to solicit feedback from + * pioneering adopters on the understanding that any code that uses this API + * will almost certainly be broken (repeatedly) as the API evolves. + */ +public interface PersistenceXml2_0 + extends PersistenceXml, StaticMetaModelGenerator +{ + /** + * Covariant override. + */ + Persistence2_0 addPersistence(); + + /** + * Covariant override. + */ + Persistence2_0 getPersistence(); + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java new file mode 100644 index 0000000000..7fde3751fd --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java @@ -0,0 +1,51 @@ +/******************************************************************************* +* Copyright (c) 2009 Oracle. All rights reserved. +* This program and the accompanying materials are made available under the +* terms of the Eclipse Public License v1.0, which accompanies this distribution +* and is available at http://www.eclipse.org/legal/epl-v10.html. +* +* Contributors: +* Oracle - initial API and implementation +*******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence.connection; + +import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties; + +/** + * JpaConnection2_0 + */ +public interface JpaConnection2_0 extends PersistenceUnitProperties +{ + String getDefaultDriver(); + String getDriver(); + void setDriver(String newDriver); + static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_JDBC_DRIVER = "javax.persistence.jdbc.driver"; //$NON-NLS-1$ + static final String DEFAULT_JDBC_DRIVER = ""; //$NON-NLS-1$ + + String getDefaultUrl(); + String getUrl(); + void setUrl(String newUrl); + static final String URL_PROPERTY = "url"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_JDBC_URL = "javax.persistence.jdbc.url"; //$NON-NLS-1$ + static final String DEFAULT_JDBC_URL = ""; //$NON-NLS-1$ + + String getDefaultUser(); + String getUser(); + void setUser(String newUser); + static final String USER_PROPERTY = "user"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_JDBC_USER = "javax.persistence.jdbc.user"; //$NON-NLS-1$ + static final String DEFAULT_JDBC_USER = ""; //$NON-NLS-1$ + + String getDefaultPassword(); + String getPassword(); + void setPassword(String newPassword); + static final String PASSWORD_PROPERTY = "password"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_JDBC_PASSWORD = "javax.persistence.jdbc.password"; //$NON-NLS-1$ + static final String DEFAULT_JDBC_PASSWORD = ""; //$NON-NLS-1$ + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java new file mode 100644 index 0000000000..2c274acd5a --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java @@ -0,0 +1,59 @@ +/******************************************************************************* +* Copyright (c) 2009 Oracle. All rights reserved. +* This program and the accompanying materials are made available under the +* terms of the Eclipse Public License v1.0, which accompanies this distribution +* and is available at http://www.eclipse.org/legal/epl-v10.html. +* +* Contributors: +* Oracle - initial API and implementation +*******************************************************************************/ +package org.eclipse.jpt.core.jpa2.context.persistence.options; + +import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties; + +/** + * JpaOptions2_0 + */ +public interface JpaOptions2_0 extends PersistenceUnitProperties +{ + Integer getDefaultLockTimeout(); + Integer getLockTimeout(); + void setLockTimeout(Integer newLockTimeout); + static final String LOCK_TIMEOUT_PROPERTY = "lockTimeout"; //$NON-NLS-1$ + // EclipseLink key string + static final String PERSISTENCE_LOCK_TIMEOUT = "javax.persistence.lock.timeout"; //$NON-NLS-1$ + static final Integer DEFAULT_LOCK_TIMEOUT = Integer.valueOf(5); + + Integer getDefaultQueryTimeout(); + Integer getQueryTimeout(); + void setQueryTimeout(Integer newQueryTimeout); + static final String QUERY_TIMEOUT_PROPERTY = "queryTimeout"; //$NON-NLS-1$ + // EclipseLink key string + static final String PERSISTENCE_QUERY_TIMEOUT = "javax.persistence.query.timeout"; //$NON-NLS-1$ + static final Integer DEFAULT_QUERY_TIMEOUT = Integer.valueOf(5); + + String getDefaultValidationGroupPrePersist(); + String getValidationGroupPrePersist(); + void setValidationGroupPrePersist(String newValidationGroupPrePersist); + static final String VALIDATION_GROUP_PRE_PERSIST_PROPERTY = "validationGroupPrePersist"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST = "javax.persistence.validation.group.pre-persist"; //$NON-NLS-1$ + static final String DEFAULT_VALIDATION_GROUP_PRE_PERSIST = "Default"; //$NON-NLS-1$ + + String getDefaultValidationGroupPreUpdate(); + String getValidationGroupPreUpdate(); + void setValidationGroupPreUpdate(String newValidationGroupPreUpdate); + static final String VALIDATION_GROUP_PRE_UPDATE_PROPERTY = "validationGroupPreUpdate"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE = "javax.persistence.validation.group.pre-update"; //$NON-NLS-1$ + static final String DEFAULT_VALIDATION_GROUP_PRE_UPDATE = "Default"; //$NON-NLS-1$ + + String getDefaultValidationGroupPreRemove(); + String getValidationGroupPreRemove(); + void setValidationGroupPreRemove(String newValidationGroupPreRemove); + static final String VALIDATION_GROUP_PRE_REMOVE_PROPERTY = "validationGroupPreRemove"; //$NON-NLS-1$ + // Property key + static final String PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE = "javax.persistence.validation.group.pre-remove"; //$NON-NLS-1$ + static final String DEFAULT_VALIDATION_GROUP_PRE_REMOVE = ""; //$NON-NLS-1$ + +} |