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 230937 Details for
Bug 407889
Jubula persistence core makes use of deprecated EclipseLink / JPA OSGi API
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]
Current status of work for switching to Gemini JPA
workFor407889.patch (text/plain), 15.80 KB, created by
Markus Tiede
on 2013-05-14 09:27:17 EDT
(
hide
)
Description:
Current status of work for switching to Gemini JPA
Filename:
MIME Type:
Creator:
Markus Tiede
Created:
2013-05-14 09:27:17 EDT
Size:
15.80 KB
patch
obsolete
>diff --git a/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF b/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF >index aba69ae..94d1b73 100644 >--- a/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF >+++ b/org.eclipse.jubula.client.core/META-INF/MANIFEST.MF >@@ -59,10 +59,13 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)", > org.apache.commons.cli;bundle-version="[1.2.0,2.0.0)", > org.apache.commons.beanutils;bundle-version="[1.7.0,2.0.0)", > javax.persistence;bundle-version="[2.0.3,3.0.0)", >+ org.eclipse.persistence.asm;bundle-version="[2.2.0,3.5.0)", >+ org.eclipse.persistence.antlr;bundle-version="[2.2.0,3.5.0)", > org.eclipse.persistence.core;bundle-version="[2.2.0,3.0.0)", > org.eclipse.persistence.jpa;bundle-version="[2.2.0,3.0.0)", >- org.eclipse.persistence.asm;bundle-version="[2.2.0,3.5.0)", >- org.eclipse.jubula.persistence.jpa.osgi;bundle-version="[2.1.0,2.2.0)", >+ org.eclipse.persistence.jpa.jpql;bundle-version="[2.0.0,3.0.0)", >+ osgi.enterprise;bundle-version="[4.2.0,5.0.0)", >+ org.eclipse.gemini.jpa;bundle-version="[1.0.0,2.0.0)", > org.slf4j.api;bundle-version="[1.5.11,2.0.0)", > ch.qos.logback.classic;bundle-version="[1.0.0,2.0.0)", > ch.qos.logback.core;bundle-version="[1.0.0,2.0.0)", >@@ -73,4 +76,4 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)", > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Bundle-Activator: org.eclipse.jubula.client.core.Activator > Bundle-ActivationPolicy: lazy >-JPA-PersistenceUnits: org.eclipse.jubula >+Meta-Persistence: META-INF/persistence.xml >diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CompIdentifierPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CompIdentifierPO.java >index f358909..df5410d 100644 >--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CompIdentifierPO.java >+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CompIdentifierPO.java >@@ -29,6 +29,7 @@ import javax.persistence.Version; > > import org.eclipse.jubula.tools.constants.StringConstants; > import org.eclipse.jubula.tools.objects.ComponentIdentifier; >+import org.eclipse.jubula.tools.objects.IComponentIdentifier; > import org.eclipse.persistence.annotations.BatchFetch; > import org.eclipse.persistence.annotations.BatchFetchType; > >@@ -38,10 +39,7 @@ import org.eclipse.persistence.annotations.BatchFetchType; > */ > @Entity > @Table(name = "COMP_ID") >-class CompIdentifierPO extends ComponentIdentifier implements >- ICompIdentifierPO { >- >- >+class CompIdentifierPO implements ICompIdentifierPO { > /** Persistence (JPA / EclipseLink) OID */ > private transient Long m_id = null; > >@@ -50,6 +48,12 @@ class CompIdentifierPO extends ComponentIdentifier implements > > /** The ID of the parent project */ > private Long m_parentProjectId = null; >+ >+ /** >+ * the sharable component identifier >+ */ >+ private ComponentIdentifier m_componentIdentifier = >+ new ComponentIdentifier(); > > /** > * only for Persistence (JPA / EclipseLink) >@@ -69,14 +73,14 @@ class CompIdentifierPO extends ComponentIdentifier implements > @JoinColumn(name = "FK_COMP_ID") > @BatchFetch(value = BatchFetchType.JOIN) > public List getNeighbours() { // NOPMD by al on 3/19/07 1:26 PM >- return super.getNeighbours(); >+ return m_componentIdentifier.getNeighbours(); > } > > /** > * @param neighbours The neighbours to set. > */ > public void setNeighbours(List neighbours) { // NOPMD by al on 3/19/07 1:26 PM >- super.setNeighbours(neighbours); >+ m_componentIdentifier.setNeighbours(neighbours); > } > > /** >@@ -86,14 +90,14 @@ class CompIdentifierPO extends ComponentIdentifier implements > @Basic > @Column(name = "COMP_CLASS_NAME", length = 4000) > public String getComponentClassName() { // NOPMD by al on 3/19/07 1:26 PM >- return super.getComponentClassName(); >+ return m_componentIdentifier.getComponentClassName(); > } > > /** > * @param componentClassName The componentClassName to set. > */ > public void setComponentClassName(String componentClassName) { // NOPMD by al on 3/19/07 1:26 PM >- super.setComponentClassName(componentClassName); >+ m_componentIdentifier.setComponentClassName(componentClassName); > } > > /** >@@ -103,14 +107,14 @@ class CompIdentifierPO extends ComponentIdentifier implements > @Basic > @Column(name = "SUPP_CLASS_NAME", length = 4000) > public String getSupportedClassName() { // NOPMD by al on 3/19/07 1:26 PM >- return super.getSupportedClassName(); >+ return m_componentIdentifier.getSupportedClassName(); > } > > /** > * @param supportedClassName The supportedClassName to set. > */ > public void setSupportedClassName(String supportedClassName) { // NOPMD by al on 3/19/07 1:26 PM >- super.setSupportedClassName(supportedClassName); >+ m_componentIdentifier.setSupportedClassName(supportedClassName); > } > > /** >@@ -124,7 +128,7 @@ class CompIdentifierPO extends ComponentIdentifier implements > @JoinColumn(name = "FK_COMP_ID") > @BatchFetch(value = BatchFetchType.JOIN) > public List<String> getHierarchyNames() { // NOPMD by al on 3/19/07 1:26 PM >- return super.getHierarchyNames(); >+ return m_componentIdentifier.getHierarchyNames(); > } > > /** >@@ -132,7 +136,7 @@ class CompIdentifierPO extends ComponentIdentifier implements > * The hierarchyNames to set. if null, the list will be cleared. > */ > public void setHierarchyNames(List hierarchyNames) { // NOPMD by al on 3/19/07 1:26 PM >- super.setHierarchyNames(hierarchyNames); >+ m_componentIdentifier.setHierarchyNames(hierarchyNames); > } > > /** >@@ -236,21 +240,84 @@ class CompIdentifierPO extends ComponentIdentifier implements > return StringConstants.EMPTY; > } > >- /** >- * >- * {@inheritDoc} >- */ >+ /** {@inheritDoc} */ > @Basic > @Column(name = "ALTERNATIVE_DISPLAY_NAME", length = 4000) > public String getAlternativeDisplayName() { >- return super.getAlternativeDisplayName(); >+ return m_componentIdentifier.getAlternativeDisplayName(); > } > > /** > * {@inheritDoc} > */ > public void setAlternativeDisplayName(String alternativeDisplayName) { >- super.setAlternativeDisplayName(alternativeDisplayName); >+ m_componentIdentifier.setAlternativeDisplayName(alternativeDisplayName); >+ } >+ >+ /** {@inheritDoc} */ >+ public String getComponentName() { >+ return m_componentIdentifier.getComponentName(); >+ } >+ >+ /** {@inheritDoc} */ >+ public void addHierarchyName(String hierarchyNames) { >+ m_componentIdentifier.addHierarchyName(hierarchyNames); >+ } >+ >+ /** {@inheritDoc} */ >+ public void clearHierarchyNames() { >+ m_componentIdentifier.clearHierarchyNames(); >+ } >+ >+ /** {@inheritDoc} */ >+ public IComponentIdentifier makeClone() { >+ return m_componentIdentifier.makeClone(); > } > >+ /** {@inheritDoc} */ >+ public void addNeighbour(String neighbours) { >+ m_componentIdentifier.addNeighbour(neighbours); >+ } >+ >+ /** {@inheritDoc} */ >+ public String generateLogicalName() { >+ return m_componentIdentifier.generateLogicalName(); >+ } >+ >+ /** {@inheritDoc} */ >+ public String getComponentNameToDisplay() { >+ return m_componentIdentifier.getComponentNameToDisplay(); >+ } >+ >+ /** {@inheritDoc} */ >+ public void setMatchPercentage(double matchPercentage) { >+ m_componentIdentifier.setMatchPercentage(matchPercentage); >+ } >+ >+ /** {@inheritDoc} */ >+ public double getMatchPercentage() { >+ return m_componentIdentifier.getMatchPercentage(); >+ } >+ >+ /** {@inheritDoc} */ >+ public void setNumberOfOtherMatchingComponents( >+ int numberOfOtherMatchingComponents) { >+ m_componentIdentifier.setNumberOfOtherMatchingComponents( >+ numberOfOtherMatchingComponents); >+ } >+ >+ /** {@inheritDoc} */ >+ public int getNumberOfOtherMatchingComponents() { >+ return m_componentIdentifier.getNumberOfOtherMatchingComponents(); >+ } >+ >+ /** {@inheritDoc} */ >+ public boolean isEqualOriginalFound() { >+ return m_componentIdentifier.isEqualOriginalFound(); >+ } >+ >+ /** {@inheritDoc} */ >+ public void setEqualOriginalFound(boolean equalOriginalFound) { >+ m_componentIdentifier.setEqualOriginalFound(equalOriginalFound); >+ } > } >diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/MonitoringValuePO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/MonitoringValuePO.java >index ef38567..83a1f14 100644 >--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/MonitoringValuePO.java >+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/MonitoringValuePO.java >@@ -22,11 +22,15 @@ import org.eclipse.jubula.tools.objects.MonitoringValue; > * @created 20.08.2010 > */ > @Embeddable >-public class MonitoringValuePO extends MonitoringValue { >- >+public class MonitoringValuePO { >+ /** >+ * the monitoring value >+ */ >+ private MonitoringValue m_monitoringValue; >+ > /** default */ > public MonitoringValuePO() { >- super(); >+ m_monitoringValue = new MonitoringValue(); > } > > /** >@@ -34,8 +38,7 @@ public class MonitoringValuePO extends MonitoringValue { > * @param type the type to set > */ > public MonitoringValuePO(String value, String type) { >- super(value, type); >- >+ m_monitoringValue = new MonitoringValue(value, type); > } > > /** >@@ -47,8 +50,7 @@ public class MonitoringValuePO extends MonitoringValue { > * > */ > public MonitoringValuePO(String value, String type, String category) { >- super(value, type, category); >- >+ m_monitoringValue = new MonitoringValue(value, type, category); > } > > /** >@@ -63,8 +65,8 @@ public class MonitoringValuePO extends MonitoringValue { > */ > public MonitoringValuePO(String value, String type, String category, > boolean isSignificant) { >- super(value, type, category, isSignificant); >- >+ m_monitoringValue = new MonitoringValue(value, type, category, >+ isSignificant); > } > > /** >@@ -73,7 +75,7 @@ public class MonitoringValuePO extends MonitoringValue { > @Basic > @Column(name = "MON_VALUE") > public String getValue() { >- return super.getValue(); >+ return m_monitoringValue.getValue(); > } > > /** >@@ -82,7 +84,7 @@ public class MonitoringValuePO extends MonitoringValue { > @Basic > @Column(name = "MON_TYPE") > public String getType() { >- return super.getType(); >+ return m_monitoringValue.getType(); > } > > /** >@@ -91,35 +93,35 @@ public class MonitoringValuePO extends MonitoringValue { > @Basic > @Column(name = "MON_CATEGORY") > public String getCategory() { >- return super.getCategory(); >+ return m_monitoringValue.getCategory(); > } > > /** > * {@inheritDoc} > */ > public void setCategory(String category) { >- super.setCategory(category); >+ m_monitoringValue.setCategory(category); > } > > /** > * @param value the value to set > */ > public void setValue(String value) { >- super.setValue(value); >+ m_monitoringValue.setValue(value); > } > > /** > * @param type the type to set > */ > public void setType(String type) { >- super.setType(type); >+ m_monitoringValue.setType(type); > } > > /** > * {@inheritDoc} > */ > public void setSignificant(Boolean significant) { >- super.setSignificant(significant); >+ m_monitoringValue.setSignificant(significant); > > } > >@@ -129,7 +131,7 @@ public class MonitoringValuePO extends MonitoringValue { > @Basic > @Column(name = "IS_SIGNIFICANT") > public Boolean isSignificant() { >- return super.isSignificant(); >+ return m_monitoringValue.isSignificant(); > > } > >diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/Persistor.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/Persistor.java >index 720fda4..d7aa896 100644 >--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/Persistor.java >+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/Persistor.java >@@ -64,9 +64,12 @@ import org.eclipse.jubula.tools.messagehandling.MessageIDs; > import org.eclipse.osgi.util.NLS; > import org.eclipse.persistence.config.PersistenceUnitProperties; > import org.eclipse.persistence.exceptions.DatabaseException; >-import org.eclipse.persistence.jpa.osgi.PersistenceProvider; > import org.eclipse.persistence.sessions.server.ServerSession; > import org.eclipse.persistence.tools.schemaframework.SchemaManager; >+import org.osgi.framework.BundleContext; >+import org.osgi.framework.InvalidSyntaxException; >+import org.osgi.framework.ServiceReference; >+import org.osgi.service.jpa.EntityManagerFactoryBuilder; > import org.slf4j.Logger; > import org.slf4j.LoggerFactory; > >@@ -1182,9 +1185,33 @@ public class Persistor { > properties.put(PersistenceUnitProperties.BATCH_WRITING_SIZE, > batchWritingSize); > } >- return new PersistenceProvider().createEntityManagerFactory( >- DEFAULT_PU_NAME, >- properties); >+ return getEMF(DEFAULT_PU_NAME, properties); >+ } >+ >+ /** >+ * @param unitName >+ * the persistence units name >+ * @param props >+ * the properties to use >+ * @return an entity manager factory >+ */ >+ public static EntityManagerFactory getEMF(String unitName, >+ Map<String, Object> props) { >+ ServiceReference[] refs = null; >+ EntityManagerFactoryBuilder emfb = null; >+ BundleContext context = Activator.getDefault().getBundle() >+ .getBundleContext(); >+ try { >+ refs = context.getServiceReferences( >+ EntityManagerFactoryBuilder.class.getName(), >+ "(osgi.unit.name=" + unitName + ")"); >+ } catch (InvalidSyntaxException isEx) { >+ throw new RuntimeException("Filter error", isEx); >+ } >+ if (refs != null) { >+ emfb = (EntityManagerFactoryBuilder) context.getService(refs[0]); >+ } >+ return (emfb == null) ? null : emfb.createEntityManagerFactory(props); > } > > /** >diff --git a/org.eclipse.jubula.project.configuration/target/definitions/juno.target b/org.eclipse.jubula.project.configuration/target/definitions/juno.target >index 16924ac..84df905 100644 >--- a/org.eclipse.jubula.project.configuration/target/definitions/juno.target >+++ b/org.eclipse.jubula.project.configuration/target/definitions/juno.target >@@ -23,14 +23,13 @@ > <unit id="org.eclipse.e4.rcp.feature.group" version="0.0.0"/> > <unit id="org.eclipse.pde.feature.group" version="0.0.0"/> > <unit id="org.eclipse.jdt.feature.group" version="0.0.0"/> >+<unit id="org.eclipse.gemini.jpa" version="0.0.0"/> >+<unit id="osgi.enterprise" version="0.0.0"/> >+<unit id="org.eclipse.persistence.jpa.feature.group" version="0.0.0"/> > <unit id="javax.xml" version="0.0.0"/> > <unit id="org.eclipse.emf.rap.sdk.feature.group" version="0.0.0"/> > <unit id="org.eclipse.gef.sdk.feature.group" version="0.0.0"/> > <repository id="eclipse-juno" location="http://download.eclipse.org/releases/juno"/> > </location> >-<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit"> >-<unit id="org.eclipse.persistence.jpa.feature.group" version="0.0.0"/> >-<repository location="http://download.eclipse.org/rt/eclipselink/milestone-updates/2.5.0.v20130425-368d603_RC1"/> >-</location> > </locations> > </target>
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 407889
:
230937