Author: andyj
Date: Mon Jan 30 08:09:46 2012
New Revision: 1237563
URL: http://svn.apache.org/viewvc?rev=1237563&view=rev
Log:
JDO-702 Apply patch adding tests for embedded inherited objects
Added:
db/jdo/trunk/tck/src/conf/embeddedInheritance.conf
db/jdo/trunk/tck/src/java/org/apache/jdo/tck/models/embedded/EmbeddedInheritance.java
db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/
db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Kitchen.java
db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/MultifunctionOven.java
db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Oven.java
db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/package.html
db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/
db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/package.jdo
db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/
db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/package.jdo
db/jdo/trunk/tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/
db/jdo/trunk/tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
db/jdo/trunk/tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/
db/jdo/trunk/tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
db/jdo/trunk/tck/src/sql/derby/applicationidentity/schema12.sql
db/jdo/trunk/tck/src/sql/derby/datastoreidentity/schema12.sql
Modified:
db/jdo/trunk/tck/src/conf/configurations.list
Modified: db/jdo/trunk/tck/src/conf/configurations.list
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/conf/configurations.list?rev=1237563&r1=1237562&r2=1237563&view=diff
==============================================================================
--- db/jdo/trunk/tck/src/conf/configurations.list (original)
+++ db/jdo/trunk/tck/src/conf/configurations.list Mon Jan 30 08:09:46 2012
@@ -20,6 +20,7 @@ jdo.tck.cfglist = \
pm.conf \
pmf.conf \
detach.conf \
+ embeddedInheritance.conf \
enhancement.conf \
extents.conf \
fetchplan.conf \
Added: db/jdo/trunk/tck/src/conf/embeddedInheritance.conf
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/conf/embeddedInheritance.conf?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/conf/embeddedInheritance.conf (added)
+++ db/jdo/trunk/tck/src/conf/embeddedInheritance.conf Mon Jan 30 08:09:46 2012
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+jdo.tck.description = Detachment tests with standard mapping, no testdata.
+jdo.tck.mapping.companyfactory =
+jdo.tck.testdata =
+jdo.tck.standarddata =
+jdo.tck.mapping = 12
+jdo.tck.classes = \
+ org.apache.jdo.tck.models.embedded.EmbeddedInheritance
+jdo.tck.requiredOptions =
Added: db/jdo/trunk/tck/src/java/org/apache/jdo/tck/models/embedded/EmbeddedInheritance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/java/org/apache/jdo/tck/models/embedded/EmbeddedInheritance.java?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/java/org/apache/jdo/tck/models/embedded/EmbeddedInheritance.java
(added)
+++ db/jdo/trunk/tck/src/java/org/apache/jdo/tck/models/embedded/EmbeddedInheritance.java
Mon Jan 30 08:09:46 2012
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jdo.tck.models.embedded;
+
+import java.util.List;
+
+import javax.jdo.Query;
+
+import org.apache.jdo.tck.JDO_Test;
+
+import org.apache.jdo.tck.pc.building.Kitchen;
+import org.apache.jdo.tck.pc.building.MultifunctionOven;
+import org.apache.jdo.tck.pc.building.Oven;
+import org.apache.jdo.tck.util.BatchTestRunner;
+
+/**
+ * <B>Title:</B> Test EmbeddedInheritance
+ * <BR>
+ * <B>Keywords:</B>
+ * <BR>
+ * <B>Assertion IDs:</B>
+ * <BR>
+ * <B>Assertion Description: </B>
+ */
+public class EmbeddedInheritance extends JDO_Test {
+
+ /** */
+ protected void localSetUp() {
+ addTearDownClass(Kitchen.class);
+ }
+
+ /**
+ * The <code>main</code> is called when the class
+ * is directly executed from the command line.
+ * @param args The arguments passed to the program.
+ */
+ public static void main(String[] args) {
+ BatchTestRunner.run(EmbeddedInheritance.class);
+ }
+
+ /**
+ * Test for basic persistence of object with embedded object which has inheritance
+ * and persisting the base type of the embedded object.
+ */
+ public void testPersistBase() {
+ Object id = null;
+ try {
+ getPM().currentTransaction().begin();
+ Kitchen kitchen1 = new Kitchen(1);
+ Oven oven = new Oven("Westinghouse", "Economy");
+ kitchen1.setOven(oven);
+ getPM().makePersistent(kitchen1);
+ getPM().currentTransaction().commit();
+ id = getPM().getObjectId(kitchen1);
+ }
+ catch (Exception e) {
+ fail("Exception on persist : " + e.getMessage());
+ }
+ finally {
+ if (getPM().currentTransaction().isActive()) {
+ getPM().currentTransaction().rollback();
+ }
+ }
+
+ getPM().currentTransaction().begin();
+ Kitchen kitchen = (Kitchen)getPM().getObjectById(id);
+ assertEquals("Id of object is incorrect", 1, kitchen.getId());
+ Oven oven = kitchen.getOven();
+ assertNotNull("Oven of Kitchen is null!", oven);
+ assertEquals("Oven is of incorrect type", Oven.class.getName(), oven.getClass().getName());
+ assertEquals("Oven make is incorrect", "Westinghouse", oven.getMake());
+ assertEquals("Oven model is incorrect", "Economy", oven.getModel());
+ getPM().currentTransaction().commit();
+ }
+
+ /**
+ * Test for basic persistence of object with embedded object which has inheritance
+ * and persisting the subclass type of the embedded object.
+ */
+ public void testPersistSubclass() {
+ Object id = null;
+ try {
+ getPM().currentTransaction().begin();
+ Kitchen kitchen = new Kitchen(1);
+ MultifunctionOven oven = new MultifunctionOven("Westinghouse", "Economy");
+ oven.setMicrowave(true);
+ oven.setCapabilities("TIMER,CLOCK");
+ kitchen.setOven(oven);
+ getPM().makePersistent(kitchen);
+ getPM().currentTransaction().commit();
+ id = getPM().getObjectId(kitchen);
+ }
+ catch (Exception e) {
+ fail("Exception on persist : " + e.getMessage());
+ }
+ finally {
+ if (getPM().currentTransaction().isActive()) {
+ getPM().currentTransaction().rollback();
+ }
+ }
+
+ getPM().currentTransaction().begin();
+ Kitchen kitchen = (Kitchen)getPM().getObjectById(id);
+ assertEquals("Id of object is incorrect", 1, kitchen.getId());
+ Oven oven = kitchen.getOven();
+ assertNotNull("Oven of Kitchen is null!", oven);
+ assertEquals("Oven is of incorrect type", MultifunctionOven.class.getName(),
+ oven.getClass().getName());
+ MultifunctionOven multioven = (MultifunctionOven)oven;
+ assertEquals("Oven make is incorrect", "Westinghouse", multioven.getMake());
+ assertEquals("Oven model is incorrect", "Economy", multioven.getModel());
+ assertEquals("Oven microwave setting is incorrect", true, multioven.getMicrowave());
+ assertEquals("Oven capabilities is incorrect", "TIMER,CLOCK", multioven.getCapabilities());
+ getPM().currentTransaction().commit();
+ }
+
+ /**
+ * Test for querying of fields of base type of an embedded object.
+ */
+ @SuppressWarnings("unchecked")
+ public void testQueryBase() {
+ Object id = null;
+ try {
+ getPM().currentTransaction().begin();
+ Kitchen kitchen = new Kitchen(1);
+ MultifunctionOven oven = new MultifunctionOven("Westinghouse", "Economy");
+ oven.setMicrowave(true);
+ oven.setCapabilities("TIMER,CLOCK");
+ kitchen.setOven(oven);
+ getPM().makePersistent(kitchen);
+ getPM().currentTransaction().commit();
+ id = getPM().getObjectId(kitchen);
+ }
+ catch (Exception e) {
+ fail("Exception on persist : " + e.getMessage());
+ }
+ finally {
+ if (getPM().currentTransaction().isActive()) {
+ getPM().currentTransaction().rollback();
+ }
+ }
+
+ getPM().currentTransaction().begin();
+
+ Query q = getPM().newQuery("SELECT FROM " + Kitchen.class.getName() +
+ " WHERE this.oven.make == 'Westinghouse'");
+ List<Kitchen> kitchens = (List<Kitchen>)q.execute();
+ assertNotNull("No results from query!", kitchens);
+ assertEquals("Number of query results was incorrect", 1, kitchens.size());
+ Kitchen kit = kitchens.iterator().next();
+ assertEquals("Kitchen result is incorrect", id, getPM().getObjectId(kit));
+
+ getPM().currentTransaction().commit();
+ }
+
+ /**
+ * Test for querying of fields of subclass type of an embedded object.
+ */
+ @SuppressWarnings("unchecked")
+ public void testQuerySubclass() {
+ Object id = null;
+ try {
+ getPM().currentTransaction().begin();
+ Kitchen kitchen = new Kitchen(1);
+ MultifunctionOven oven = new MultifunctionOven("Westinghouse", "Economy");
+ oven.setMicrowave(true);
+ oven.setCapabilities("TIMER,CLOCK");
+ kitchen.setOven(oven);
+ getPM().makePersistent(kitchen);
+ getPM().currentTransaction().commit();
+ id = getPM().getObjectId(kitchen);
+ }
+ catch (Exception e) {
+ fail("Exception on persist : " + e.getMessage());
+ }
+ finally {
+ if (getPM().currentTransaction().isActive()) {
+ getPM().currentTransaction().rollback();
+ }
+ }
+
+ getPM().currentTransaction().begin();
+
+ Query q1 = getPM().newQuery("SELECT FROM " + Kitchen.class.getName() +
+ " WHERE this.oven instanceof org.apache.jdo.tck.pc.building.MultifunctionOven");
+ List<Kitchen> kitchens1 = (List<Kitchen>)q1.execute();
+ assertNotNull("No results from query!", kitchens1);
+ assertEquals("Number of query results was incorrect", 1, kitchens1.size());
+
+ // Query using cast and a field of the subclass embedded class
+ Query q2 = getPM().newQuery("SELECT FROM " + Kitchen.class.getName() +
+ " WHERE ((org.apache.jdo.tck.pc.building.MultifunctionOven)this.oven).capabilities
== 'TIMER,CLOCK'");
+ List<Kitchen> kitchens2 = (List<Kitchen>)q2.execute();
+ assertNotNull("No results from query!", kitchens2);
+ assertEquals("Number of query results was incorrect", 1, kitchens2.size());
+ Kitchen kit = kitchens2.iterator().next();
+ assertEquals("Kitchen result is incorrect", id, getPM().getObjectId(kit));
+
+ getPM().currentTransaction().commit();
+ }
+}
Added: db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Kitchen.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Kitchen.java?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Kitchen.java (added)
+++ db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Kitchen.java Mon Jan 30 08:09:46
2012
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jdo.tck.pc.building;
+
+import java.io.Serializable;
+
+/** This class represents an online shopping cart. It has a list of entries of
+ * type CartEntry.
+ */
+public class Kitchen implements Serializable {
+
+ protected static long nextId = System.currentTimeMillis();
+
+ public synchronized static long nextId() {
+ return nextId++;
+ }
+
+ /** Identity field for use with application identity */
+ protected long id;
+
+ /** The Oven we are using. */
+ protected Oven oven;
+
+ public Kitchen() {
+ this(nextId());
+ }
+
+ public Kitchen(long id) {
+ setId(id);
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ protected void setId(long id) {
+ this.id = id;
+ }
+
+ public void setOven(Oven ov) {
+ this.oven = ov;
+ }
+
+ public Oven getOven() {
+ return oven;
+ }
+
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (!(that instanceof Kitchen)) {
+ return false;
+ }
+ return equals((Kitchen) that);
+ }
+
+ public boolean equals(Kitchen that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ return this.id == that.id;
+ }
+
+ public int hashCode() {
+ return (int) id;
+ }
+
+ public static class Oid implements Serializable {
+ public long id;
+
+ public Oid() {
+ }
+
+ public Oid(String s) {
+ id = Long.parseLong(justTheId(s));
+ }
+
+ public String toString() {
+ return this.getClass().getName() + ":" + id;
+ }
+
+ public int hashCode() {
+ return (int) id;
+ }
+
+ public boolean equals(Object other) {
+ if (other != null && (other instanceof Oid)) {
+ Oid that = (Oid) other;
+ return that.id == this.id;
+ }
+ return false;
+ }
+
+ protected static String justTheId(String str) {
+ return str.substring(str.indexOf(':') + 1);
+ }
+ }
+}
Added: db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/MultifunctionOven.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/MultifunctionOven.java?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/MultifunctionOven.java (added)
+++ db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/MultifunctionOven.java Mon Jan
30 08:09:46 2012
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jdo.tck.pc.building;
+
+import java.io.Serializable;
+
+/**
+ * Representation of a multifunction oven in a fitted kitchen.
+ */
+public class MultifunctionOven extends Oven implements Serializable {
+
+ /** Whether this oven provides a microwave. */
+ protected boolean microwave;
+
+ /** Capabilities of this model */
+ protected String capabilities;
+
+ public MultifunctionOven(String make, String model) {
+ super(make, model);
+ }
+
+ public void setMicrowave(boolean micro) {
+ this.microwave = micro;
+ }
+
+ public boolean getMicrowave() {
+ return microwave;
+ }
+
+ public void setCapabilities(String caps) {
+ this.capabilities = caps;
+ }
+
+ public String getCapabilities() {
+ return capabilities;
+ }
+
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (!(that instanceof MultifunctionOven)) {
+ return false;
+ }
+ return super.equals((MultifunctionOven) that);
+ }
+
+ public boolean equals(MultifunctionOven that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ return super.equals(that);
+ }
+}
Added: db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Oven.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Oven.java?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Oven.java (added)
+++ db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/Oven.java Mon Jan 30 08:09:46
2012
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jdo.tck.pc.building;
+
+import java.io.Serializable;
+
+/**
+ * Representation of an oven in a fitted kitchen.
+ */
+public class Oven implements Serializable {
+
+ /** Manufacturer of the appliance. */
+ protected String make;
+
+ /** Model of this appliance. */
+ protected String model;
+
+ public Oven(String make, String model) {
+ setMake(make);
+ setModel(model);
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public String getMake() {
+ return make;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public boolean equals(Object that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+ if (!(that instanceof Oven)) {
+ return false;
+ }
+ return equals((Oven) that);
+ }
+
+ public boolean equals(Oven that) {
+ if (this == that) {
+ return true;
+ }
+ if (that == null) {
+ return false;
+ }
+
+ if ((make == null && that.make != null) ||
+ (make != null && that.make == null)) {
+ return false;
+ }
+ if ((model == null && that.model != null) ||
+ (model != null && that.model == null)) {
+ return false;
+ }
+ return this.make.equals(that.make) && this.model.equals(that.make);
+ }
+
+ public int hashCode() {
+ return (make != null ? make.hashCode() : 0) ^ (model != null ? model.hashCode() : 0);
+ }
+}
Added: db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/package.html
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/package.html?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/package.html (added)
+++ db/jdo/trunk/tck/src/java/org/apache/jdo/tck/pc/building/package.html Mon Jan 30 08:09:46
2012
@@ -0,0 +1,4 @@
+<BODY>
+ Package providing a simple model for testing embedding of objects and, in particular,
+ the use of inheritance of the embedded objects.
+</BODY>
\ No newline at end of file
Added: db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/package.jdo
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/package.jdo?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/package.jdo
(added)
+++ db/jdo/trunk/tck/src/jdo/applicationidentity/org/apache/jdo/tck/pc/building/package.jdo
Mon Jan 30 08:09:46 2012
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<jdo xmlns="http://java.sun.com/xml/ns/jdo/jdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdo
+ http://java.sun.com/xml/ns/jdo/jdo_3_0.xsd">
+
+ <package name="org.apache.jdo.tck.pc.building">
+
+ <class name="Kitchen" detachable="true">
+ <field name="id" primary-key="true"/>
+ <field name="oven"/>
+ </class>
+
+ <class name="Oven" embedded-only="true"/>
+ <class name="MultifunctionOven" embedded-only="true"/>
+ </package>
+</jdo>
Added: db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/package.jdo
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/package.jdo?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/package.jdo
(added)
+++ db/jdo/trunk/tck/src/jdo/datastoreidentity/org/apache/jdo/tck/pc/building/package.jdo
Mon Jan 30 08:09:46 2012
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<jdo xmlns="http://java.sun.com/xml/ns/jdo/jdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdo
+ http://java.sun.com/xml/ns/jdo/jdo_3_0.xsd">
+
+ <package name="org.apache.jdo.tck.pc.building">
+
+ <class name="Kitchen" detachable="true">
+ <field name="id"/>
+ <field name="oven"/>
+ </class>
+
+ <class name="Oven" embedded-only="true"/>
+ <class name="MultifunctionOven" embedded-only="true"/>
+ </package>
+</jdo>
Added: db/jdo/trunk/tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/package-standard12.orm?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
(added)
+++ db/jdo/trunk/tck/src/orm/applicationidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
Mon Jan 30 08:09:46 2012
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+This file contains the schema information when an implementation has application-id.
+-->
+<orm xmlns="http://java.sun.com/xml/ns/jdo/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/orm
+ http://java.sun.com/xml/ns/jdo/orm_2_1.xsd">
+ <package name="org.apache.jdo.tck.pc.building">
+ <class name="Kitchen" table="KITCHEN">
+ <field name="id" column="KITCHEN_ID"/>
+ <field name="oven">
+ <embedded null-indicator-column="OVEN_MAKE">
+ <discriminator column="OVEN_DISCRIM"/>
+ <field name="make" column="OVEN_MAKE"/>
+ <field name="model" column="OVEN_MODEL"/>
+ </embedded>
+ </field>
+ </class>
+
+ <class name="Oven">
+ <inheritance>
+ <discriminator strategy="class-name" column="DISCRIM"/>
+ </inheritance>
+ <field name="make" column="MAKE"/>
+ <field name="model" column="MODEL"/>
+ </class>
+
+ <class name="MultifunctionOven">
+ <field name="microwave" column="MICROWAVE"/>
+ <field name="capabilities" column="CAPABILITIES"/>
+ </class>
+ </package>
+</orm>
Added: db/jdo/trunk/tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/package-standard12.orm?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
(added)
+++ db/jdo/trunk/tck/src/orm/datastoreidentity/org/apache/jdo/tck/pc/building/package-standard12.orm
Mon Jan 30 08:09:46 2012
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+This file contains the schema information when an implementation has application-id.
+-->
+<orm xmlns="http://java.sun.com/xml/ns/jdo/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/orm
+ http://java.sun.com/xml/ns/jdo/orm_2_1.xsd">
+ <package name="org.apache.jdo.tck.pc.building">
+ <class name="Kitchen" table="KITCHEN">
+ <datastore-identity strategy="increment" column="DATASTORE_ID"/>
+ <field name="id" column="KITCHEN_ID"/>
+ <field name="oven">
+ <embedded null-indicator-column="OVEN_MAKE">
+ <discriminator column="OVEN_DISCRIM"/>
+ <field name="make" column="OVEN_MAKE"/>
+ <field name="model" column="OVEN_MODEL"/>
+ </embedded>
+ </field>
+ </class>
+
+ <class name="Oven">
+ <inheritance>
+ <discriminator strategy="class-name" column="DISCRIM"/>
+ </inheritance>
+ <field name="make" column="MAKE"/>
+ <field name="model" column="MODEL"/>
+ </class>
+
+ <class name="MultifunctionOven">
+ <field name="microwave" column="MICROWAVE"/>
+ <field name="capabilities" column="CAPABILITIES"/>
+ </class>
+ </package>
+</orm>
Added: db/jdo/trunk/tck/src/sql/derby/applicationidentity/schema12.sql
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/sql/derby/applicationidentity/schema12.sql?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/sql/derby/applicationidentity/schema12.sql (added)
+++ db/jdo/trunk/tck/src/sql/derby/applicationidentity/schema12.sql Mon Jan 30 08:09:46 2012
@@ -0,0 +1,34 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+-- SchemaType: application identity
+
+connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser';
+
+CREATE SCHEMA applicationidentity12;
+SET SCHEMA applicationidentity12;
+
+DROP TABLE KITCHEN;
+
+CREATE TABLE KITCHEN (
+ KITCHEN_ID BIGINT NOT NULL,
+ OVEN_DISCRIM VARCHAR(128) NOT NULL,
+ OVEN_MAKE VARCHAR(255),
+ OVEN_MODEL VARCHAR(255),
+ MICROWAVE CHAR(1) CHECK (MICROWAVE IN ('Y','N') OR MICROWAVE IS NULL),
+ CAPABILITIES VARCHAR(255),
+
+ CONSTRAINT KITCHEN_PK PRIMARY KEY (KITCHEN_ID)
+);
Added: db/jdo/trunk/tck/src/sql/derby/datastoreidentity/schema12.sql
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck/src/sql/derby/datastoreidentity/schema12.sql?rev=1237563&view=auto
==============================================================================
--- db/jdo/trunk/tck/src/sql/derby/datastoreidentity/schema12.sql (added)
+++ db/jdo/trunk/tck/src/sql/derby/datastoreidentity/schema12.sql Mon Jan 30 08:09:46 2012
@@ -0,0 +1,36 @@
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements. See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+
+-- SchemaType: datastore identity
+
+connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser';
+
+CREATE SCHEMA datastoreidentity12;
+SET SCHEMA datastoreidentity12;
+
+DROP TABLE KITCHEN;
+
+CREATE TABLE KITCHEN (
+ DATASTORE_ID BIGINT NOT NULL,
+ KITCHEN_ID BIGINT NOT NULL,
+ OVEN_DISCRIM VARCHAR(128) NOT NULL,
+ OVEN_MAKE VARCHAR(255),
+ OVEN_MODEL VARCHAR(255),
+ MICROWAVE CHAR(1) CHECK (MICROWAVE IN ('Y','N') OR MICROWAVE IS NULL),
+ CAPABILITIES VARCHAR(255),
+
+ CONSTRAINT KITCHEN_PK PRIMARY KEY (DATASTORE_ID),
+ CONSTRAINT KITCHEN_UK UNIQUE (KITCHEN_ID)
+);
|