Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jubula.client.core')
-rw-r--r--org.eclipse.jubula.client.core/META-INF/persistence.xml2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java4
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java1
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties1
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java2
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java79
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java39
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java12
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java4
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java25
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java284
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java126
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java52
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java10
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java1
16 files changed, 451 insertions, 193 deletions
diff --git a/org.eclipse.jubula.client.core/META-INF/persistence.xml b/org.eclipse.jubula.client.core/META-INF/persistence.xml
index 2cef210e6..3f25231dd 100644
--- a/org.eclipse.jubula.client.core/META-INF/persistence.xml
+++ b/org.eclipse.jubula.client.core/META-INF/persistence.xml
@@ -51,7 +51,7 @@
<class>org.eclipse.jubula.client.core.model.AUTContPO</class>
<class>org.eclipse.jubula.client.core.model.SpecObjContPO</class>
<class>org.eclipse.jubula.client.core.model.ExecObjContPO</class>
- <class>org.eclipse.jubula.client.core.model.TestDataCubeContPO</class>
+ <class>org.eclipse.jubula.client.core.model.TestDataCategoryPO</class>
<class>org.eclipse.jubula.client.core.model.ParamNamePO</class>
<class>org.eclipse.jubula.client.core.model.ProjectNamePO</class>
<class>org.eclipse.jubula.client.core.model.ComponentNamePO</class>
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java
index 52fddfd5c..63e971c75 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNameMapperFactory.java
@@ -16,7 +16,7 @@ import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IProjectPropertiesPO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.client.core.model.ITestJobPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
import org.slf4j.Logger;
@@ -75,7 +75,7 @@ public final class CompNameMapperFactory {
return new NullComponentNameMapper();
} else if (node instanceof ITestJobPO) {
return new NullComponentNameMapper();
- } else if (node instanceof ITestDataCubeContPO) {
+ } else if (node instanceof ITestDataCategoryPO) {
return new NullComponentNameMapper();
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java
index 9154c798f..faef92587 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestDataCubeBP.java
@@ -51,7 +51,7 @@ public class TestDataCubeBP {
for (IParameterInterfacePO testDataCube
: containingProject.getTestDataCubeCont()
- .getTestDataCubeList()) {
+ .getTestDataChildren()) {
if (cubeName.equals(testDataCube.getName())) {
return testDataCube;
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java
index 27c54addf..1a14a9b2b 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/Messages.java
@@ -52,7 +52,6 @@ public class Messages extends NLS {
public static String CantReadProjectFromDatabase;
public static String CantSaveProject;
public static String CantSetupPersistence;
- public static String CentralTestDataEditorName;
public static String ClearingOfMasterSessionFailed;
public static String ClientBuildingReport;
public static String ClientCalculating;
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties
index c54220504..a8b08848b 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/i18n/messages.properties
@@ -38,7 +38,6 @@ CantLoadPersistenceProperties=Can't load Persistence properties
CantReadProjectFromDatabase=Can't read project from database
CantSaveProject=Can't save project
CantSetupPersistence=Can't setup Persistence
-CentralTestDataEditorName=Central Test Data
ClearingOfMasterSessionFailed=Clearing of master session failed
ClientBuildingReport=Building Monitoring Report
ClientCalculating=Calculating Monitoring Values
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java
index 88fc263f3..49b1e5454 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/IProjectPO.java
@@ -102,7 +102,7 @@ public interface IProjectPO extends IParamNodePO {
/**
* @return Returns the test data container.
*/
- public abstract ITestDataCubeContPO getTestDataCubeCont();
+ public abstract ITestDataCategoryPO getTestDataCubeCont();
/**
* All data from this PO is available from delegate methods in IProjectPO.
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java
new file mode 100644
index 000000000..fa4816f78
--- /dev/null
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCategoryPO.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2011 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.model;
+
+import java.util.List;
+
+/**
+ * @author BREDEX GmbH
+ * @created Nov 01, 2011
+ */
+public interface ITestDataCategoryPO extends IPersistentObject {
+
+ /**
+ * @return an unmodifiable list of Test Data Categories
+ */
+ public List<ITestDataCategoryPO> getCategoryChildren();
+
+ /**
+ * @return an unmodifiable list of Central Test Data
+ */
+ public List<ITestDataCubePO> getTestDataChildren();
+
+ /**
+ *
+ * @param toAdd The category to add to the receiver. Must not be
+ * <code>null</code>.
+ */
+ public void addCategory(ITestDataCategoryPO toAdd);
+
+ /**
+ *
+ * @param toRemove The category to remove from the receiver. Must not be
+ * <code>null</code>.
+ */
+ public void removeCategory(ITestDataCategoryPO toRemove);
+
+ /**
+ *
+ * @param toAdd The Central Test Data to add to the receiver. Must not be
+ * <code>null</code>.
+ */
+ public void addTestData(ITestDataCubePO toAdd);
+
+ /**
+ *
+ * @param toRemove The Central Test Data to remove from the receiver.
+ * Must not be <code>null</code>.
+ */
+ public void removeTestData(ITestDataCubePO toRemove);
+
+ /**
+ *
+ * @return the receiver's parent category, or <code>null</code> if the
+ * receiver is a top-level element (i.e. has no parent category).
+ */
+ public ITestDataCategoryPO getParent();
+
+ /**
+ *
+ * @param parent The receiver's new parent. A value of <code>null</code>
+ * indicates that the receiver is a top-level element (i.e.
+ * has no parent category).
+ */
+ public void setParent(ITestDataCategoryPO parent);
+
+ /**
+ *
+ * @param name The receiver's new name. Must not be <code>null</code>.
+ */
+ public void setName(String name);
+}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java
deleted file mode 100644
index cee621f46..000000000
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubeContPO.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.core.model;
-
-import java.util.List;
-
-/**
- * @author BREDEX GmbH
- * @created Jun 28, 2010
- *
- */
-public interface ITestDataCubeContPO extends IPersistentObject {
-
- /**
- * @return an unmodifiable list of test data cubes
- */
- public abstract List<IParameterInterfacePO> getTestDataCubeList();
-
- /**
- * @param tdc
- * test data cube to add
- */
- public abstract void addTestDataCube(IParameterInterfacePO tdc);
-
- /**
- * @param tdc
- * test data cube to remove
- */
- public abstract void removeTestDataCube(IParameterInterfacePO tdc);
-
-} \ No newline at end of file
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java
index 45bb3e620..72c4340c9 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ITestDataCubePO.java
@@ -19,4 +19,16 @@ public interface ITestDataCubePO extends IModifiableParameterInterfacePO {
* @param name The new name.
*/
public void setName(String name);
+
+ /**
+ *
+ * @return the receiver's parent category.
+ */
+ public ITestDataCategoryPO getParent();
+
+ /**
+ *
+ * @param parent The receiver's new parent.
+ */
+ public void setParent(ITestDataCategoryPO parent);
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java
index e88a77075..7c75ee189 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/PoMaker.java
@@ -431,8 +431,8 @@ public abstract class PoMaker {
* factory method to replace constructor
* @return TestDataCubeContPO
*/
- public static ITestDataCubeContPO createTestDataCubeContPO() {
- return new TestDataCubeContPO();
+ public static ITestDataCategoryPO createTestDataCategoryPO() {
+ return new TestDataCategoryPO();
}
/**
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java
index 162ec29d3..1cba31232 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/ProjectPO.java
@@ -94,7 +94,7 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
/**
* <code>m_testdatacubecont</code> object to manage all test data cubes
*/
- private TestDataCubeContPO m_testdatacubecont;
+ private ITestDataCategoryPO m_testdatacubecont;
/**
* only for Persistence (JPA / EclipseLink)
@@ -142,7 +142,7 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
PoMaker.createProjectPropertiesPO(
majorNumber, minorNumber));
setAutCont(PoMaker.createAUTContPO());
- setTestDataCubeContPO(PoMaker.createTestDataCubeContPO());
+ setTestDataCubeContPO(PoMaker.createTestDataCategoryPO());
setExecObjCont(PoMaker.createExecObjContPO());
setSpecObjCont(PoMaker.createSpecObjContPO());
setClientMetaDataVersion(metadataVersion);
@@ -299,9 +299,9 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
*
* {@inheritDoc}
*/
- public void setTestDataCubeContPO(ITestDataCubeContPO tdcc) {
- setHbmTestDataCubeContPO((TestDataCubeContPO)tdcc);
- getHbmTestDataCubeContPO().setParentProjectId(getId());
+ public void setTestDataCubeContPO(ITestDataCategoryPO testDataCategory) {
+ setHbmTestDataCubeContPO(testDataCategory);
+ testDataCategory.setParentProjectId(getId());
}
/**
@@ -748,24 +748,27 @@ class ProjectPO extends ParamNodePO implements IProjectPO {
* {@inheritDoc}
*/
@Transient
- public ITestDataCubeContPO getTestDataCubeCont() {
+ public ITestDataCategoryPO getTestDataCubeCont() {
return getHbmTestDataCubeContPO();
}
/**
- * @param tdcc The testdata cube container to set.
+ *
+ * @param testDataCategory The receiver's new top-level Test Data Category.
*/
- private void setHbmTestDataCubeContPO(TestDataCubeContPO tdcc) {
- m_testdatacubecont = tdcc;
+ private void setHbmTestDataCubeContPO(
+ ITestDataCategoryPO testDataCategory) {
+ m_testdatacubecont = testDataCategory;
}
/**
*
* @return Returns the test data cube container.
*/
- @OneToOne(cascade = CascadeType.ALL)
+ @OneToOne(cascade = CascadeType.ALL,
+ targetEntity = TestDataCategoryPO.class)
@JoinColumn(name = "TDC_CONT", unique = true)
- private TestDataCubeContPO getHbmTestDataCubeContPO() {
+ private ITestDataCategoryPO getHbmTestDataCubeContPO() {
return m_testdatacubecont;
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java
new file mode 100644
index 000000000..d5c879f75
--- /dev/null
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCategoryPO.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2011 BREDEX GmbH.
+ * 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:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.client.core.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderColumn;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.eclipse.jubula.tools.exception.Assert;
+import org.eclipse.persistence.annotations.Index;
+
+/**
+ * @author BREDEX GmbH
+ * @created Nov 01, 2011
+ */
+@Entity
+@Table(name = "TEST_DATA_CAT")
+class TestDataCategoryPO implements ITestDataCategoryPO {
+
+ /** Persistence (JPA / EclipseLink) OID */
+ private transient Long m_id = null;
+
+ /** Persistence (JPA / EclipseLink) version id */
+ private transient Integer m_version = null;
+
+ /** The ID of the parent project */
+ private Long m_parentProjectId = null;
+
+ /** the name of the category */
+ private String m_name = null;
+
+ /** all Central Test Data children of this element */
+ private List<ITestDataCubePO> m_testDataChildList =
+ new ArrayList<ITestDataCubePO>();
+
+ /** all Test Data Category children of this element */
+ private List<ITestDataCategoryPO> m_categoryChildList =
+ new ArrayList<ITestDataCategoryPO>();
+
+ /** the parent category */
+ private ITestDataCategoryPO m_parent = null;
+
+ /**
+ * JPA accessor for Central Test Data children.
+ *
+ * @return the Central Test Data children.
+ */
+ @OneToMany(cascade = CascadeType.ALL,
+ fetch = FetchType.EAGER,
+ targetEntity = TestDataCubePO.class,
+ orphanRemoval = true)
+ @OrderColumn(name = "IDX")
+ List<ITestDataCubePO> getHbmTestDataChildList() {
+ return m_testDataChildList;
+ }
+
+ /**
+ * JPA mutator for Central Test Data children.
+ *
+ * @param testDataChildList The Central Test Data children.
+ */
+ void setHbmTestDataChildList(List<ITestDataCubePO> testDataChildList) {
+ m_testDataChildList = testDataChildList;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Transient
+ public List<ITestDataCubePO> getTestDataChildren() {
+ return Collections.unmodifiableList(getHbmTestDataChildList());
+ }
+
+ /**
+ * JPA accessor for Test Data Category children.
+ *
+ * @return the Test Data Category children.
+ */
+ @OneToMany(cascade = CascadeType.ALL,
+ fetch = FetchType.EAGER,
+ targetEntity = TestDataCategoryPO.class,
+ orphanRemoval = true)
+ @OrderColumn(name = "IDX")
+ List<ITestDataCategoryPO> getHbmCategoryChildList() {
+ return m_categoryChildList;
+ }
+
+ /**
+ * JPA mutator for Central Test Data children.
+ *
+ * @param categoryChildList The Test Data Category children.
+ */
+ void setHbmCategoryChildList(List<ITestDataCategoryPO> categoryChildList) {
+ m_categoryChildList = categoryChildList;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Transient
+ public List<ITestDataCategoryPO> getCategoryChildren() {
+ return Collections.unmodifiableList(getHbmCategoryChildList());
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Id
+ @GeneratedValue
+ public Long getId() {
+ return m_id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ @SuppressWarnings("unused")
+ private void setId(Long id) {
+ m_id = id;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Version
+ @Column(name = "VERSION")
+ public Integer getVersion() {
+ return m_version;
+ }
+ /**
+ * @param version The version to set.
+ */
+ @SuppressWarnings("unused")
+ private void setVersion(Integer version) {
+ m_version = version;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Transient
+ public Long getParentProjectId() {
+ return getHbmParentProjectId();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setParentProjectId(Long projectId) {
+ setHbmParentProjectId(projectId);
+ for (ITestDataCategoryPO category : getCategoryChildren()) {
+ category.setParentProjectId(projectId);
+ }
+ for (ITestDataCubePO testData : getTestDataChildren()) {
+ testData.setParentProjectId(projectId);
+ }
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void addCategory(ITestDataCategoryPO toAdd) {
+ Assert.verify(toAdd != null);
+ toAdd.setParent(this);
+ getHbmCategoryChildList().add(toAdd);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void removeCategory(ITestDataCategoryPO toRemove) {
+ Assert.verify(toRemove != null);
+ toRemove.setParent(null);
+ getHbmCategoryChildList().remove(toRemove);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void addTestData(ITestDataCubePO toAdd) {
+ Assert.verify(toAdd != null);
+ toAdd.setParent(this);
+ getHbmTestDataChildList().add(toAdd);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void removeTestData(ITestDataCubePO toRemove) {
+ Assert.verify(toRemove != null);
+ toRemove.setParent(null);
+ getHbmTestDataChildList().remove(toRemove);
+ }
+
+ /**
+ * JPA accessor for parent Project ID.
+ *
+ * @return the ID of the Project to which the receiver belongs.
+ */
+ @Basic
+ @Column(name = "PARENT_PROJ")
+ @Index(name = "PI_DATA_CAT_PARENT_PROJ")
+ Long getHbmParentProjectId() {
+ return m_parentProjectId;
+ }
+
+ /**
+ * JPA mutator for parent Project ID.
+ *
+ * @param projectId the ID of the Project to which the receiver belongs.
+ */
+ void setHbmParentProjectId(Long projectId) {
+ m_parentProjectId = projectId;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Basic
+ @Column(name = "NAME", length = 4000)
+ public String getName() {
+ return m_name;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setName(String name) {
+ m_name = name;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @ManyToOne(targetEntity = TestDataCategoryPO.class)
+ @JoinColumn(name = "FK_PARENT", insertable = false,
+ updatable = false)
+ public ITestDataCategoryPO getParent() {
+ return m_parent;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setParent(ITestDataCategoryPO parent) {
+ m_parent = parent;
+ }
+}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java
deleted file mode 100644
index 9ab622815..000000000
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubeContPO.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.core.model;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderColumn;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.eclipse.jubula.client.core.i18n.Messages;
-
-
-/**
- * @author BREDEX GmbH
- * @created Jun 28, 2010
- */
-@Entity
-@Table(name = "CUBE_CONT")
-public class TestDataCubeContPO extends WrapperPO implements
- ITestDataCubeContPO {
- /**
- * <code>m_testDataCubes</code>
- */
- private List<IParameterInterfacePO> m_testDataCubes =
- new ArrayList<IParameterInterfacePO>();
-
- /** default constructor */
- TestDataCubeContPO() {
- // nothing
- }
-
- /**
- *
- * @return Returns the topLevelNodeList.
- */
- @OneToMany(cascade = CascadeType.ALL,
- fetch = FetchType.EAGER,
- targetEntity = TestDataCubePO.class,
- orphanRemoval = true)
- @OrderColumn(name = "IDX")
- List<IParameterInterfacePO> getHbmTestDataCubeList() {
- return m_testDataCubes;
- }
-
- /**
- * @return an unmodifiable list of test data cubes
- */
- @Transient
- public List<IParameterInterfacePO> getTestDataCubeList() {
- return Collections.unmodifiableList(getHbmTestDataCubeList());
- }
-
- /**
- * @param tdcl
- * test data cube list The test data cube list to set.
- */
- void setHbmTestDataCubeList(List<IParameterInterfacePO> tdcl) {
- m_testDataCubes = tdcl;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Transient
- public String getName() {
- return Messages.CentralTestDataEditorName;
- }
-
- /**
- * {@inheritDoc}
- */
- public void addTestDataCube(IParameterInterfacePO tdc) {
- getHbmTestDataCubeList().add(tdc);
- tdc.setParentProjectId(getParentProjectId());
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeTestDataCube(IParameterInterfacePO tdc) {
- getHbmTestDataCubeList().remove(tdc);
- }
-
- /**
- * {@inheritDoc}
- */
- @Transient
- // FIXME zeb If we don't explicitly declare this method and mark it as
- // @Transient, then EclipseLink assumes (due to the inheritance
- // of the method from the superclass) that the property
- // "parentProjectId" should be persisted. This causes an
- // exception when trying to access an instance of this class
- // from the database. Oddly enough, the exceptions do not occur
- // when running Jubula from the IDE. The exceptions only occur
- // in a deployed Jubula. Once this problem is resolved (for a
- // deployed Jubula), the workaround can be removed.
- public Long getParentProjectId() {
- return super.getParentProjectId();
- }
-
- /**
- * {@inheritDoc}
- */
- public void setParentProjectId(Long projectId) {
- super.setParentProjectId(projectId);
- for (IParameterInterfacePO tdc : getHbmTestDataCubeList()) {
- tdc.setParentProjectId(projectId);
- }
- }
-}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java
index 7171a47fe..49ff9dfd0 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/TestDataCubePO.java
@@ -38,6 +38,7 @@ import org.apache.commons.lang.Validate;
import org.eclipse.jubula.client.core.businessprocess.IParamNameMapper;
import org.eclipse.jubula.client.core.i18n.Messages;
import org.eclipse.jubula.client.core.persistence.PersistenceUtil;
+import org.eclipse.persistence.annotations.Index;
/**
@@ -54,9 +55,15 @@ class TestDataCubePO implements ITestDataCubePO {
/** Persistence (JPA / EclipseLink) version id */
private transient Integer m_version = null;
+ /** The ID of the parent project */
+ private Long m_parentProjectId = null;
+
/** the name by which the cube can be referenced */
private String m_name = null;
+ /** parent category */
+ private ITestDataCategoryPO m_parent = null;
+
/**
* <code>m_parameters</code>parameters for testcase
*/
@@ -286,6 +293,7 @@ class TestDataCubePO implements ITestDataCubePO {
* {@inheritDoc}
*/
public void setParentProjectId(Long projectId) {
+ setHbmParentProjectId(projectId);
for (IParamDescriptionPO paramDesc : getHbmParameterList()) {
paramDesc.setParentProjectId(projectId);
}
@@ -444,8 +452,29 @@ class TestDataCubePO implements ITestDataCubePO {
* {@inheritDoc}
*/
@Transient
- public Long getParentProjectId() throws UnsupportedOperationException {
- return null;
+ public Long getParentProjectId() {
+ return getHbmParentProjectId();
+ }
+
+ /**
+ * JPA accessor for ID of parent Project.
+ *
+ * @return the parent Project ID.
+ */
+ @Basic
+ @Column(name = "PARENT_PROJ")
+ @Index(name = "PI_TDC_PARENT_PROJ")
+ Long getHbmParentProjectId() {
+ return m_parentProjectId;
+ }
+
+ /**
+ * JPA mutator for ID of parent Project.
+ *
+ * @param projectId The parent Project ID.
+ */
+ void setHbmParentProjectId(Long projectId) {
+ m_parentProjectId = projectId;
}
/**
@@ -520,4 +549,23 @@ class TestDataCubePO implements ITestDataCubePO {
.removeParamNamePO(desc.getUniqueId());
}
}
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @ManyToOne(targetEntity = TestDataCategoryPO.class)
+ @JoinColumn(name = "FK_PARENT", insertable = false,
+ updatable = false)
+ public ITestDataCategoryPO getParent() {
+ return m_parent;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void setParent(ITestDataCategoryPO parent) {
+ m_parent = parent;
+ }
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
index f62aba738..e7393245b 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
@@ -38,7 +38,7 @@ import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
import org.eclipse.jubula.client.core.model.ITcParamDescriptionPO;
-import org.eclipse.jubula.client.core.model.ITestDataCubeContPO;
+import org.eclipse.jubula.client.core.model.ITestDataCategoryPO;
import org.eclipse.jubula.tools.constants.StringConstants;
import org.eclipse.jubula.tools.exception.Assert;
import org.eclipse.jubula.tools.exception.JBFatalAbortException;
@@ -205,10 +205,10 @@ public class EditSupport {
((ITcParamDescriptionPO)desc)
.setParamNameMapper(m_paramMapper);
}
- } else if (m_workVersion instanceof ITestDataCubeContPO) {
+ } else if (m_workVersion instanceof ITestDataCategoryPO) {
for (IParameterInterfacePO pio
- : ((ITestDataCubeContPO)m_workVersion)
- .getTestDataCubeList()) {
+ : ((ITestDataCategoryPO)m_workVersion)
+ .getTestDataChildren()) {
List<IParamDescriptionPO> params = pio.getParameterList();
for (IParamDescriptionPO desc : params) {
((ITcParamDescriptionPO)desc)
@@ -259,7 +259,7 @@ public class EditSupport {
try {
boolean mayModifyParamNames =
m_workVersion instanceof ISpecTestCasePO
- || m_workVersion instanceof ITestDataCubeContPO;
+ || m_workVersion instanceof ITestDataCategoryPO;
if (mayModifyParamNames) {
saveParamNames();
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
index 4237f4ed6..36cfbfcec 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/ProjectPM.java
@@ -603,7 +603,6 @@ public class ProjectPM extends PersistenceManager {
List nodes = preloadDataPerClass(s, projectIds, "NodePO");
preloadDataPerClass(s, projectIds, "SpecObjContPO");
preloadDataPerClass(s, projectIds, "ExecObjContPO");
- preloadDataPerClass(s, projectIds, "TestDataCubeContPO");
preloadDataPerClass(s, projectIds, "ObjectMappingAssoziationPO");
preloadDataPerClass(s, projectIds, "ParamDescriptionPO");

Back to the top