Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core')
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java23
3 files changed, 37 insertions, 43 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
index 34379ca44f..ca9b42c072 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<!--
- Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ Copyright (c) 2008, 2012 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.
@@ -104,10 +104,14 @@
<enablement>
<and>
<with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="jpa-user-library-provider"/>
+ <test property="org.eclipse.jpt.common.core.extendsId"
+ value="jpa-user-library-provider"/>
</with>
<with variable="config">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup" value="eclipselink"/>
+ <adapt type = "org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
+ <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
+ value="eclipselink"/>
+ </adapt>
</with>
</and>
</enablement>
@@ -119,10 +123,14 @@
<enablement>
<and>
<with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId" value="eclipselink-bundles-library-provider"/>
+ <test property="org.eclipse.jpt.common.core.extendsId"
+ value="eclipselink-bundles-library-provider"/>
</with>
<with variable="config">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup" value="eclipselink"/>
+ <adapt type = "org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
+ <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
+ value="eclipselink"/>
+ </adapt>
</with>
</and>
</enablement>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
index a4b8127fa5..f6cd283a41 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
@@ -19,9 +19,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
-
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
@@ -149,7 +147,6 @@ public abstract class AbstractEclipseLinkDDLGenerator extends AbstractJptGenerat
//reconnect since we disconnected in preGenerate();
//ensure the project is fully updated before validating - bug 277236
protected void reconnect() {
- getJpaProject().updateAndWait();
ConnectionProfile cp = this.getConnectionProfile();
if (cp != null) {
cp.connect();
@@ -157,10 +154,7 @@ public abstract class AbstractEclipseLinkDDLGenerator extends AbstractJptGenerat
}
protected void validateProject() {
- IProject project = this.getJpaProject().getProject();
- ValidateJob job = new ValidateJob(project);
- job.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project));
- job.schedule();
+ new ValidateJob(this.jpaProject.getProject()).schedule();
}
// ********** ClasspathEntry **********
@@ -305,28 +299,24 @@ public abstract class AbstractEclipseLinkDDLGenerator extends AbstractJptGenerat
/**
* Performs validation after tables have been generated
*/
- private class ValidateJob extends Job
+ /* CU private */ class ValidateJob
+ extends Job
{
- private IProject project;
-
+ private final IProject[] projects;
- public ValidateJob(IProject project) {
+ ValidateJob(IProject project) {
super(JptCoreMessages.VALIDATE_JOB);
- this.project = project;
+ this.projects = new IProject[] {project};
}
-
@Override
protected IStatus run(IProgressMonitor monitor) {
- IStatus status = Status.OK_STATUS;
try {
- ValidationFramework.getDefault().validate(
- new IProject[] {this.project}, true, false, monitor);
- }
- catch (CoreException ce) {
- status = Status.CANCEL_STATUS;
+ ValidationFramework.getDefault().validate(this.projects, true, false, monitor);
+ } catch (CoreException ex) {
+ throw new RuntimeException(ex);
}
- return status;
+ return Status.OK_STATUS;
}
}
@@ -356,16 +346,11 @@ public abstract class AbstractEclipseLinkDDLGenerator extends AbstractJptGenerat
// ********** Queries **********
protected JpaPlatform getPlatform() {
- return this.getJpaProject().getJpaPlatform();
+ return this.jpaProject.getJpaPlatform();
}
- protected JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
-
protected ConnectionProfile getConnectionProfile() {
- return this.getJpaProject().getConnectionProfile();
+ return this.jpaProject.getConnectionProfile();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
index 25e4011de1..2d6b3e56eb 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
@@ -1,15 +1,15 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 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
- *******************************************************************************/
+ * Copyright (c) 2008, 2012 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.jpa.eclipselink.core.internal.operations;
+import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
@@ -48,11 +48,12 @@ public class EclipseLinkOrmFileCreationDataModelProvider
@Override
protected String getDefaultVersion() {
- if (getProject() == null) {
+ JpaProject jpaProject = this.getJpaProject();
+ if (jpaProject == null) {
return null;
}
try {
- return getJpaProject().getJpaPlatform().getMostRecentSupportedResourceType(
+ return jpaProject.getJpaPlatform().getMostRecentSupportedResourceType(
JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE).getVersion();
}
catch (IllegalArgumentException iae) {

Back to the top