You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mb...@apache.org on 2024/11/12 20:12:54 UTC
(db-jdo) branch main updated: JDO-844: Add SampleReadQuery test methods with variables of type String (#97)
This is an automated email from the ASF dual-hosted git repository.
mbo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/db-jdo.git
The following commit(s) were added to refs/heads/main by this push:
new a7bd0893 JDO-844: Add SampleReadQuery test methods with variables of type String (#97)
a7bd0893 is described below
commit a7bd0893cc6256a4a9f63abaf944c472061d73e6
Author: Michael Bouschen <mb...@apache.org>
AuthorDate: Tue Nov 12 21:12:45 2024 +0100
JDO-844: Add SampleReadQuery test methods with variables of type String (#97)
* JDO-844: Add SampleReadQuery test methods with variables of type String
* JDO-844: added code review comments from Tilmann
---
.../jdo/tck/api/fetchgroup/FetchGroupTest.java | 18 +-
.../PMsCanSharePCClassesButNotPCInstances.java | 2 +-
.../org/apache/jdo/tck/pc/company/IPerson.java | 5 +
.../org/apache/jdo/tck/pc/company/PIPerson.java | 5 +
.../java/org/apache/jdo/tck/pc/company/Person.java | 26 +-
.../jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java | 26 ++
.../jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java | 30 +-
.../tck/pc/companyAnnotatedJPA/JPAAppPerson.java | 32 +-
.../jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java | 22 +
.../jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java | 22 +
.../jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java | 7 +
.../jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java | 7 +
.../jdo/tck/query/api/SampleModifyQueries.java | 2 +-
.../jdo/tck/query/api/SampleReadQueries.java | 477 ++++++++++++++++++++-
.../apache/jdo/tck/pc/company/jdoTest.properties | 1 +
.../org/apache/jdo/tck/pc/company/package.jdo | 6 +
.../apache/jdo/tck/pc/company/jdoTest.properties | 1 +
.../org/apache/jdo/tck/pc/company/package.jdo | 6 +
.../apache/jdo/tck/pc/company/package-standard.orm | 8 +
.../jdo/tck/pc/company/package-standard1.orm | 4 +
.../jdo/tck/pc/company/package-standard2.orm | 12 +
.../jdo/tck/pc/company/package-standard3.orm | 4 +
.../jdo/tck/pc/company/package-standard4.orm | 4 +
.../apache/jdo/tck/pc/company/package-standard.orm | 8 +
.../jdo/tck/pc/company/package-standard1.orm | 4 +
.../jdo/tck/pc/company/package-standard2.orm | 12 +
.../jdo/tck/pc/company/package-standard3.orm | 4 +
.../jdo/tck/pc/company/package-standard4.orm | 4 +
.../sql/derby/applicationidentity/schema.sql | 6 +
.../sql/derby/applicationidentity/schema1.sql | 8 +-
.../sql/derby/applicationidentity/schema11.sql | 8 +-
.../sql/derby/applicationidentity/schema2.sql | 20 +-
.../sql/derby/applicationidentity/schema3.sql | 8 +-
.../sql/derby/applicationidentity/schema4.sql | 8 +-
.../sql/derby/datastoreidentity/schema.sql | 8 +-
.../sql/derby/datastoreidentity/schema1.sql | 10 +-
.../sql/derby/datastoreidentity/schema11.sql | 8 +-
.../sql/derby/datastoreidentity/schema2.sql | 26 +-
.../sql/derby/datastoreidentity/schema3.sql | 8 +
.../sql/derby/datastoreidentity/schema4.sql | 10 +-
.../tck/pc/company/companyForSampleQueriesTest.xml | 31 ++
41 files changed, 890 insertions(+), 28 deletions(-)
diff --git a/tck/src/main/java/org/apache/jdo/tck/api/fetchgroup/FetchGroupTest.java b/tck/src/main/java/org/apache/jdo/tck/api/fetchgroup/FetchGroupTest.java
index ccb88201..2133d60e 100644
--- a/tck/src/main/java/org/apache/jdo/tck/api/fetchgroup/FetchGroupTest.java
+++ b/tck/src/main/java/org/apache/jdo/tck/api/fetchgroup/FetchGroupTest.java
@@ -93,7 +93,8 @@ public class FetchGroupTest extends JDO_Test {
"middlename",
"birthdate",
"address",
- "phoneNumbers"
+ "phoneNumbers",
+ "languages"
};
/** Address address is of type Address and is a relationship */
protected final String[] relationshipMembers =
@@ -112,9 +113,11 @@ public class FetchGroupTest extends JDO_Test {
"hradvisees",
"address"
};
- /** Map phoneNumbers is not a relationship but is multivalued */
+ /** Map phoneNumbers and set languages are not relationships but are multivalued */
protected final String[] multivaluedMembers =
- new String[] {"reviewedProjects", "projects", "team", "hradvisees", "phoneNumbers"};
+ new String[] {
+ "reviewedProjects", "projects", "team", "hradvisees", "phoneNumbers", "languages"
+ };
protected final String[] allButMultivaluedMembers =
new String[] {
@@ -336,16 +339,21 @@ public class FetchGroupTest extends JDO_Test {
Set<String> expectedSet = new HashSet<>();
expectedSet.addAll(Arrays.asList(basicMembers));
expectedSet.add("phoneNumbers");
+ expectedSet.add("languages");
Assertions.assertEquals(
expectedSet,
members,
- "FetchGroup should contain basic members " + "plus address plus phoneNumbers.\n");
+ "FetchGroup should contain basic members "
+ + "plus address plus phoneNumbers and languages.\n");
fg.removeMembers(basicMembers);
members = fg.getMembers();
expectedSet = new HashSet<>();
expectedSet.add("phoneNumbers");
+ expectedSet.add("languages");
Assertions.assertEquals(
- expectedSet, members, "FetchGroup should contain address plus phoneNumbers.\n");
+ expectedSet,
+ members,
+ "FetchGroup should contain address plus phoneNumbers and languages.\n");
}
@SuppressWarnings("unchecked")
diff --git a/tck/src/main/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java b/tck/src/main/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java
index a5328b95..1cfd8045 100644
--- a/tck/src/main/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java
+++ b/tck/src/main/java/org/apache/jdo/tck/lifecycle/PMsCanSharePCClassesButNotPCInstances.java
@@ -110,7 +110,7 @@ public class PMsCanSharePCClassesButNotPCInstances extends JDO_Test {
while (!attemptsComplete()) {
try {
- Thread.sleep(100);
+ Thread.sleep(200);
} catch (InterruptedException ex) {
logger.debug("interrupted while waiting for threads to insert");
}
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/IPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/IPerson.java
index 278d5ebc..b3f8a712 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/company/IPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/IPerson.java
@@ -19,6 +19,7 @@ package org.apache.jdo.tck.pc.company;
import java.util.Date;
import java.util.Map;
+import java.util.Set;
/**
* This interface represents the persistent state of Person. Javadoc was deliberately omitted
@@ -40,6 +41,8 @@ public interface IPerson {
Map<String, String> getPhoneNumbers();
+ Set<String> getLanguages();
+
void setPersonid(long personid);
void setLastname(String lastname);
@@ -53,4 +56,6 @@ public interface IPerson {
void setBirthdate(Date birthdate);
void setPhoneNumbers(Map<String, String> phoneNumbers);
+
+ void setLanguages(Set<String> languages);
}
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/PIPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/PIPerson.java
index a8e0fca7..b2445235 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/company/PIPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/PIPerson.java
@@ -19,6 +19,7 @@ package org.apache.jdo.tck.pc.company;
import java.util.Date;
import java.util.Map;
+import java.util.Set;
/**
* This interface represents the persistent state of Person. Javadoc was deliberately omitted
@@ -40,6 +41,8 @@ public interface PIPerson extends IPerson {
Map<String, String> getPhoneNumbers();
+ Set<String> getLanguages();
+
void setPersonid(long personid);
void setLastname(String lastname);
@@ -53,4 +56,6 @@ public interface PIPerson extends IPerson {
void setBirthdate(Date birthdate);
void setPhoneNumbers(Map<String, String> phoneNumbers);
+
+ void setLanguages(Set<String> languages);
}
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java b/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java
index 903696e9..7f3ee001 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/company/Person.java
@@ -22,7 +22,9 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.PersistenceCapable;
import org.apache.jdo.tck.util.DeepEquality;
import org.apache.jdo.tck.util.EqualityHelper;
@@ -46,6 +48,8 @@ public class Person
// to phone numbers specified as String
private Map<String, String> phoneNumbers = new HashMap<>();
+ private Set<String> languages = new HashSet<>();
+
/** This is the JDO-required no-args constructor. */
protected Person() {}
@@ -261,6 +265,24 @@ public class Person
this.phoneNumbers = (phoneNumbers != null) ? new HashMap<>(phoneNumbers) : null;
}
+ /**
+ * Get the set of languages as an unmodifiable set.
+ *
+ * @return The set of languages, as an unmodifiable set.
+ */
+ public Set<String> getLanguages() {
+ return Collections.unmodifiableSet(languages);
+ }
+
+ /**
+ * Set the languages set to be in this person.
+ *
+ * @param languages The set of languages for this person.
+ */
+ public void setLanguages(Set<String> languages) {
+ this.languages = new HashSet(languages);
+ }
+
/**
* Returns a String representation of a <code>Person</code> object.
*
@@ -282,6 +304,7 @@ public class Person
rc.append(", ").append(firstname);
rc.append(", born ").append(JDOCustomDateEditor.getDateRepr(birthdate));
rc.append(", phone ").append(phoneNumbers);
+ rc.append(", languages ").append(languages);
return rc.toString();
}
@@ -304,7 +327,8 @@ public class Person
& helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename")
& helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate")
& helper.deepEquals(address, otherPerson.getAddress(), where + ".address")
- & helper.deepEquals(phoneNumbers, otherPerson.getPhoneNumbers(), where + ".phoneNumbers");
+ & helper.deepEquals(phoneNumbers, otherPerson.getPhoneNumbers(), where + ".phoneNumbers")
+ & helper.deepEquals(languages, otherPerson.getLanguages(), where + ".languages");
}
/**
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java
index 40294e84..e4b7f889 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCAppPerson.java
@@ -22,8 +22,11 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.Column;
+import javax.jdo.annotations.Element;
import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
@@ -86,6 +89,11 @@ public class FCAppPerson
@Value(types = java.lang.String.class, column = "PHONENO")
private Map<String, String> phoneNumbers = new HashMap<>();
+ @Persistent(table = "employee_languages")
+ @Join(column = "EMPID")
+ @Element(types = java.lang.String.class, column = "LANGUAGE")
+ private Set<String> languages = new HashSet<>();
+
/** This is the JDO-required no-args constructor. */
protected FCAppPerson() {}
@@ -301,6 +309,24 @@ public class FCAppPerson
this.phoneNumbers = (phoneNumbers != null) ? new HashMap<>(phoneNumbers) : null;
}
+ /**
+ * Get the map of languages as an unmodifiable Set.
+ *
+ * @return The set of languages, as an unmodifiable set.
+ */
+ public Set<String> getLanguages() {
+ return Collections.unmodifiableSet(languages);
+ }
+
+ /**
+ * Set the languages set to be in this person.
+ *
+ * @param languages The map of phoneNumbers for this person.
+ */
+ public void setLanguages(Set<String> languages) {
+ this.languages = new HashSet(languages);
+ }
+
/**
* Returns a String representation of a <code>FCAppPerson</code> object.
*
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java
index 232835c2..b071a1e0 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedFC/FCDSPerson.java
@@ -22,8 +22,11 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.Column;
+import javax.jdo.annotations.Element;
import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.Join;
import javax.jdo.annotations.Key;
@@ -82,6 +85,11 @@ public class FCDSPerson
@Value(types = java.lang.String.class, column = "PHONENO")
private Map<String, String> phoneNumbers = new HashMap<>();
+ @Persistent(table = "employee_languages")
+ @Join(column = "EMPID")
+ @Element(types = java.lang.String.class, column = "LANGUAGE")
+ private Set<String> languages = new HashSet<>();
+
/** This is the JDO-required no-args constructor. */
protected FCDSPerson() {}
@@ -297,6 +305,24 @@ public class FCDSPerson
this.phoneNumbers = (phoneNumbers != null) ? new HashMap<>(phoneNumbers) : null;
}
+ /**
+ * Get the map of languages as an unmodifiable Set.
+ *
+ * @return The set of languages, as an unmodifiable set.
+ */
+ public Set<String> getLanguages() {
+ return Collections.unmodifiableSet(languages);
+ }
+
+ /**
+ * Set the languages set to be in this person.
+ *
+ * @param languages The map of phoneNumbers for this person.
+ */
+ public void setLanguages(Set<String> languages) {
+ this.languages = new HashSet(languages);
+ }
+
/**
* Returns a String representation of a <code>FCDSPerson</code> object.
*
@@ -318,6 +344,7 @@ public class FCDSPerson
rc.append(", ").append(firstname);
rc.append(", born ").append(JDOCustomDateEditor.getDateRepr(birthdate));
rc.append(", phone ").append(phoneNumbers);
+ rc.append(", languages ").append(languages);
return rc.toString();
}
@@ -340,7 +367,8 @@ public class FCDSPerson
& helper.equals(middlename, otherPerson.getMiddlename(), where + ".middlename")
& helper.equals(birthdate, otherPerson.getBirthdate(), where + ".birthdate")
& helper.deepEquals(address, otherPerson.getAddress(), where + ".address")
- & helper.deepEquals(phoneNumbers, otherPerson.getPhoneNumbers(), where + ".phoneNumbers");
+ & helper.deepEquals(phoneNumbers, otherPerson.getPhoneNumbers(), where + ".phoneNumbers")
+ & helper.deepEquals(languages, otherPerson.getLanguages(), where + ".languages");
}
/**
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
index 004154b2..7b604d10 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedJPA/JPAAppPerson.java
@@ -18,17 +18,22 @@
package org.apache.jdo.tck.pc.companyAnnotatedJPA;
import java.io.Serializable;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
+import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
+import javax.persistence.ElementCollection;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
@@ -36,6 +41,7 @@ import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
+import javax.persistence.JoinColumn;
import javax.persistence.MapKey;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@@ -90,6 +96,10 @@ public class JPAAppPerson
@MapKey(name = "type")
private Map<String, JPAAppPhoneNumber> phoneNumbers = new HashMap<>();
+ @ElementCollection
+ @CollectionTable(name = "employee_languages", joinColumns = @JoinColumn(name = "EMPID"))
+ private Set<String> languages = new HashSet<>();
+
/** This is the JDO-required no-args constructor. */
protected JPAAppPerson() {}
@@ -305,6 +315,24 @@ public class JPAAppPerson
this.phoneNumbers = (phoneNumbers != null) ? convertString2Phone(phoneNumbers) : null;
}
+ /**
+ * Get the map of languages as an unmodifiable Set.
+ *
+ * @return The set of languages, as an unmodifiable set.
+ */
+ public Set<String> getLanguages() {
+ return Collections.unmodifiableSet(languages);
+ }
+
+ /**
+ * Set the languages set to be in this person.
+ *
+ * @param languages The map of phoneNumbers for this person.
+ */
+ public void setLanguages(Set<String> languages) {
+ this.languages = new HashSet(languages);
+ }
+
/**
* Converts HashMap of String, String to HashMap of String, JPAAppPhoneNmber
*
@@ -360,6 +388,7 @@ public class JPAAppPerson
rc.append(", ").append(firstname);
rc.append(", born ").append(JDOCustomDateEditor.getDateRepr(birthdate));
rc.append(", phone ").append(convertPhone2String(phoneNumbers));
+ rc.append(", languages ").append(languages);
return rc.toString();
}
@@ -385,7 +414,8 @@ public class JPAAppPerson
& helper.deepEquals(
convertPhone2String(phoneNumbers),
otherPerson.getPhoneNumbers(),
- where + ".phoneNumbers");
+ where + ".phoneNumbers")
+ & helper.deepEquals(languages, otherPerson.getLanguages(), where + ".languages");
}
/**
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java
index f7f6c1fd..f873d9f0 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCAppPerson.java
@@ -18,10 +18,13 @@
package org.apache.jdo.tck.pc.companyAnnotatedPC;
import java.io.Serializable;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.Discriminator;
import javax.jdo.annotations.DiscriminatorStrategy;
@@ -62,6 +65,7 @@ public class PCAppPerson
@NotPersistent() private Date _birthdate;
@NotPersistent() private PCAppAddress _address;
@NotPersistent() private Map<String, String> _phoneNumbers = new HashMap<>();
+ @NotPersistent() private Set<String> _languages = new HashSet<>();
/** This is the JDO-required no-args constructor. */
protected PCAppPerson() {}
@@ -294,6 +298,24 @@ public class PCAppPerson
this._phoneNumbers = (phoneNumbers != null) ? new HashMap<>(phoneNumbers) : null;
}
+ /**
+ * Get the map of languages as an unmodifiable Set.
+ *
+ * @return The set of languages, as an unmodifiable set.
+ */
+ public Set<String> getLanguages() {
+ return Collections.unmodifiableSet(_languages);
+ }
+
+ /**
+ * Set the languages set to be in this person.
+ *
+ * @param languages The set of languages for this person.
+ */
+ public void setLanguages(Set<String> languages) {
+ this._languages = new HashSet(languages);
+ }
+
/**
* Returns a String representation of a <code>PCAppPerson</code> object.
*
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java
index 5298d8fc..5e52c852 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPC/PCDSPerson.java
@@ -18,10 +18,13 @@
package org.apache.jdo.tck.pc.companyAnnotatedPC;
import java.io.Serializable;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.DatastoreIdentity;
import javax.jdo.annotations.Discriminator;
@@ -63,6 +66,7 @@ public class PCDSPerson
@NotPersistent() private Date _birthdate;
@NotPersistent() private PCDSAddress _address;
@NotPersistent() private Map<String, String> _phoneNumbers = new HashMap<>();
+ @NotPersistent() private Set<String> _languages = new HashSet<>();
/** This is the JDO-required no-args constructor. */
protected PCDSPerson() {}
@@ -294,6 +298,24 @@ public class PCDSPerson
this._phoneNumbers = (phoneNumbers != null) ? new HashMap<>(phoneNumbers) : null;
}
+ /**
+ * Get the map of languages as an unmodifiable Set.
+ *
+ * @return The set of languages, as an unmodifiable set.
+ */
+ public Set<String> getLanguages() {
+ return Collections.unmodifiableSet(_languages);
+ }
+
+ /**
+ * Set the languages set to be in this person.
+ *
+ * @param languages The map of phoneNumbers for this person.
+ */
+ public void setLanguages(Set<String> languages) {
+ this._languages = new HashSet(languages);
+ }
+
/**
* Returns a String representation of a <code>PCDSPerson</code> object.
*
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java
index 952bb678..a7906286 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIAppPerson.java
@@ -19,9 +19,11 @@ package org.apache.jdo.tck.pc.companyAnnotatedPI;
import java.util.Date;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.Discriminator;
import javax.jdo.annotations.DiscriminatorStrategy;
+import javax.jdo.annotations.Element;
import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Inheritance;
@@ -85,6 +87,11 @@ public interface PIAppPerson extends IPerson {
@Value(types = java.lang.String.class, column = "PHONENO")
Map<String, String> getPhoneNumbers();
+ @Persistent(persistenceModifier = PersistenceModifier.PERSISTENT, table = "employee_languages")
+ @Join(column = "EMPID")
+ @Element(types = java.lang.String.class, column = "LANGUAGE")
+ Set<String> getLanguages();
+
void setPersonid(long personid);
void setLastname(String lastname);
diff --git a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java
index 874ff845..fd8fec25 100644
--- a/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java
+++ b/tck/src/main/java/org/apache/jdo/tck/pc/companyAnnotatedPI/PIDSPerson.java
@@ -19,10 +19,12 @@ package org.apache.jdo.tck.pc.companyAnnotatedPI;
import java.util.Date;
import java.util.Map;
+import java.util.Set;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.DatastoreIdentity;
import javax.jdo.annotations.Discriminator;
import javax.jdo.annotations.DiscriminatorStrategy;
+import javax.jdo.annotations.Element;
import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Inheritance;
@@ -83,6 +85,11 @@ public interface PIDSPerson extends IPerson {
@Value(types = java.lang.String.class, column = "PHONENO")
Map<String, String> getPhoneNumbers();
+ @Persistent(table = "employee_languages")
+ @Join(column = "EMPID")
+ @Element(types = java.lang.String.class, column = "LANGUAGE")
+ Set<String> getLanguages();
+
void setPersonid(long personid);
void setLastname(String lastname);
diff --git a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java
index 4f37ffa5..8e9b6a09 100644
--- a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java
+++ b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleModifyQueries.java
@@ -46,7 +46,7 @@ public class SampleModifyQueries extends QueryTest {
* <p>This query deletes all Employees who make more than the parameter salary.
*/
@Test
- public void testQuery20() {
+ public void testQuery23() {
Transaction tx = pm.currentTransaction();
try {
tx.begin();
diff --git a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java
index 297b5378..d46e7e41 100644
--- a/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java
+++ b/tck/src/main/java/org/apache/jdo/tck/query/api/SampleReadQueries.java
@@ -27,6 +27,7 @@ import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.jdo.Transaction;
import javax.jdo.query.CollectionExpression;
+import javax.jdo.query.Expression;
import javax.jdo.query.NumericExpression;
import javax.jdo.query.StringExpression;
import org.apache.jdo.tck.pc.company.CompanyModelReader;
@@ -53,14 +54,18 @@ import org.junit.jupiter.api.parallel.ExecutionMode;
* <B>Assertion Description: </B> This test class runs the example read queries from the JDO
* specification.
*
- * <p>There are up to six test methods per test case: testQueryxxa: runtime constructed JDO query
- * using execute to run the query testQueryxxb: runtime constructed JDO query using
- * setNamedParameters to specify the parameter values and
- * executeList/executeResultList/executeResultUnique to run the query testQueryxxc: runtime
- * constructed JDO query using setParameters to specify the parameter values and
- * executeList/executeResultList/executeResultUnique to run the query testQueryxxd: single string
- * version of the JDO query testQueryxxe: named query version of the JDO query testQueryxxf:
- * JDOQLTypedQuery version
+ * <p>There are up to six test methods per test case:
+ *
+ * <ul>
+ * <li>testQueryxxa: runtime constructed JDO query using execute to run the query
+ * <li>testQueryxxb: runtime constructed JDO query using setNamedParameters to specify the
+ * parameter values and executeList/executeResultList/executeResultUnique to run the query
+ * <li>testQueryxxc: runtime constructed JDO query using setParameters to specify the parameter
+ * values and executeList/executeResultList/executeResultUnique to run the query
+ * <li>testQueryxxd: single string version of the JDO query
+ * <li>testQueryxxe: named query version of the JDO query
+ * <li>testQueryxxf: JDOQLTypedQuery version
+ * </ul>
*/
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class SampleReadQueries extends QueryTest {
@@ -146,6 +151,18 @@ public class SampleReadQueries extends QueryTest {
+ "where this.weeklyhours > "
+ " (select AVG(e.weeklyhours) from this.department.employees e where e.manager == this.manager)";
+ private static final String SINGLE_STRING_QUERY_20 =
+ "select from org.apache.jdo.tck.pc.company.FullTimeEmployee "
+ + "where languages.contains(lang) && lang == 'German' variables String lang";
+
+ private static final String SINGLE_STRING_QUERY_21 =
+ "select from org.apache.jdo.tck.pc.company.FullTimeEmployee "
+ + "where phoneNumbers.containsKey(key) && key == 'home' variables String key";
+
+ private static final String SINGLE_STRING_QUERY_22 =
+ "select from org.apache.jdo.tck.pc.company.FullTimeEmployee "
+ + "where phoneNumbers.containsValue(value) && value == '1111' variables String value";
+
/**
* Basic query.
*
@@ -3031,6 +3048,450 @@ public class SampleReadQueries extends QueryTest {
}
}
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection speaking
+ * German (i.e. the language set includes the string "German").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery20a() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp5");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(FullTimeEmployee.class, "languages.contains(lang) && lang == 'German'")) {
+ q.declareVariables("String lang");
+ List<FullTimeEmployee> emps = (List<FullTimeEmployee>) q.execute();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_20, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection speaking
+ * German (i.e. the language set includes the string "German").
+ */
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery20b() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp5");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(FullTimeEmployee.class, "languages.contains(lang) && lang == 'German'")) {
+ q.declareVariables("String lang");
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_20, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection speaking
+ * German (i.e. the language set includes the string "German").
+ */
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery20c() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp5");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(FullTimeEmployee.class, "languages.contains(lang) && lang == 'German'")) {
+ q.declareVariables("String lang");
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_20, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection speaking
+ * German (i.e. the language set includes the string "German").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery20d() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp5");
+ try (Query<FullTimeEmployee> q = pm.newQuery(SINGLE_STRING_QUERY_20)) {
+ List<FullTimeEmployee> emps = (List<FullTimeEmployee>) q.execute();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_20, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection speaking
+ * German (i.e. the language set includes the string "German").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery20f() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp5");
+ try (JDOQLTypedQuery<FullTimeEmployee> q = pm.newJDOQLTypedQuery(FullTimeEmployee.class)) {
+ QFullTimeEmployee cand = QFullTimeEmployee.candidate("this");
+ Expression<String> lang = q.variable("lang", String.class);
+ q.filter(cand.languages.contains(lang).and(lang.eq("German")));
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_20, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * home phone number (i.e. the phoneNumbers map includes an entry with key "home").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery21a() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp2", "emp5");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(FullTimeEmployee.class, "phoneNumbers.containsKey(key) && key == 'home'")) {
+ q.declareVariables("String key");
+ List<FullTimeEmployee> emps = (List<FullTimeEmployee>) q.execute();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_21, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * home phone number (i.e. the phoneNumbers map includes an entry with key "home").
+ */
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery21b() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp2", "emp5");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(FullTimeEmployee.class, "phoneNumbers.containsKey(key) && key == 'home'")) {
+ q.declareVariables("String key");
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_21, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * home phone number (i.e. the phoneNumbers map includes an entry with key "home").
+ */
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery21c() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp2", "emp5");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(FullTimeEmployee.class, "phoneNumbers.containsKey(key) && key == 'home'")) {
+ q.declareVariables("String key");
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_21, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * home phone number (i.e. the phoneNumbers map includes an entry with key "home").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery21d() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp2", "emp5");
+ try (Query<FullTimeEmployee> q = pm.newQuery(SINGLE_STRING_QUERY_21)) {
+ List<FullTimeEmployee> emps = (List<FullTimeEmployee>) q.execute();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_21, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * home phone number (i.e. the phoneNumbers map includes an entry with key "home").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery21f() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1", "emp2", "emp5");
+ try (JDOQLTypedQuery<FullTimeEmployee> q = pm.newJDOQLTypedQuery(FullTimeEmployee.class)) {
+ QFullTimeEmployee cand = QFullTimeEmployee.candidate("this");
+ Expression<String> key = q.variable("key", String.class);
+ q.filter(cand.phoneNumbers.containsKey(key).and(key.eq("home")));
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_21, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * phone number "1111" (i.e. the phoneNumbers map includes an entry with value "1111").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery22a() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(
+ FullTimeEmployee.class, "phoneNumbers.containsValue(value) && value == '1111'")) {
+ q.declareVariables("String value");
+ List<FullTimeEmployee> emps = (List<FullTimeEmployee>) q.execute();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_22, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * phone number "1111" (i.e. the phoneNumbers map includes an entry with value "1111").
+ */
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery22b() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(
+ FullTimeEmployee.class, "phoneNumbers.containsValue(value) && value == '1111'")) {
+ q.declareVariables("String value");
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_22, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * phone number "1111" (i.e. the phoneNumbers map includes an entry with value "1111").
+ */
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery22c() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1");
+ try (Query<FullTimeEmployee> q =
+ pm.newQuery(
+ FullTimeEmployee.class, "phoneNumbers.containsValue(value) && value == '1111'")) {
+ q.declareVariables("String value");
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_22, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * phone number "1111" (i.e. the phoneNumbers map includes an entry with value "1111").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery22d() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1");
+ try (Query<FullTimeEmployee> q = pm.newQuery(SINGLE_STRING_QUERY_22)) {
+ List<FullTimeEmployee> emps = (List<FullTimeEmployee>) q.execute();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_22, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
+ /**
+ * Navigation through multi-valued field.
+ *
+ * <p>This query selects all FullTimeEmployee instances from the candidate collection having a
+ * phone number "1111" (i.e. the phoneNumbers map includes an entry with value "1111").
+ */
+ @SuppressWarnings("unchecked")
+ @Test
+ @Execution(ExecutionMode.CONCURRENT)
+ public void testQuery22f() {
+ PersistenceManager pm = getPMF().getPersistenceManager();
+ Transaction tx = pm.currentTransaction();
+ try {
+ tx.begin();
+ List<FullTimeEmployee> expected =
+ getTransientCompanyModelInstancesAsList(FullTimeEmployee.class, "emp1");
+ try (JDOQLTypedQuery<FullTimeEmployee> q = pm.newJDOQLTypedQuery(FullTimeEmployee.class)) {
+ QFullTimeEmployee cand = QFullTimeEmployee.candidate("this");
+ Expression<String> value = q.variable("value", String.class);
+ q.filter(cand.phoneNumbers.containsValue(value).and(value.eq("1111")));
+ List<FullTimeEmployee> emps = q.executeList();
+ checkQueryResultWithoutOrder(ASSERTION_FAILED, SINGLE_STRING_QUERY_22, emps, expected);
+ } catch (Exception ex) {
+ fail(ASSERTION_FAILED, ex.getLocalizedMessage());
+ }
+ tx.commit();
+ } finally {
+ cleanupPM(pm);
+ }
+ }
+
private List<Info> testQuery08Helper() {
Info info1 = new Info();
info1.firstname = "Michael";
diff --git a/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/jdoTest.properties b/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/jdoTest.properties
index 0a4263be..ad5edbd5 100644
--- a/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/jdoTest.properties
+++ b/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/jdoTest.properties
@@ -90,6 +90,7 @@ org.apache.jdo.tck.pc.company.Person#lastname=jdo:persistent,annotation:dfg
org.apache.jdo.tck.pc.company.Person#middlename=jdo:persistent,annotation:mediated
org.apache.jdo.tck.pc.company.Person#personid=jdo:persistent,annotation:key
org.apache.jdo.tck.pc.company.Person#phoneNumbers=jdo:persistent,annotation:mediated
+org.apache.jdo.tck.pc.company.Person#languages=jdo:persistent,annotation:mediated
org.apache.jdo.tck.pc.company.Project=jdo:persistent,oid:org.apache.jdo.tck.pc.company.Project$Oid
org.apache.jdo.tck.pc.company.Project#budget=jdo:persistent,annotation:dfg
diff --git a/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo b/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
index d2d0f7bf..9271e0d0 100644
--- a/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
+++ b/tck/src/main/resources/jdo/applicationidentity/org/apache/jdo/tck/pc/company/package.jdo
@@ -131,6 +131,9 @@ has application identity.
<field name="phoneNumbers" persistence-modifier="persistent">
<map key-type="String" value-type="String"/>
</field>
+ <field name="languages" persistence-modifier="persistent">
+ <collection element-type="java.lang.String"/>
+ </field>
<query name="validNotUnique">
SELECT firstname, lastname
INTO org.apache.jdo.tck.query.result.classes.FullName
@@ -275,6 +278,9 @@ has application identity.
<property name="phoneNumbers" persistence-modifier="persistent">
<map key-type="String" value-type="String"/>
</property>
+ <property name="languages" persistence-modifier="persistent">
+ <collection element-type="java.lang.String"/>
+ </property>
<query name="validNotUnique">
SELECT firstname, lastname
INTO org.apache.jdo.tck.query.result.classes.FullName
diff --git a/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/jdoTest.properties b/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/jdoTest.properties
index 68064d3b..cd6bb91e 100644
--- a/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/jdoTest.properties
+++ b/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/jdoTest.properties
@@ -90,6 +90,7 @@ org.apache.jdo.tck.pc.company.Person#lastname=jdo:persistent,annotation:dfg
org.apache.jdo.tck.pc.company.Person#middlename=jdo:persistent,annotation:mediated
org.apache.jdo.tck.pc.company.Person#personid=jdo:persistent,annotation:dfg
org.apache.jdo.tck.pc.company.Person#phoneNumbers=jdo:persistent,annotation:mediated
+org.apache.jdo.tck.pc.company.Person#languages=jdo:persistent,annotation:mediated
org.apache.jdo.tck.pc.company.Project=jdo:persistent
org.apache.jdo.tck.pc.company.Project#budget=jdo:persistent,annotation:dfg
diff --git a/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo b/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo
index 73a1e8b8..9e21bf3e 100644
--- a/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo
+++ b/tck/src/main/resources/jdo/datastoreidentity/org/apache/jdo/tck/pc/company/package.jdo
@@ -106,6 +106,9 @@ has datastore identity.
<field name="phoneNumbers" persistence-modifier="persistent">
<map key-type="String" value-type="String"/>
</field>
+ <field name="languages" persistence-modifier="persistent">
+ <collection element-type="java.lang.String"/>
+ </field>
<query name="validNotUnique">
SELECT firstname, lastname
INTO org.apache.jdo.tck.query.result.classes.FullName
@@ -241,6 +244,9 @@ has datastore identity.
<property name="phoneNumbers" persistence-modifier="persistent">
<map key-type="String" value-type="String"/>
</property>
+ <property name="languages" persistence-modifier="persistent">
+ <collection element-type="java.lang.String"/>
+ </property>
<query name="validNotUnique">
SELECT firstname, lastname
INTO org.apache.jdo.tck.query.result.classes.FullName
diff --git a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm
index 1cab6670..5558039d 100644
--- a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm
+++ b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard.orm
@@ -150,6 +150,10 @@ has application identity.
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
<query name="packageORM">
SELECT FROM org.apache.jdo.tck.pc.company.Person
WHERE personid > 2
@@ -314,6 +318,10 @@ has application identity.
<key column="TYPE"/>
<value column="PHONENO"/>
</property>
+ <property name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </property>
<query name="packageORM">
SELECT FROM org.apache.jdo.tck.pc.company.Person
WHERE personid > 2
diff --git a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard1.orm b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard1.orm
index 95df78cf..0ad8f621 100644
--- a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard1.orm
+++ b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard1.orm
@@ -133,6 +133,10 @@ Inheritance strategy: new-table for all classes.
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance" table="insuranceplans">
diff --git a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard2.orm b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard2.orm
index 4a1e6035..0c9f119c 100644
--- a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard2.orm
+++ b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard2.orm
@@ -97,6 +97,10 @@ Inheritance strategy:
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="Person.languages" table="parttime_employee_languages" >
+ <join column="EMPID"/>
+ <value column="LANGUAGE"/>
+ </field>
<field name="Employee.hiredate" column="HIREDATE"/>
<field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
<field name="Employee.dentalInsurance" mapped-by="employee"/>
@@ -147,6 +151,10 @@ Inheritance strategy:
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="Person.languages" table="fulltime_employee_languages" >
+ <join column="EMPID"/>
+ <value column="LANGUAGE"/>
+ </field>
<field name="Employee.hiredate" column="HIREDATE"/>
<field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
<field name="Employee.dentalInsurance" mapped-by="employee"/>
@@ -201,6 +209,10 @@ Inheritance strategy:
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance">
diff --git a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard3.orm b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard3.orm
index 870f65c9..71538499 100644
--- a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard3.orm
+++ b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard3.orm
@@ -133,6 +133,10 @@ MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance">
diff --git a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard4.orm b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard4.orm
index 52908894..71ae5987 100644
--- a/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard4.orm
+++ b/tck/src/main/resources/orm/applicationidentity/org/apache/jdo/tck/pc/company/package-standard4.orm
@@ -131,6 +131,10 @@ have inheritance strategy "superclass-table".
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance" table="insuranceplans">
diff --git a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm
index 454de256..4571bdd5 100644
--- a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm
+++ b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard.orm
@@ -156,6 +156,10 @@ has datastore identity.
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
<query name="packageORM">
SELECT FROM org.apache.jdo.tck.pc.company.Person
WHERE personid > 2
@@ -321,6 +325,10 @@ has datastore identity.
<key column="TYPE"/>
<value column="PHONENO"/>
</property>
+ <property name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </property>
<query name="packageORM">
SELECT FROM org.apache.jdo.tck.pc.company.Person
WHERE personid > 2
diff --git a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard1.orm b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard1.orm
index 5db4c134..3d677abc 100644
--- a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard1.orm
+++ b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard1.orm
@@ -140,6 +140,10 @@ Inheritance strategy: new-table for all classes.
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance" table="insuranceplans">
diff --git a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard2.orm b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard2.orm
index 40bd806f..7f63f376 100644
--- a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard2.orm
+++ b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard2.orm
@@ -102,6 +102,10 @@ Inheritance strategy:
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="Person.languages" table="parttime_employee_languages" >
+ <join column="EMPID"/>
+ <value column="LANGUAGE"/>
+ </field>
<field name="Employee.hiredate" column="HIREDATE"/>
<field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
<field name="Employee.dentalInsurance" mapped-by="employee"/>
@@ -157,6 +161,10 @@ Inheritance strategy:
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="fulltime_employee_languages" >
+ <join column="EMPID"/>
+ <value column="LANGUAGE"/>
+ </field>
<field name="Employee.hiredate" column="HIREDATE"/>
<field name="Employee.weeklyhours" column="WEEKLYHOURS"/>
<field name="Employee.dentalInsurance" mapped-by="employee"/>
@@ -216,6 +224,10 @@ Inheritance strategy:
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance">
diff --git a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard3.orm b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard3.orm
index 74a8303e..6c97e05e 100644
--- a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard3.orm
+++ b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard3.orm
@@ -140,6 +140,10 @@ MedicalInsurance and DentalInsurance have inheritance strategy "new-table".
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance" table="insuranceplans">
diff --git a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard4.orm b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard4.orm
index fb0c5013..9632de4b 100644
--- a/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard4.orm
+++ b/tck/src/main/resources/orm/datastoreidentity/org/apache/jdo/tck/pc/company/package-standard4.orm
@@ -138,6 +138,10 @@ have inheritance strategy "superclass-table".
<key column="TYPE"/>
<value column="PHONENO"/>
</field>
+ <field name="languages" table="employee_languages" >
+ <join column="EMPID"/>
+ <element column="LANGUAGE"/>
+ </field>
</class>
<class name="Insurance" table="insuranceplans">
diff --git a/tck/src/main/resources/sql/derby/applicationidentity/schema.sql b/tck/src/main/resources/sql/derby/applicationidentity/schema.sql
index cdbfe4fa..183df4b3 100644
--- a/tck/src/main/resources/sql/derby/applicationidentity/schema.sql
+++ b/tck/src/main/resources/sql/derby/applicationidentity/schema.sql
@@ -292,6 +292,7 @@ DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
DROP TABLE project_member_jpa;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE persons;
DROP TABLE projects;
@@ -407,6 +408,11 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(PROJID);
diff --git a/tck/src/main/resources/sql/derby/applicationidentity/schema1.sql b/tck/src/main/resources/sql/derby/applicationidentity/schema1.sql
index ae2e4f47..07ee5bcd 100644
--- a/tck/src/main/resources/sql/derby/applicationidentity/schema1.sql
+++ b/tck/src/main/resources/sql/derby/applicationidentity/schema1.sql
@@ -38,6 +38,7 @@ DROP TABLE medicalinsurance;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE fulltimeemployees;
DROP TABLE parttimeemployees;
@@ -168,7 +169,12 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(PROJID);
diff --git a/tck/src/main/resources/sql/derby/applicationidentity/schema11.sql b/tck/src/main/resources/sql/derby/applicationidentity/schema11.sql
index 4870505e..8142b632 100644
--- a/tck/src/main/resources/sql/derby/applicationidentity/schema11.sql
+++ b/tck/src/main/resources/sql/derby/applicationidentity/schema11.sql
@@ -37,6 +37,7 @@ ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE persons;
DROP TABLE projects;
@@ -147,7 +148,12 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(PROJID);
diff --git a/tck/src/main/resources/sql/derby/applicationidentity/schema2.sql b/tck/src/main/resources/sql/derby/applicationidentity/schema2.sql
index 3cd94232..b7c60037 100644
--- a/tck/src/main/resources/sql/derby/applicationidentity/schema2.sql
+++ b/tck/src/main/resources/sql/derby/applicationidentity/schema2.sql
@@ -45,6 +45,9 @@ DROP TABLE dentalinsurance;
DROP TABLE medicalinsurance;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
+DROP TABLE fulltime_employee_languages;
+DROP TABLE parttime_employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE fulltime_employee_phoneno_type;
DROP TABLE parttime_employee_phoneno_type;
@@ -202,7 +205,22 @@ CREATE TABLE parttime_employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages(
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+CREATE TABLE fulltime_employee_languages (
+ EMPID INTEGER REFERENCES fulltimeemployees NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+CREATE TABLE parttime_employee_languages (
+ EMPID INTEGER REFERENCES parttimeemployees NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(PROJID);
diff --git a/tck/src/main/resources/sql/derby/applicationidentity/schema3.sql b/tck/src/main/resources/sql/derby/applicationidentity/schema3.sql
index 323a19e2..fa9aa786 100644
--- a/tck/src/main/resources/sql/derby/applicationidentity/schema3.sql
+++ b/tck/src/main/resources/sql/derby/applicationidentity/schema3.sql
@@ -40,6 +40,7 @@ DROP TABLE dentalinsurance;
DROP TABLE medicalinsurance;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE fulltimeemployees;
DROP TABLE parttimeemployees;
@@ -165,7 +166,12 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(PROJID);
diff --git a/tck/src/main/resources/sql/derby/applicationidentity/schema4.sql b/tck/src/main/resources/sql/derby/applicationidentity/schema4.sql
index fea13dbf..0feaf074 100644
--- a/tck/src/main/resources/sql/derby/applicationidentity/schema4.sql
+++ b/tck/src/main/resources/sql/derby/applicationidentity/schema4.sql
@@ -36,6 +36,7 @@ ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE employees;
DROP TABLE persons;
@@ -142,7 +143,12 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(PROJID);
diff --git a/tck/src/main/resources/sql/derby/datastoreidentity/schema.sql b/tck/src/main/resources/sql/derby/datastoreidentity/schema.sql
index a289678a..6ee1db20 100644
--- a/tck/src/main/resources/sql/derby/datastoreidentity/schema.sql
+++ b/tck/src/main/resources/sql/derby/datastoreidentity/schema.sql
@@ -226,6 +226,7 @@ ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE persons;
DROP TABLE projects;
@@ -344,7 +345,12 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects;
diff --git a/tck/src/main/resources/sql/derby/datastoreidentity/schema1.sql b/tck/src/main/resources/sql/derby/datastoreidentity/schema1.sql
index e07bb778..787cec1b 100644
--- a/tck/src/main/resources/sql/derby/datastoreidentity/schema1.sql
+++ b/tck/src/main/resources/sql/derby/datastoreidentity/schema1.sql
@@ -38,6 +38,7 @@ DROP TABLE medicalinsurance;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE fulltimeemployees;
DROP TABLE parttimeemployees;
@@ -197,7 +198,14 @@ CREATE TABLE employee_phoneno_type (
REFERENCES persons (DATASTORE_IDENTITY)
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL,
+ CONSTRAINT employee_languages_EMPID FOREIGN KEY (EMPID)
+ REFERENCES persons (DATASTORE_IDENTITY)
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects(DATASTORE_IDENTITY);
diff --git a/tck/src/main/resources/sql/derby/datastoreidentity/schema11.sql b/tck/src/main/resources/sql/derby/datastoreidentity/schema11.sql
index e30c6473..1b05c925 100644
--- a/tck/src/main/resources/sql/derby/datastoreidentity/schema11.sql
+++ b/tck/src/main/resources/sql/derby/datastoreidentity/schema11.sql
@@ -37,6 +37,7 @@ ALTER TABLE insuranceplans DROP CONSTRAINT INS_EMP_FK;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE persons;
DROP TABLE projects;
@@ -155,7 +156,12 @@ CREATE TABLE employee_phoneno_type (
TYPE VARCHAR(16) NOT NULL
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER REFERENCES persons NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects;
diff --git a/tck/src/main/resources/sql/derby/datastoreidentity/schema2.sql b/tck/src/main/resources/sql/derby/datastoreidentity/schema2.sql
index 6918c0d3..f7c799d0 100644
--- a/tck/src/main/resources/sql/derby/datastoreidentity/schema2.sql
+++ b/tck/src/main/resources/sql/derby/datastoreidentity/schema2.sql
@@ -45,6 +45,9 @@ DROP TABLE dentalinsurance;
DROP TABLE medicalinsurance;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
+DROP TABLE fulltime_employee_languages;
+DROP TABLE parttime_employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE fulltime_employee_phoneno_type;
DROP TABLE parttime_employee_phoneno_type;
@@ -247,7 +250,28 @@ CREATE TABLE parttime_employee_phoneno_type (
REFERENCES parttimeemployees (DATASTORE_IDENTITY)
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL,
+ CONSTRAINT EMP_LANGUAGE_PERSONS FOREIGN KEY (EMPID)
+ REFERENCES persons (DATASTORE_IDENTITY)
+);
+
+CREATE TABLE fulltime_employee_languages (
+ EMPID INTEGER NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL,
+ CONSTRAINT FTEMP_LANGUAGE_FTEMP FOREIGN KEY (EMPID)
+ REFERENCES fulltimeemployees (DATASTORE_IDENTITY)
+);
+
+CREATE TABLE parttime_employee_languages (
+ EMPID INTEGER REFERENCES parttimeemployees NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL,
+ CONSTRAINT PTEMP_LANGUAGE_PTEMP FOREIGN KEY (EMPID)
+ REFERENCES parttimeemployees (DATASTORE_IDENTITY)
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects;
diff --git a/tck/src/main/resources/sql/derby/datastoreidentity/schema3.sql b/tck/src/main/resources/sql/derby/datastoreidentity/schema3.sql
index 63d1a132..478735d9 100644
--- a/tck/src/main/resources/sql/derby/datastoreidentity/schema3.sql
+++ b/tck/src/main/resources/sql/derby/datastoreidentity/schema3.sql
@@ -40,6 +40,7 @@ DROP TABLE dentalinsurance;
DROP TABLE medicalinsurance;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE fulltimeemployees;
DROP TABLE parttimeemployees;
@@ -204,6 +205,13 @@ CREATE TABLE employee_phoneno_type (
REFERENCES persons (DATASTORE_IDENTITY)
);
+CREATE TABLE employee_languages (
+ EMPID INTEGER NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL,
+ CONSTRAINT EMP_LANGUAGE_PERSONS FOREIGN KEY (EMPID)
+ REFERENCES persons (DATASTORE_IDENTITY)
+);
+
ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects;
diff --git a/tck/src/main/resources/sql/derby/datastoreidentity/schema4.sql b/tck/src/main/resources/sql/derby/datastoreidentity/schema4.sql
index af962714..1e960295 100644
--- a/tck/src/main/resources/sql/derby/datastoreidentity/schema4.sql
+++ b/tck/src/main/resources/sql/derby/datastoreidentity/schema4.sql
@@ -36,6 +36,7 @@ ALTER TABLE project_reviewer DROP CONSTRAINT PR_REV_FK;
DROP TABLE insuranceplans;
DROP TABLE project_reviewer;
DROP TABLE project_member;
+DROP TABLE employee_languages;
DROP TABLE employee_phoneno_type;
DROP TABLE employees;
DROP TABLE persons;
@@ -167,7 +168,14 @@ CREATE TABLE employee_phoneno_type (
REFERENCES persons (DATASTORE_IDENTITY)
);
-ALTER TABLE project_reviewer
+CREATE TABLE employee_languages (
+ EMPID INTEGER NOT NULL,
+ LANGUAGE VARCHAR(255) NOT NULL,
+ CONSTRAINT employee_languages_EMPID FOREIGN KEY (EMPID)
+ REFERENCES persons (DATASTORE_IDENTITY)
+);
+
+ALTER TABLE project_reviewer
ADD CONSTRAINT PR_PROJ_FK FOREIGN KEY
(PROJID) REFERENCES projects;
diff --git a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml
index 30187488..82fe4973 100644
--- a/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml
+++ b/tck/src/main/resources/testdata/org/apache/jdo/tck/pc/company/companyForSampleQueriesTest.xml
@@ -143,6 +143,12 @@
<entry key="work"><value>123456-1</value></entry>
</map>
</property>
+ <property name="languages">
+ <set>
+ <value>German</value>
+ <value>English</value>
+ </set>
+ </property>
<property name="department"><ref bean="dept1"/></property>
<property name="fundingDept"><ref bean="dept2"/></property>
<property name="manager"><ref bean="emp2"/></property>
@@ -178,6 +184,12 @@
<entry key="work"><value>123456-2</value></entry>
</map>
</property>
+ <property name="languages">
+ <set>
+ <value>English</value>
+ <value>Japanese</value>
+ </set>
+ </property>
<property name="department"><ref bean="dept1"/></property>
<property name="fundingDept"><ref bean="dept1"/></property>
<property name="mentor"><ref bean="emp3"/></property>
@@ -216,6 +228,12 @@
<entry key="work"><value>123456-3</value></entry>
</map>
</property>
+ <property name="languages">
+ <set>
+ <value>English</value>
+ <value>French</value>
+ </set>
+ </property>
<property name="department"><ref bean="dept1"/></property>
<property name="fundingDept"><ref bean="dept1"/></property>
<property name="manager"><ref bean="emp2"/></property>
@@ -246,6 +264,11 @@
<entry key="work"><value>124456-3</value></entry>
</map>
</property>
+ <property name="languages">
+ <set>
+ <value>English</value>
+ </set>
+ </property>
<property name="department"><ref bean="dept2"/></property>
<property name="fundingDept"><ref bean="dept2"/></property>
<property name="manager"><ref bean="emp2"/></property>
@@ -280,6 +303,14 @@
<entry key="work"><value>126456-3</value></entry>
</map>
</property>
+ <property name="languages">
+ <set>
+ <value>German</value>
+ <value>English</value>
+ <value>French</value>
+ <value>Japanese</value>
+ </set>
+ </property>
<property name="department"><ref bean="dept2"/></property>
<property name="fundingDept"><ref bean="dept2"/></property>
<property name="manager"><ref bean="emp2"/></property>