Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 77917 Details for
Bug 202684
persistence.xml and orm.xml are generated in wrong location for web projects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed patch
202684.txt (text/plain), 3.76 KB, created by
Paul Fullbright
on 2007-09-07 15:43:39 EDT
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Paul Fullbright
Created:
2007-09-07 15:43:39 EDT
Size:
3.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jpt.core >Index: src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java,v >retrieving revision 1.6.2.1 >diff -u -r1.6.2.1 JpaFacetPostInstallDelegate.java >--- src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java 5 Sep 2007 21:38:33 -0000 1.6.2.1 >+++ src/org/eclipse/jpt/core/internal/facet/JpaFacetPostInstallDelegate.java 7 Sep 2007 19:44:21 -0000 >@@ -12,6 +12,7 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jpt.core.internal.JpaModelManager; >+import org.eclipse.jpt.core.internal.JptCorePlugin; > import org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal; > import org.eclipse.jpt.core.internal.content.orm.OrmFactory; > import org.eclipse.jpt.core.internal.content.orm.OrmResource; >@@ -21,13 +22,18 @@ > import org.eclipse.jpt.core.internal.content.persistence.PersistenceUnit; > import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceArtifactEdit; > import org.eclipse.jpt.core.internal.content.persistence.resource.PersistenceResource; >+import org.eclipse.jst.j2ee.internal.J2EEConstants; >+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants; > import org.eclipse.wst.common.frameworks.datamodel.IDataModel; >+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; > import org.eclipse.wst.common.project.facet.core.IDelegate; > import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; > > public class JpaFacetPostInstallDelegate > implements IDelegate, IJpaFacetDataModelProperties > { >+ private final static String WEB_PROJECT_DEPLOY_PREFIX = J2EEConstants.WEB_INF_CLASSES; >+ > private final static String PERSISTENCE_XML_FILE_PATH = "META-INF/persistence.xml"; > > private final static String ORM_XML_FILE_PATH = "META-INF/orm.xml"; >@@ -64,8 +70,19 @@ > } > > private void createPersistenceXml(IProject project, IDataModel dataModel) { >+ String deployPath = PERSISTENCE_XML_FILE_PATH; >+ try { >+ if (FacetedProjectFramework.hasProjectFacet(project, IModuleConstants.JST_WEB_MODULE)) { >+ deployPath = WEB_PROJECT_DEPLOY_PREFIX + "/" + deployPath; >+ } >+ } >+ catch (CoreException ce) { >+ // could not determine project facets. assume it doesn't have the facet. >+ JptCorePlugin.log(ce); >+ } >+ > PersistenceArtifactEdit pae = >- PersistenceArtifactEdit.getArtifactEditForWrite(project, PERSISTENCE_XML_FILE_PATH); >+ PersistenceArtifactEdit.getArtifactEditForWrite(project, deployPath); > PersistenceResource resource = pae.getPersistenceResource(); > Persistence persistence = PersistenceFactory.eINSTANCE.createPersistence(); > persistence.setVersion("1.0"); >@@ -78,8 +95,19 @@ > } > > private void createOrmXml(IProject project, IDataModel dataModel) { >+ String deployPath = ORM_XML_FILE_PATH; >+ try { >+ if (FacetedProjectFramework.hasProjectFacet(project, IModuleConstants.JST_WEB_MODULE)) { >+ deployPath = WEB_PROJECT_DEPLOY_PREFIX + "/" + deployPath; >+ } >+ } >+ catch (CoreException ce) { >+ // could not determine project facets. assume it doesn't have the facet. >+ JptCorePlugin.log(ce); >+ } >+ > OrmArtifactEdit oae = >- OrmArtifactEdit.getArtifactEditForWrite(project, ORM_XML_FILE_PATH); >+ OrmArtifactEdit.getArtifactEditForWrite(project, deployPath); > OrmResource resource = oae.getOrmResource(); > EntityMappingsInternal entityMappings = OrmFactory.eINSTANCE.createEntityMappingsInternal(); > entityMappings.setVersion("1.0");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202684
: 77917